Results 1 to 6 of 6

Thread: mplayer/ mencoder record and play webcam and audio

  1. #1
    Join Date
    Feb 2008
    Location
    Farwell, Mi
    Beans
    66
    Distro
    Kubuntu 11.04 Natty Narwhal

    mplayer/ mencoder record and play webcam and audio

    ok I was wondering if someone could pelase help me with somthing

    Ive gotten mencoder to be able to rip a video using my usb webcam/mic by logitech and the qaulity is awsome.

    what id like to do is have mplayer pop up at the same time playing/monitoring the stream as it records.. heres the code imj using for mencoder

    Code:
    mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video1:forceaudio:adevice=/dev/dsp2 -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o webcam.avi
    Ubuntu-4-Life


    Affordable Webhosting

    www.Global-Web.us


  2. #2
    Join Date
    Dec 2006
    Beans
    7,349

    Re: mplayer/ mencoder record and play webcam and audio

    Hi rfayer,

    Quote Originally Posted by rfrayer View Post
    Ive gotten mencoder to be able to rip a video using my usb webcam/mic by logitech and the qaulity is awsome.

    what id like to do is have mplayer pop up at the same time playing/monitoring the stream as it records.. heres the code imj using for mencoder
    Code:
    mencoder tv:// -tv driver=v4l:width=320:height=240:device=/dev/video1:forceaudio:adevice=/dev/dsp2 -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o webcam.avi
    I have not tested this fully but I believe the following is one way that might be worth a look at:

    Code:
    mencoder tv:// \
       -tv driver=v4l:width=320:height=240:device=/dev/video1:forceaudio:adevice=/dev/dsp2 \
       -ovc lavc \
       -oac mp3lame -lameopts cbr:br=64:mode=3 \
       -o >(tee webcam.avi | mplayer -)
    My apologies for not testing this one properly, I do not have device to capture from really, crossing my fingers that it works for you . BTW have you thought of adding a few -lavcopts to your output video?

    Andrew

  3. #3
    Join Date
    Jul 2008
    Beans
    201

    Re: mplayer/ mencoder record and play webcam and audio

    mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video1:forceaudio:adevice=/dev/dsp1:brightness=90:volume=35000 -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o > mplayer -


    tryin this for starters, but no, the mplayer window doesnt
    pop up. In terminal I see:

    1 duplicate frame(s)!

    4 duplicate frame(s)!

    3 duplicate frame(s)!

    3 duplicate frame(s)!

    2 duplicate frame(s)!


    etc




    josvanr

  4. #4
    Join Date
    Jul 2008
    Beans
    201

    Re: mplayer/ mencoder record and play webcam and audio

    argh.. spent another day on this. but it still seems to
    be simply impossible to view and record from webcam
    at the same time,well using mplayer&mencoder anyway
    (tried using mkfifo stream.yuv and
    pipe-ing but... nop)

    josvanr
    Last edited by josvanr; January 18th, 2011 at 11:36 PM.

  5. #5
    Join Date
    Jan 2008
    Location
    Bogotá, Colombia
    Beans
    8
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: mplayer/ mencoder record and play webcam and audio

    Im worked o it (tv input) last week and i wrote this script:

    mencoder \
    -tv driver=v4l2:device=/dev/video0:input=0:normid=0:alsa:adevice=hw.2:amode=1: audiorate=32000:immediatemode=0:width=496:height=3 71:chanlist=us-cable \
    -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=600 \
    -oac mp3lame -lameopts cbr:br=64 \
    tv:// \
    -o $PATH1/${TODAY}_${NOW}_CH.mp4 &
    sleep 1
    mplayer $PATH1/${TODAY}_${NOW}_CH.mp4 -vo xv
    killall mencoder



    to view all i do see and comment:
    http://trucos-ubuntu.blogspot.com/
    http://dl.dropbox.com/u/7360282/ubuntucosas/rec.sh (i blind this script to a remote key)

  6. #6
    Join Date
    Jul 2008
    Beans
    201

    Re: mplayer/ mencoder record and play webcam and audio

    hello

    thnx for your reply (I realize it has been some time)

    but I don't understand: your script seems to record one second of
    webcam to a file and then play that with mplayer..? Whatis
    it supposed to do?


    josvanr


    Quote Originally Posted by dfoxpro View Post
    Im worked o it (tv input) last week and i wrote this script:

    mencoder \
    -tv driver=v4l2:device=/dev/video0:input=0:normid=0:alsa:adevice=hw.2:amode=1: audiorate=32000:immediatemode=0:width=496:height=3 71:chanlist=us-cable \
    -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=600 \
    -oac mp3lame -lameopts cbr:br=64 \
    tv:// \
    -o $PATH1/${TODAY}_${NOW}_CH.mp4 &
    sleep 1
    mplayer $PATH1/${TODAY}_${NOW}_CH.mp4 -vo xv
    killall mencoder



    to view all i do see and comment:
    http://trucos-ubuntu.blogspot.com/
    http://dl.dropbox.com/u/7360282/ubuntucosas/rec.sh (i blind this script to a remote key)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •