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

FFmpeg trac at avcodec.org
Mon Nov 28 11:42:21 CET 2011


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

Comment (by burek):

 ok, the following examples all have the same issue:

 (internal aac)
 {{{
 root at bla:~# ffmpeg -f video4linux2 -r 25 -s vga -i /dev/video0 -f alsa -ar
 44100 -ac 1 -i front:CARD=U0x46d0x809,DEV=0 -isync -vcodec libx264 -preset
 fast -crf 20 -acodec aac -ab 128k -strict experimental -f mpegts
 udp://burek:10001
 ffmpeg version N-35149-g3880b45, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Nov 25 2011 02:16:49 with gcc 4.6.2
   configuration: --enable-static --enable-shared --enable-gpl --enable-
 nonfree --enable-postproc --enable-libx264 --enable-libaacplus --enable-
 libmp3lame --enable-libv4l2 --enable-libvo-aacenc --enable-version3
   libavutil    51. 28. 0 / 51. 28. 0
   libavcodec   53. 37. 0 / 53. 37. 0
   libavformat  53. 21. 0 / 53. 21. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 49. 0 /  2. 49. 0
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0
 [video4linux2,v4l2 @ 0x1857a20] Estimating duration from bitrate, this may
 be inaccurate
 Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 168.168777, bitrate: 92160 kb/s
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480,
 92160 kb/s, 25 tbr, 1000k tbn, 25 tbc
 [alsa @ 0x1858a00] Estimating duration from bitrate, this may be
 inaccurate
 Input #1, alsa, from 'front:CARD=U0x46d0x809,DEV=0':
   Duration: N/A, start: 1322476404.313276, bitrate: N/A
     Stream #1:0: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
 [buffer @ 0x185a180] w:640 h:480 pixfmt:yuv420p tb:1/1000000 sar:0/1
 sws_param:
 [libx264 @ 0x1852580] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
 [libx264 @ 0x1852580] profile High, level 3.0
 [mpegts @ 0x1852040] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
 every 40 pkts
 Output #0, mpegts, to 'udp://burek:10001':
   Metadata:
     encoder         : Lavf53.21.0
     Stream #0:0: Video: h264, yuv420p, 640x480, q=-1--1, 90k tbn, 25 tbc
     Stream #0:1: Audio: aac, 48000 Hz, 1 channels, s16, 128 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> libx264)
   Stream #1:0 -> #0:1 (pcm_s16le -> aac)
 Press [q] to stop, [?] for help
 frame=  591 fps= 24 q=25.0 Lsize=    2990kB time=00:00:23.18
 bitrate=1056.1kbits/s dup=358 drop=0
 video:2355kB audio:325kB global headers:0kB muxing overhead 11.540911%
 [libx264 @ 0x1852580] frame I:3     Avg QP:17.89  size: 26873
 [libx264 @ 0x1852580] frame P:270   Avg QP:19.24  size:  7880
 [libx264 @ 0x1852580] frame B:318   Avg QP:20.23  size:   640
 [libx264 @ 0x1852580] consecutive B-frames: 26.4%  5.4%  0.5% 67.7%
 [libx264 @ 0x1852580] mb I  I16..4:  9.4% 64.8% 25.8%
 [libx264 @ 0x1852580] mb P  I16..4:  0.2%  1.4%  0.2%  P16..4: 44.6% 23.2%
 13.8%  0.0%  0.0%    skip:16.5%
 [libx264 @ 0x1852580] mb B  I16..4:  1.5%  1.4%  0.0%  B16..8: 11.1%  0.7%
 0.0%  direct: 9.1%  skip:76.2%  L0:54.1% L1:42.7% BI: 3.2%
 [libx264 @ 0x1852580] 8x8 transform intra:59.9% inter:63.5%
 [libx264 @ 0x1852580] coded y,uvDC,uvAC intra: 49.7% 95.9% 71.8% inter:
 17.6% 37.4% 7.5%
 [libx264 @ 0x1852580] i16 v,h,dc,p: 37%  8% 34% 21%
 [libx264 @ 0x1852580] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 11% 37%  5%  5%
 6%  6%  7%  6%
 [libx264 @ 0x1852580] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 19% 13%  6%  7%
 6%  8%  7%  8%
 [libx264 @ 0x1852580] i8c dc,h,v,p: 60% 16% 16%  8%
 [libx264 @ 0x1852580] Weighted P-Frames: Y:0.0% UV:0.0%
 [libx264 @ 0x1852580] ref P L0: 57.3% 42.7%
 [libx264 @ 0x1852580] ref B L0: 95.4%  4.6%
 [libx264 @ 0x1852580] ref B L1: 99.6%  0.4%
 [libx264 @ 0x1852580] kb/s:816.20
 }}}

 (libmp3lame)
 {{{
 root at bla:~# ffmpeg -f video4linux2 -r 25 -s vga -i /dev/video0 -f alsa -ar
 44100 -ac 1 -i front:CARD=U0x46d0x809,DEV=0 -isync -vcodec libx264 -preset
 fast -crf 20 -acodec libmp3lame -ab 128k -f mpegts udp://burek:10001
 ffmpeg version N-35149-g3880b45, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Nov 25 2011 02:16:49 with gcc 4.6.2
   configuration: --enable-static --enable-shared --enable-gpl --enable-
 nonfree --enable-postproc --enable-libx264 --enable-libaacplus --enable-
 libmp3lame --enable-libv4l2 --enable-libvo-aacenc --enable-version3
   libavutil    51. 28. 0 / 51. 28. 0
   libavcodec   53. 37. 0 / 53. 37. 0
   libavformat  53. 21. 0 / 53. 21. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 49. 0 /  2. 49. 0
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0
 [video4linux2,v4l2 @ 0x1335a20] Estimating duration from bitrate, this may
 be inaccurate
 Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 289.069699, bitrate: 92160 kb/s
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480,
 92160 kb/s, 25 tbr, 1000k tbn, 25 tbc
 [alsa @ 0x1336a00] Estimating duration from bitrate, this may be
 inaccurate
 Input #1, alsa, from 'front:CARD=U0x46d0x809,DEV=0':
   Duration: N/A, start: 1322476525.134211, bitrate: N/A
     Stream #1:0: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
 [buffer @ 0x1383880] w:640 h:480 pixfmt:yuv420p tb:1/1000000 sar:0/1
 sws_param:
 [libx264 @ 0x1330040] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
 [libx264 @ 0x1330040] profile High, level 3.0
 [mpegts @ 0x1338040] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
 every 40 pkts
 Output #0, mpegts, to 'udp://burek:10001':
   Metadata:
     encoder         : Lavf53.21.0
     Stream #0:0: Video: h264, yuv420p, 640x480, q=-1--1, 90k tbn, 25 tbc
     Stream #0:1: Audio: mp3, 48000 Hz, 1 channels, s16, 128 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> libx264)
   Stream #1:0 -> #0:1 (pcm_s16le -> libmp3lame)
 Press [q] to stop, [?] for help
 frame=  810 fps= 23 q=-1.0 Lsize=    4818kB time=00:00:32.32
 bitrate=1221.1kbits/s dup=113 drop=0
 video:3855kB audio:505kB global headers:0kB muxing overhead 10.485526%
 [libx264 @ 0x1330040] frame I:4     Avg QP:18.06  size: 19483
 [libx264 @ 0x1330040] frame P:479   Avg QP:19.86  size:  5369
 [libx264 @ 0x1330040] frame B:327   Avg QP:21.23  size:  3970
 [libx264 @ 0x1330040] consecutive B-frames: 19.8% 79.3%  0.0%  1.0%
 [libx264 @ 0x1330040] mb I  I16..4:  8.9% 76.3% 14.7%
 [libx264 @ 0x1330040] mb P  I16..4:  0.1%  0.6%  0.0%  P16..4: 50.8% 18.6%
 10.3%  0.0%  0.0%    skip:19.7%
 [libx264 @ 0x1330040] mb B  I16..4: 14.4% 17.3%  0.0%  B16..8: 13.3%  2.7%
 0.0%  direct:25.9%  skip:26.4%  L0:52.6% L1:38.8% BI: 8.6%
 [libx264 @ 0x1330040] 8x8 transform intra:56.4% inter:76.0%
 [libx264 @ 0x1330040] coded y,uvDC,uvAC intra: 36.8% 98.2% 78.0% inter:
 25.0% 64.6% 11.5%
 [libx264 @ 0x1330040] i16 v,h,dc,p: 42% 15% 30% 13%
 [libx264 @ 0x1330040] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 13% 44%  4%  3%
 4%  4%  4%  4%
 [libx264 @ 0x1330040] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 20% 13%  7%  6%
 5%  7%  6%  6%
 [libx264 @ 0x1330040] i8c dc,h,v,p: 62% 19% 14%  5%
 [libx264 @ 0x1330040] Weighted P-Frames: Y:0.8% UV:0.0%
 [libx264 @ 0x1330040] ref P L0: 61.9% 38.1%
 [libx264 @ 0x1330040] ref B L0: 53.5% 46.5%
 [libx264 @ 0x1330040] ref B L1: 100.0%  0.0%
 [libx264 @ 0x1330040] kb/s:974.78
 }}}

 (internal mp2)
 {{{
 root at bla:~# ffmpeg -f video4linux2 -r 25 -s vga -i /dev/video0 -f alsa -ar
 44100 -ac 1 -i front:CARD=U0x46d0x809,DEV=0 -isync -vcodec libx264 -preset
 fast -crf 20 -f mpegts udp://burek:10001
 ffmpeg version N-35149-g3880b45, Copyright (c) 2000-2011 the FFmpeg
 developers
   built on Nov 25 2011 02:16:49 with gcc 4.6.2
   configuration: --enable-static --enable-shared --enable-gpl --enable-
 nonfree --enable-postproc --enable-libx264 --enable-libaacplus --enable-
 libmp3lame --enable-libv4l2 --enable-libvo-aacenc --enable-version3
   libavutil    51. 28. 0 / 51. 28. 0
   libavcodec   53. 37. 0 / 53. 37. 0
   libavformat  53. 21. 0 / 53. 21. 0
   libavdevice  53.  4. 0 / 53.  4. 0
   libavfilter   2. 49. 0 /  2. 49. 0
   libswscale    2.  1. 0 /  2.  1. 0
   libpostproc  51.  2. 0 / 51.  2. 0
 [video4linux2,v4l2 @ 0xa58a20] Estimating duration from bitrate, this may
 be inaccurate
 Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 409.621608, bitrate: 92160 kb/s
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480,
 92160 kb/s, 25 tbr, 1000k tbn, 25 tbc
 [alsa @ 0xa59a00] Estimating duration from bitrate, this may be inaccurate
 Input #1, alsa, from 'front:CARD=U0x46d0x809,DEV=0':
   Duration: N/A, start: 1322476645.783991, bitrate: N/A
     Stream #1:0: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
 [buffer @ 0xa6be60] w:640 h:480 pixfmt:yuv420p tb:1/1000000 sar:0/1
 sws_param:
 [libx264 @ 0xa53040] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
 [libx264 @ 0xa53040] profile High, level 3.0
 [mpegts @ 0xa5b040] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
 every 40 pkts
 Output #0, mpegts, to 'udp://burek:10001':
   Metadata:
     encoder         : Lavf53.21.0
     Stream #0:0: Video: h264, yuv420p, 640x480, q=-1--1, 90k tbn, 25 tbc
     Stream #0:1: Audio: mp2, 48000 Hz, 1 channels, s16, 128 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> libx264)
   Stream #1:0 -> #0:1 (pcm_s16le -> mp2)
 Press [q] to stop, [?] for help
 frame=  676 fps= 24 q=25.0 Lsize=    3291kB time=00:00:26.68
 bitrate=1010.0kbits/s dup=409 drop=0
 video:2539kB audio:417kB global headers:0kB muxing overhead 11.301029%
 [libx264 @ 0xa53040] frame I:3     Avg QP:17.29  size: 28390
 [libx264 @ 0xa53040] frame P:284   Avg QP:19.11  size:  7924
 [libx264 @ 0xa53040] frame B:389   Avg QP:20.11  size:   680
 [libx264 @ 0xa53040] consecutive B-frames: 22.6%  1.8%  0.4% 75.1%
 [libx264 @ 0xa53040] mb I  I16..4:  8.9% 65.5% 25.6%
 [libx264 @ 0xa53040] mb P  I16..4:  0.1%  1.0%  0.1%  P16..4: 47.5% 24.7%
 15.0%  0.0%  0.0%    skip:11.5%
 [libx264 @ 0xa53040] mb B  I16..4:  1.5%  1.6%  0.0%  B16..8: 11.7%  0.7%
 0.0%  direct: 9.8%  skip:74.7%  L0:55.8% L1:41.3% BI: 2.8%
 [libx264 @ 0xa53040] 8x8 transform intra:58.3% inter:65.5%
 [libx264 @ 0xa53040] coded y,uvDC,uvAC intra: 43.4% 95.6% 69.6% inter:
 16.9% 38.2% 7.4%
 [libx264 @ 0xa53040] i16 v,h,dc,p: 35%  9% 36% 20%
 [libx264 @ 0xa53040] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 11% 44%  5%  4%
 5%  4%  5%  6%
 [libx264 @ 0xa53040] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 14%  6%  6%
 5%  8%  6%  8%
 [libx264 @ 0xa53040] i8c dc,h,v,p: 63% 17% 14%  6%
 [libx264 @ 0xa53040] Weighted P-Frames: Y:0.4% UV:0.0%
 [libx264 @ 0xa53040] ref P L0: 52.2% 47.8%
 [libx264 @ 0xa53040] ref B L0: 95.4%  4.6%
 [libx264 @ 0xa53040] ref B L1: 99.6%  0.4%
 [libx264 @ 0xa53040] kb/s:769.35
 }}}

 (the same problem occurs even without -isync)

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


More information about the FFmpeg-trac mailing list