[FFmpeg-trac] #692(undetermined:open): Audio is not in sync with video, webcam capturing

FFmpeg trac at avcodec.org
Tue Nov 29 20:24:46 CET 2011


#692: Audio is not in sync with video, webcam capturing
-------------------------------------+-------------------------------------
             Reporter:  burek        |                    Owner:
                 Type:  defect       |                   Status:  open
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  v4l2 alsa    |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  1
-------------------------------------+-------------------------------------
Changes (by cehoyos):

 * keywords:   => v4l2 alsa
 * status:  new => open
 * reproduced:  0 => 1


Comment:

 I can reproduce the problem on my system (Bt878) with the following
 command:
 {{{
 $ ffmpeg -f video4linux2 -i /dev/video1 -f alsa -i hw:2 -qscale 2 out.avi
 ffmpeg version N-35260-g2cf4bd7, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Nov 28 2011 11:11:04 with gcc 4.5.3
   configuration: --cc='/usr/local/gcc-4.5.3/bin/gcc -m32'
   libavutil    51. 29. 1 / 51. 29. 1
   libavcodec   53. 38. 1 / 53. 38. 1
   libavformat  53. 22. 0 / 53. 22. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 50. 0 /  2. 50. 0
   libswscale    2.  1. 0 /  2.  1. 0
 [video4linux2,v4l2 @ 0x8d98b00] Estimating duration from bitrate, this may
 be inaccurate
 Input #0, video4linux2,v4l2, from '/dev/video1':
   Duration: N/A, start: 1322486483.843191, bitrate: 132710 kb/s
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 768x576,
 132710 kb/s, 25 tbr, 1000k tbn, 25 tbc
 [alsa @ 0x8d9f360] Estimating duration from bitrate, this may be
 inaccurate
 Input #1, alsa, from 'hw:2':
   Duration: N/A, start: 1322486483.836794, bitrate: N/A
     Stream #1:0: Audio: pcm_s16le, 32000 Hz, 2 channels, s16, 1024 kb/s
 [buffer @ 0x8d999a0] w:768 h:576 pixfmt:yuv420p tb:1/1000000 sar:0/1
 sws_param:
 Incompatible sample format 's16' for codec 'ac3', auto-selecting format
 'flt'
 [ac3 @ 0x8d968e0] channel_layout not specified
 [ac3 @ 0x8d968e0] No channel layout specified. The encoder will guess the
 layout, but it might be incorrect.
 Output #0, avi, to 'out.avi':
   Metadata:
     ISFT            : Lavf53.22.0
     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 768x576,
 q=2-31, 200 kb/s, 25 tbn, 25 tbc
     Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 32000 Hz, stereo, flt,
 128 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
   Stream #1:0 -> #0:1 (pcm_s16le -> ac3)
 Press [q] to stop, [?] for help
 frame= 1020 fps= 25 q=2.0 Lsize=  138227kB time=00:00:40.80
 bitrate=27753.9kbits/s
 video:137519kB audio:653kB global headers:0kB muxing overhead 0.039427%
 }}}
 The resulting file is out-of-sync, the amount is different for every run,
 works fine for me with -async 1 (but since your output is slightly
 difference, see "start:", that may not work for you).
 The following command always results in files that are in-sync:
 {{{
 $ mencoder tv:// -ovc lavc -oac faac -lavcopts vqscale=2 -o out.avi
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/692#comment:9>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list