[FFmpeg-user] v4l TV Sound Problem

llarevo at gmx.net llarevo at gmx.net
Wed Mar 27 21:11:31 CET 2013


Carl Eugen Hoyos writes:
> llarevo <at> gmx.net <llarevo <at> gmx.net> writes:
> 
> [...]
> 
> So much console output, but neither your failing FFmpeg 
> command line nor its complete, uncut console output ;-(

Oooops, forgotten. Sorry. ffmpeg doesn't show any error and its
producing a good video, just with a quiet audio track. ffmpeg changes
the capture input of the sound card unintentional and doesn't record the
sound even after changing the audio capture input with amixer.

ffmpeg -loglevel debug -f alsa -ac 2 -i hw:SAA7134 -f video4linux2
-i /dev/video0 -flags +ilme+ildct -aspect 4/3 -target pal-dvd -y
test.mpg
ffmpeg version N-50974-g7d15cd4 Copyright (c) 2000-2013 the FFmpeg
developers
  built on Mar 19 2013 13:04:44 with gcc 4.7.2 (GCC) 20121109 (Red Hat
4.7.2-8)
  configuration: --prefix=/usr/local --bindir=/usr/local/bin
--datadir=/usr/local/share/ffmpeg --incdir=/usr/local/include/ffmpeg
--libdir=/usr/local/lib64 --mandir=/usr/local/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'
--enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls
--enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394
--disable-indev=jack --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264
--enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc
--enable-pthreads --disable-static --enable-shared --enable-gpl
--disable-debug --disable-stripping --shlibdir=/usr/local/lib64
--enable-runtime-cpudetect
  libavutil      52. 19.100 / 52. 19.100
  libavcodec     55.  0.100 / 55.  0.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 45.104 /  3. 45.104
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav*
logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with
argument 'alsa'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-i' ... matched as input file with argument
'hw:SAA7134'.
Reading option '-f' ... matched as option 'f' (force format) with
argument 'video4linux2'.
Reading option '-i' ... matched as input file with argument
'/dev/video0'.
Reading option '-flags' ... matched as AVOption 'flags' with argument
'+ilme+ildct'.
Reading option '-aspect' ... matched as option 'aspect' (set aspect
ratio (4:3, 16:9 or 1.3333, 1.7777)) with argument '4/3'.
Reading option '-target' ... matched as option 'target' (specify target
file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
"ntsc-svcd", ...)) with argument 'pal-dvd'.
Reading option '-y' ... matched as option 'y' (overwrite output files)
with argument '1'.
Reading option 'test.mpg' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set libav* logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file hw:SAA7134.
Applying option f (force format) with argument alsa.
Applying option ac (set number of audio channels) with argument 2.
Successfully parsed a group of options.
Opening an input file: hw:SAA7134.
[alsa @ 0x13d7940] All info found
[alsa @ 0x13d7940] Estimating duration from bitrate, this may be
inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:SAA7134':
  Duration: N/A, start: 1364414540.292880, bitrate: 1024 kb/s
    Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 32000 Hz, stereo, s16,
1024 kb/s
Successfully opened the file.
Parsing a group of options: input file /dev/video0.
Applying option f (force format) with argument video4linux2.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[video4linux2,v4l2 @ 0x1406b00] fd:6 capabilities:5010015
[video4linux2,v4l2 @ 0x1406b00] Selecting input_channel: 0
[video4linux2,v4l2 @ 0x1406b00] input_channel: 0, input_name: Television
[video4linux2,v4l2 @ 0x1406b00] Querying the device for the current
frame size
[video4linux2,v4l2 @ 0x1406b00] Setting frame size to 720x576
[video4linux2,v4l2 @ 0x1406b00] The V4L2 driver is using the interlaced
mode
[video4linux2,v4l2 @ 0x1406b00] Current standard: PAL-BG, id: 7,
frameperiod: 1/25
[video4linux2,v4l2 @ 0x1406b00] All info found
[video4linux2,v4l2 @ 0x1406b00] Estimating duration from bitrate, this
may be inaccurate
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1364414540.385386, bitrate: 124416 kb/s
    Stream #1:0, 1, 1/1000000: Video: rawvideo (I420 / 0x30323449),
yuv420p, 720x576, 1/1000000, 124416 kb/s, 25 fps, 25 tbr, 1000k tbn,
1000k tbc
Successfully opened the file.
Parsing a group of options: output file test.mpg.
Applying option aspect (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777))
with argument 4/3.
Applying option target (specify target file type ("vcd", "svcd", "dvd",
"dv", "dv50", "pal-vcd", "ntsc-svcd", ...)) with argument pal-dvd.
Successfully parsed a group of options.
Opening an output file: test.mpg.
Successfully opened the file.
[buffer @ 0x13e6d60] Setting entry with key 'video_size' to value
'720x576'
[buffer @ 0x13e6d60] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0x13e6d60] Setting entry with key 'time_base' to value
'1/1000000'
[buffer @ 0x13e6d60] Setting entry with key 'pixel_aspect' to value
'0/1'
[buffer @ 0x13e6d60] Setting entry with key 'sws_param' to value
'flags=2'
[buffer @ 0x13e6d60] Setting entry with key 'frame_rate' to value '25/1'
[graph 0 input from stream 1:0 @ 0x140ba20] w:720 h:576 pixfmt:yuv420p
tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
[scale @ 0x140b900] Setting 'w' to value '720'
[scale @ 0x140b900] Setting 'h' to value '576'
[scale @ 0x140b900] Setting 'flags' to value '0x4'
[scaler for output stream 0:0 @ 0x140c0e0] w:720 h:576 flags:'0x4'
interl:0
[scaler for output stream 0:0 @ 0x140c0e0] w:720 h:576 fmt:yuv420p
sar:0/1 -> w:720 h:576 fmt:yuv420p sar:0/1 flags:0x4
[abuffer @ 0x13f0080] Setting entry with key 'time_base' to value
'1/32000'
[abuffer @ 0x13f0080] Setting entry with key 'sample_rate' to value
'32000'
[abuffer @ 0x13f0080] Setting entry with key 'sample_fmt' to value 's16'
[abuffer @ 0x13f0080] Setting entry with key 'channel_layout' to value
'0x3'
[graph 1 input from stream 0:0 @ 0x140b9a0] tb:1/32000 samplefmt:s16
samplerate:32000 chlayout:0x3
[aformat @ 0x140bce0] Setting entry with key 'sample_fmts' to value
'fltp'
[aformat @ 0x140bce0] Setting entry with key 'sample_rates' to value
'48000'
[aformat @ 0x140bce0] Setting entry with key 'channel_layouts' to value
'0x4,0x3,0x103,0x7,0x603,0x33,0x107,0x607,0x37,0xc,0xb,0x10b,0xf,0x60b,0x3b,0x10f,0x60f,0x3f'
[audio format for output stream 0:1 @ 0x13f0200] auto-inserting filter
'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the
filter 'audio format for output stream 0:1'
[auto-inserted resampler 0 @ 0x13f2480] ch:2 chl:stereo fmt:s16
r:32000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
[mpeg2video @ 0x140c6e0] detected 4 logical cores
[mpeg2video @ 0x140c6e0] intra_quant_bias = 96 inter_quant_bias = 0
Output #0, dvd, to 'test.mpg':
  Metadata:
    encoder         : Lavf55.0.100
    Stream #0:0, 0, 1/90000: Video: mpeg2video, yuv420p, 720x576 [SAR
16:15 DAR 4:3], 1/25, q=2-31, 6000 kb/s, 90k tbn, 25 tbc
    Stream #0:1, 0, 1/90000: Audio: ac3, 48000 Hz, stereo, fltp, 448
kb/s
Stream mapping:
  Stream #1:0 -> #0:0 (rawvideo -> mpeg2video)
  Stream #0:0 -> #0:1 (pcm_s16le -> ac3)
Press [q] to stop, [?] for help
[dvd @ 0x140c1a0] First SCR: 0 First DTS: 45000
frame=  141 fps= 25 q=3.6 Lsize=    4568kB time=00:00:05.72
bitrate=6537.9kbits/s    
video:4170kB audio:313kB subtitle:0 global headers:0kB muxing overhead
1.895009%

Correct amixer setting before starting ffmpeg:

amixer -c1
Simple mixer control 'Line',1
  Capabilities: volume cswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 20
  Front Left: 20 [100%] Capture [off]
  Front Right: 20 [100%] Capture [off]
Simple mixer control 'Line',2
  Capabilities: volume cswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 20
  Front Left: 20 [100%] Capture [on]   <!--OK, here comes the sound--!>
  Front Right: 20 [100%] Capture [on]  <!--OK, here comes the sound--!>
Simple mixer control 'Video',0
  Capabilities: volume cswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 20
  Front Left: 20 [100%] Capture [off]
  Front Right: 20 [100%] Capture [off]


Wrong amixer setting after starting ffmpeg:


 amixer -c1
Simple mixer control 'Line',1
  Capabilities: volume cswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 20
  Front Left: 20 [100%] Capture [off]
  Front Right: 20 [100%] Capture [off]
Simple mixer control 'Line',2
  Capabilities: volume cswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 20
  Front Left: 20 [100%] Capture [off]
  Front Right: 20 [100%] Capture [off]
Simple mixer control 'Video',0
  Capabilities: volume cswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 20
  Front Left: 20 [100%] Capture [on]  <!-----Not OK, this is silent--!>
  Front Right: 20 [100%] Capture [on] <!-----Not OK, this is silent--!>

Switching back while capturing with ffmpeg doesn't bring up the sound.

Thanks
-- 
Felix





More information about the ffmpeg-user mailing list