Question

I've been trying to record feed from my S-Video cable using avconv. I am able to record composite video with avconv, but the quality isn't the best. To set the input, I use v4l2-ctl -i $n, where $n is either 0 for composite, or 1 for S-Video. I tried to use v4l2-ctl -i 1 to set the input, but that doesn't work. Oddly enough, when I use tvtime or qv4l2 I can view the video.

I am able to record audio, just not the video. In tvtime I can get audio as well as video. Also, I was able to record the S-Video with ffmpeg using the -channel option. ffmpeg, btw, can't record the audio, and recording the separate audio isn't an option.

Edit: as per Anton's request, here's the command I use to capture video with avconv.

avconv -f video4linux2 -i /dev/video0 -f alsa -i hw:2,0 -vcodec mpeg4 -vtag xvid -b 8000k -r 30000/1001 -acodec \
libmp3lame -ar 48000 -ac 2 -ab 192k -aspect 16:9 -vf yadif=0,scale=1200:800 -y test.avi

And here's the output from this command:

avconv version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
[video4linux2 @ 0x982340] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2, from '/dev/video0':
  Duration: N/A, start: 1368113780.210591, bitrate: 165722 kb/s
   Stream #0.0: Video: rawvideo, yuyv422, 720x480, 165722 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
[alsa @ 0x982ba0] Estimating duration from bitrate, this may be inaccurate
Input #1, alsa, from 'hw:2,0':
  Duration: N/A, start: 854.715783, bitrate: N/A
    Stream #1.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Incompatible pixel format 'yuyv422' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x9930a0] w:720 h:480 pixfmt:yuyv422
[yadif @ 0x997960] mode:0 parity:-1 auto_enable:0
[yadif @ 0x997960] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'Parsed filter 0 yadif'
[scale @ 0x985a80] w:720 h:480 fmt:yuyv422 -> w:720 h:480 fmt:yuv420p flags:0x4
[scale @ 0x998000] w:720 h:480 fmt:yuv420p -> w:1200 h:800 fmt:yuv420p flags:0x4
Output #0, avi, to 'test.avi':
  Metadata:
    ISFT            : Lavf53.21.1
    Stream #0.0: Video: mpeg4, yuv420p, 1200x800 [PAR 32:27 DAR 16:9], q=2-31, 8000 kb/s, 29.97 tbn, 29.97 tbc
    Stream #0.1: Audio: libmp3lame, 48000 Hz, 2 channels, s16, 192 kb/s
Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
      Stream #1:0 -> #0:1 (pcm_s16le -> libmp3lame)
Was it helpful?

Solution

Try this:

avconv -f video4linux2 -i /dev/video0 -f alsa -ac 1 -i hw:2,0 \
-vcodec mpeg4 -vtag xvid -b 8000k -r 30000/1001 -acodec \
libmp3lame -ar 48000 -ac 2 -ab 192k -aspect 16:9 
-vf yadif=0,scale=1200:800 -y test.avi

Note the -ac 1, you must set the audio channel. Also note the \ for line breakings.

OTHER TIPS

The -channel option doesn't work with avconv? It should work the same as in ffmpeg. Also, provide your full commandline and avconv output.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top