Viewing a V4L webcam with mplayer…

This took me a few minutes, but I figured it out, and archived it here so I wouldn’t need to spend that time again.

mplayer -cache 128 -tv driver=v4l:width=640:height=480:outfmt=i420 -vc rawi420 -vo xv tv://

It works.

Me, via a Logitech Communicate STX webcam

[tags]My Projects,Webcam,Mplayer[/tags]

Addendum: You can specify which video device by adding it to the tv options:

mplayer -cache 128 -tv driver=v4l:width=640:height=480:outfmt=i420:device=/dev/video1 -vc rawi420 -vo xv tv://

7 Responses to “Viewing a V4L webcam with mplayer…”

  1. Alexei Colin Says:

    Thank you for this post!

  2. USB OTG goes webcam : Location-aware mobility Says:

    [...] to google and brainwagon fro the [...]

  3. Ashish Says:

    I am hoping this will save a lot of time…………Thanks in Anticipation

  4. Gabriel Says:

    Mine needs the frame rate. This works:

    mplayer -fps 30 -tv driver=v4l:width=640:height=480:device=/dev/video1 tv://

  5. Richard Says:

    Has anyone get this working with a Logitech Quickcam on N800? If yes, where can I find the kernel module?

  6. Matt R. Says:

    Worked first time, thanks! (Using it with a Logitech Communicate STX USB webcam and the gspca driver for it, which provides a v4l interface.)

  7. Brett Says:

    Need to use ‘v4l2′ driver on Hardy 8.04 (Linux thor 2.6.27-7-generic #1 SMP Fri Oct 24 06:42:44 UTC 2008 i686 GNU/Linux):

    mplayer -fps 30 -cache 128 -tv driver=v4l2:width=640:height=480:device=/dev/video0 tv://

    This is rockin!! Long live mplayer!
    Still one of my fav apps for almost a decade. :)

    Cheers

Leave a Reply