0

I have created Video0 device using V4l2loopback and used the following sample Git code V4l2Loopback_cpp as a application to stream jpg images from a folder sequential by altering some conditions in the code.But the code read images as 24Bit RGB image and send it Video0 device which is fine ,because the image run like a proper video on VLC video device capture. As i mentioned earlier thet if i checked the VLC properties of the video its Shows the following content enter image description here

i need this video0 device to stream rtsp h264 video in vlc using the gstreamer lib . i have used the following command to check in commandline for testing but its show some internal process error

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=590,height=332,framerate=30/1 ! x264enc ! rtph264pay name=pay0 pt=96

i dont know whats the problem here .is it 24bit jpeg format or the gstreamer command i use. I need a proper gstreamer command line to process the video0 devide to stream h264 rtsp video any help is appreciated thank u.

image Format - jpg (sequence image passed) Video0 recives - 24-bit RGB image output need - h264 rtsp stream from video0

dinesh47
  • 37
  • 7

1 Answers1

0

Not sure this is a solution, but the following may help:

  1. You may try adjusting resolution according to what V4L reports (width=584) :
v4l2src device=/dev/video0 ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! videoconvert ! x264enc insert-vui=1 ! h264parse ! rtph264pay name=pay0 pt=96
  1. Note that this error may happen on v4l2loopback receiver side while it may be a sender error. If you're feeding v4l2loopback with a gstreamer pipeline to v4l2sink, you would try adding identity such as:
... ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! identity drop-allocation=1 ! v4l2sink
SeB
  • 1,159
  • 6
  • 17
  • i have tried this as command in gst_launch-1.0 "v4l2src device=/dev/video0 ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! videoconvert ! x264enc insert-vui=1 ! h264parse ! rtph264pay name=pay0 pt=96 " but i dont know which port its sending the packet ,can u help with that and will it be a TCP packet or UDP i have tried adding And when i try to run in testlaunch.c by gstream examples i get the following error (Gstremer_img2vid2:882329): GStreamer-CRITICAL **: 05:37:12.550: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed – dinesh47 Apr 25 '22 at 05:40
  • These pipelines are not complete, note these have no sink. These are expected to be provided as H264 source to RSTP server example such as test-launch. Test-launch will manage the connection, ports and protocols, and add what it needs to your source sub-pipeline. Be sure to use test-launch example sources from the same gstreamer version you are running. – SeB May 11 '22 at 19:31