Linux

Categorized | Applications, cli

Viewing a webcam with MPlayer in Linux

MPlayer has tons of other uses besides viewing video files. For example, you can view your webcam with it:

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

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


2 Comments

  1. Fotis

    I am sending you the result of issuing the command you tipped.

    $ mplayer -cache 128 -tv driver=v4l:width=640:height=480:outfmt=i420 -vc rawi420 -vo xv tv://
    MPlayer 1.0rc2-4.3.2 (C) 2000-2007 MPlayer Team
    CPU: Intel(R) Pentium(R) Dual CPU E2180 @ 2.00GHz (Family: 6, Model: 15, Stepping: 13)
    CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
    Compiled with runtime CPU detection.
    Option msglevel: Unknown suboption 5
    Warning unknown option msglevel at line 5
    mplayer: could not connect to socket
    mplayer: No such file or directory
    Failed to open LIRC support. You will not be able to use your remote control.

    Playing tv://.
    Cache fill: 0.00% (0 bytes)
    TV file format detected.
    Selected driver: v4l
    name: Video 4 Linux input
    author: Alex Beregszaszi
    comment: under development
    =================================================================
    WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
    As the V4L1 compatibility layer is broken, this may not work.
    If you encounter any problems, use driver=v4l2 instead.
    Bugreports on driver=v4l with v4l2 drivers will be ignored.
    =================================================================
    Selected device: Sirius USB2.0 Camera
    Capabilites: capture
    Device type: 1
    Supported sizes: 48×32 => 640×480
    Inputs: 1
    ioctl get channel failed: Invalid argument
    ioctl set chan failed: Invalid argument
    ioctl set chan failed: Invalid argument
    Error: Cannot set norm!
    Selected input hasn’t got a tuner!
    ioctl set picture failed: Invalid argument
    The ‘outfmt’ of ‘Planar I420′ is likely not supported by your card

    MPlayer interrupted by signal 11 in module: demux_open
    - MPlayer crashed by bad usage of CPU/FPU/RAM.
    Recompile MPlayer with --enable-debug and make a ‘gdb’ backtrace and
    disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
    - MPlayer crashed. This shouldn’t happen.
    It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
    gcc version. If you think it’s MPlayer’s fault, please read
    DOCS/HTML/en/bugreports.html and follow the instructions there. We can’t and
    won’t help unless you provide this information when reporting a possible bug.

    1
  2. thugangel

    Fotis, use v4l2 instead of v4l. Also, dropping “-vc rawi420″ would help.

    mplayer -cache 128 -tv driver=v4l2:width=640:height=480 -vo xv tv://

    2

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>