RTSP server using v4l2src

Gary Thomas gary at mlbassoc.com
Wed Apr 10 05:25:32 PDT 2013


On 2013-04-10 06:11, yusuf.husainy wrote:
> Hello everyone,
>
> I am using the test-video.c for the server code but using v4l2src instead of
> videotestsrc. The pipeline for the server is:
>
> v4l2src device=/dev/video0 ! video/x-raw-yuv, width=800, height=600,
> framerate=30/1 ! x264enc ! rtph264pay name=pay0 pt=96.
>
> at the client, I am using VLC player to live stream.
>
> when running the following command in terminal using above pipeline at
> server, I got errors.
>
> $ vlc rtsp://192.168.1.44:8554/test
> VLC media player 2.0.5 Twoflower (revision 2.0.5-0-g1661b7d)
> [0x9bae908] main libvlc: Running vlc with the default interface. Use 'cvlc'
> to use vlc without interface.
> [0xb4e03f88] live555 demux error: Failed to connect with
> rtsp://192.168.1.44:8554/test
> [0xb4e00618] main input error: open of `rtsp://192.168.1.44:8554/test'
> failed
>
>
>
> However,
> when I use videotestsrc as my pipeline raw video source instead of v4l2src,
> I got no error and the streaming starts flawlessly. I can view the test
> video pattern generated by videotestsrc on my client using VLC with the same
> command as above.
>
> I cant figure out why v4l2src is not working with RTSP server???
>
> I even tried using ffenc_mpeg4 and rtpmp4vpay instead of x264enc and
> rtph264enc, but the same error occurs, I cannot connect to the server using
> v4l2src, but videotestsrc has no problem at all, I can connect and also view
> the test pattern.
>
> I appreciate any suggestion or solutions.

It's probably a CAPS mismatch between what your video source produces and
what x264enc wants.  Try running the pipeline using gst-launch to
figure out the details.  Something like this:
   gst-launch -vvv v4l2src device=/dev/video0 ! video/x-raw-yuv, width=800, height=600, framerate=30/1  ! fakesink
You'll get messages about what the CAPS are coming from the source that
you can check against what x264enc wants.

You could also toss in a ffmpegcolorspace element to match them up, e.g.
   ... ! ffmpegcolorspace ! x264enc ...

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


More information about the gstreamer-devel mailing list