Skip to content
umlaeute edited this page Apr 26, 2011 · 3 revisions

playing back v4l2loopback devices using MPlayer

producer

again a dummy producer, using gstreamer
gst-launch -v videotestsrc ! "video/x-raw-yuv,width=640,height=360,framerate=30/1,format=(fourcc)I420" ! v4l2sink device=/dev/video1

consumer

minimal mplayer playback mplayer tv:// -tv device=/dev/video1

feeding the pipe with MPlayer's "v4l2" output module

it seems like MPlayer's "v4l2" output module is really only meant for MPEG-decoders. it doesn't support uncompressed video, which is what v4l2loopback is using...

feeding the pipe with MPlayer's "yuv4mpeg" output module

in order to feed the loopback device with MPlayer's "yuv4mpeg" output module, you will need an intermediate program, that pushes the yuv4mpeg stream into the v4l2 device. an example for such a module can be found in the examples/ directory; it's called yuv4mpeg_to_v4l2 and is courtesy by Eric Cooper

producer

$ mkfifo /tmp/pipe
$ ./yuv4mpeg_to_v4l2 < /tmp/pipe &
$ mplayer movie.mp4 -vo yuv4mpeg:file=/tmp/pipe