Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

my ~/.bashrc contains the following function

webcamrecord () {
vlc v4l2:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/audio2" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 --sout="#transcode{vfilter=adjust{gamma=1.5},vcodec=theo,vb=2000,scale=0.67,acodec=vorb,ab=128,channels=2}:standard{access=file,mux=ogg,dst="output_file.ogg"}" 
}

The command works beautifully to record directly from my webcam, with one or two flaws. First, the video produced moves too quickly, between twice and three times the normal rate.

Also, there is no audio. This is less of an issue, but I would still like to fix this.

Can someone help me debug this command, so as to fix these issues?

share|improve this question
add comment

2 Answers 2

This one-liner worked for me, with audio and video:

vlc v4l2:// :input-slave=alsa:// :v4l-vdev="/dev/video0" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 --sout="#transcode{vcodec=theo,vb=2000,fps=12,scale=0.67,acodec=vorb,ab=90,channels=1,samplerate=44100}:standard{access=file,mux=ogg,dst=output.ogg}"

You could also try this one:

vlc v4l2:// :v4l-vdev="/dev/video0" :v4l-adev="/dev/pcm" :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma="" :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 --sout="#transcode{vcodec=theo,vb=2000,fps=12,scale=0.67,acodec=vorb,ab=90,channels=1,samplerate=44100}:standard{access=file,mux=ogg,dst=output.ogg}"

Your experience may vary, depending on your hardware. Good luck!

share|improve this answer
    
Huh, none of these are working for me. Only 'v4l2:///dev/videoX' works, but I don't know how to specify options there. The options on the wiki don't seem to work either (wiki.videolan.org/Documentation:Modules/v4l2#Video_input) –  gatoatigrado Sep 2 '13 at 20:51
add comment

Out of curiosity, are you sure that the audio source is the proper source?

Secondly (again, just a question) why aren't you using ffmpeg to stream the video instead?
Something like but not quite:

ffmpeg -b 100K -an -f video4linux2 -s 320x240 -r 10 -i /dev/audio2 -i /dev/video0 -b 100K -f ogg - | mplayer - -idle -demuxer ogg

Swap the audio input and video input to your liking and then mess around with the actual file conversion, i'm a bit rusty on ffmpeg and mplayer but it's doable. + a friend did it with raspberry pi with ~20fps @1080p so you should be fine with standard equipment via this method :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.