How to use GStreamer to stream from IP RTMP Camera to v4l2loopback Camera?

别说谁变了你拦得住时间么 提交于 2020-06-17 13:04:58

问题


I am trying to use GStreamer to connect RTMP/RTSP stream to a v4l2loopback Virtual Device.


Works 1 - RTMP to AutoVideoSink
sudo gst-launch-1.0 rtspsrc location=rtsp://192.168.xxx.xxx/live/av0 ! decodebin ! autovideosink
sudo gst-launch-1.0 rtmpsrc location=rtmp://192.168.xxx.xxx/live/av0 ! decodebin ! autovideosink


Works 2 - TestSrc to Dummy Video5
sudo gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video5


Does not work - RTMP to Dummy Video5 – No error but does not show the video
sudo gst-launch-1.0 rtspsrc location=rtsp://192.168.xxx.xxx/live/av0 do-timestamp=true
protocols="tcp" ! rtph264depay ! h264parse ! decodebin ! v4l2sink device=/dev/video5


I highly suspect there are some parameters of Gstreamer that are required and I am unaware of.
Because the log file has a lot of entries on unknown pixel format, default values, etc.


Please could you give me some pointers of which parameters to set?
The source is a high-quality PTZ camera which supports either RTMP and RTSP.
The sink is V4L2 loopback device.


回答1:


You might need a videoconvert after the decodebin

Try running your pipeline with GST_DEBUG=3 and that will give you more info on why caps negotiation failed!



来源:https://stackoverflow.com/questions/61303646/how-to-use-gstreamer-to-stream-from-ip-rtmp-camera-to-v4l2loopback-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!