Replies: 8 comments 13 replies
-
if rtmpStream function is like this... is possible to use RtmpCamera1 for the USB, should I pass the camera in RtmpCamera1.switchcamera(id) something like that ?? |
Beta Was this translation helpful? Give feedback.
-
Hello, Your original post is not using CameraUvcSource, it is using Camera2Source. I'm not sure if a USB camera can work like that. |
Beta Was this translation helpful? Give feedback.
-
I confirm there is some problem in the prepare Encoder, it is not changing the video bitrate, even in your sample application also I am facing the same issue. Here I am sending you the screenshot I gave private val vBitrate = 100 * 1000 like this but it streams at 5Mb |
Beta Was this translation helpful? Give feedback.
-
Hello, Are you using SurfaceView or TextureView with RtmpCamera1? |
Beta Was this translation helpful? Give feedback.
-
If you are using SurfaceView or TextureView with RtmpCamera1 the encoder is configured buffer to buffer mode that is totally different that the surface to buffer used in the others cases. forceCodecType(CodecUtil.CodecType.SOFTWARE, CodecUtil.CodecType.FIRST_COMPATIBLE_FOUND) |
Beta Was this translation helpful? Give feedback.
-
Instead of using SurfaceView, I used OpenGLView for USB Camera, it works fine, there is no lagging and video streaming is smooth. |
Beta Was this translation helpful? Give feedback.
-
I tested in 8000 * 1000 video bitrate, there is a lag in the stream |
Beta Was this translation helpful? Give feedback.
-
Your case is normally related with a keyframe issue. You have 4 encoders of H264: 2 hardware and 2 software. Using my app with rotation example(replace surfaceview to openglview if you need). Go to this file: if (name.equalsIgnoreCase("c2.mtk.avc.encoder")) return false;
if (name.equalsIgnoreCase("c2.mtk.avc.encoder.secure")) return false;
if (name.equalsIgnoreCase("c2.android.avc.encoder")) return false; That code will skip that codecs and use the next available code. Remember test using your video config and in both cases, with force software encoder and without it. |
Beta Was this translation helpful? Give feedback.
-
I need a help in prepareEncoders() function, whatever bitrate I pass, it is streaming at 5Mbps speed, in low internet situation the video is lagging very badly. By default iBitRate value will be 2 (for 2 Mbps streaming)...
The same logic is working perfectly for RtmpCamera1 here I am facing problem. Can any one help me
import android.hardware.usb.UsbDevice
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.SurfaceHolder
import android.view.SurfaceView
import android.view.View
import android.view.ViewGroup
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.widget.EditText
import android.widget.RelativeLayout
import android.widget.TextView
import android.widget.Toast
import androidx.annotation.RequiresApi
import androidx.fragment.app.Fragment
import com.lastmanstands.tv.usb.R
import com.lastmanstands.tv.usb.USBActivity
import com.lastmanstands.tv.usb.ui.AudioLevelMeter
import com.lastmanstands.tv.usb.ui.MultiStateButton
import com.lastmanstands.tv.usb.util.CameraEventListener
import com.lastmanstands.tv.usb.util.toast
import com.pedro.common.ConnectChecker
import com.pedro.encoder.input.gl.render.filters.AndroidViewFilterRender
import com.pedro.encoder.input.video.CameraHelper
import com.pedro.encoder.utils.gl.TranslateTo
import com.pedro.library.rtmp.RtmpStream
import com.pedro.library.util.BitrateAdapter
import com.wowza.gocoder.sdk.api.devices.WOWZAudioDevice
import java.text.CharacterIterator
import java.text.StringCharacterIterator
import java.util.Locale
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
class CameraFragment: Fragment(), ConnectChecker, CameraEventListener {
}
Beta Was this translation helpful? Give feedback.
All reactions