[FFmpeg-user] Audio synchronisation issues

Dainius (GreatEmerald) pastas4 at gmail.com
Fri May 4 18:21:58 CEST 2012


> How can audio and video be in sync (or out of sync) in a video-only
> or an audio-only file?
>
> Complete, uncut console output missing.
>
> Carl Eugen

Well, the way I record is that I need to have the three streams
separate, but have them be synchronised to each other so that I could
mix them into one video file later on. I need to apply some changes to
individual streams (like noise reduction and volume correction), hence
I need separate files for the streams initially.

Right, console output of the first command:

ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on May  3 2012 07:57:34 with gcc 4.6.2
  configuration: --shlibdir=/usr/lib64 --prefix=/usr
--mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared
--disable-static --enable-debug --disable-stripping
--extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -g
-fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab
--enable-version3 --enable-pthreads --enable-avfilter
--enable-libpulse --enable-libvpx --enable-libmp3lame
--enable-libvorbis --enable-libtheora --enable-libspeex
--enable-libxvid --enable-libx264 --enable-libschroedinger
--enable-libdirac --enable-libgsm --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-postproc --enable-libdc1394
--enable-librtmp --enable-libfreetype
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[x11grab @ 0x638840] device: :0.0+2,23 -> display: :0.0 x: 2 y: 23
width: 800 height: 600
[x11grab @ 0x638840] shared memory extension found
[x11grab @ 0x638840] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0+2,23':
  Duration: N/A, start: 1336135787.509094, bitrate: 460800 kb/s
    Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 800x600,
460800 kb/s, 30 tbr, 1000k tbn, 30 tbc
[pulse @ 0x6466e0] Estimating duration from bitrate, this may be inaccurate
Input #1, pulse, from
'alsa_output.pci-0000_03_07.0.analog-stereo.monitor':
  Duration: N/A, start: 0.057567, bitrate: N/A
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[pulse @ 0x64c780] Estimating duration from bitrate, this may be inaccurate
Input #2, pulse, from 'alsa_input.pci-0000_00_14.2.analog-stereo':
  Duration: N/A, start: 0.649226, bitrate: N/A
    Stream #2:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536
kb/s
Incompatible pixel format 'bgra' for codec 'mpeg4', auto-selecting
format 'yuv420p'
[buffer @ 0x652080] w:800 h:600 pixfmt:bgra tb:1/1000000 sar:0/1
sws_param:
[buffersink @ 0x65e100] auto-inserting filter 'auto-inserted scale 0'
between the filter 'src' and the filter 'out'
[scale @ 0x68b180] w:800 h:600 fmt:bgra -> w:800 h:600 fmt:yuv420p flags:0x4
Output #0, mp4, to 'Video.mp4':
  Metadata:
    creation_time   : 2012-05-04T12:49:48+0000
    encoder         : Lavf53.32.100
    Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 800x600,
q=2-31, 200 kb/s, 30 tbn, 30 tbc
Output #1, wav, to 'AudioA.wav':
  Metadata:
    creation_time   : 2012-05-04T12:49:48+0000
    encoder         : Lavf53.32.100
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2
channels, s16, 1536 kb/s
Output #2, wav, to 'AudioB.wav':
  Metadata:
    creation_time   : 2012-05-04T12:49:48+0000
    encoder         : Lavf53.32.100
    Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2
channels, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
  Stream #1:0 -> #1:0 (pcm_s16le -> pcm_s16le)
  Stream #2:0 -> #2:0 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
frame= 5889 fps= 30 q=3.0 Lsize=  105693kB time=00:03:16.18
bitrate=4413.5kbits/s dup=5627 drop=0
video:105666kB audio:73568kB global headers:0kB muxing overhead -41.030764%


And of the second:


ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers
  built on May  3 2012 07:57:34 with gcc 4.6.2
  configuration: --shlibdir=/usr/lib64 --prefix=/usr
--mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared
--disable-static --enable-debug --disable-stripping
--extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables -g
-fPIC -I/usr/include/gsm' --enable-gpl --enable-x11grab
--enable-version3 --enable-pthreads --enable-avfilter
--enable-libpulse --enable-libvpx --enable-libmp3lame
--enable-libvorbis --enable-libtheora --enable-libspeex
--enable-libxvid --enable-libx264 --enable-libschroedinger
--enable-libdirac --enable-libgsm --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-postproc --enable-libdc1394
--enable-librtmp --enable-libfreetype
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2012-05-04 12:49:48
    encoder         : Lavf53.32.100
  Duration: 00:03:16.30, start: 0.000000, bitrate: 4410 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v /
0x7634706D), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 4409 kb/s, 30 fps, 30
tbr, 30 tbn, 30 tbc
    Metadata:
      creation_time   : 2012-05-04 12:49:48
      handler_name    :
[wav @ 0x6405a0] max_analyze_duration 5000000 reached at 5013333
Input #1, wav, from 'AudioA.wav':
  Duration: 00:03:16.18, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2
channels, s16, 1536 kb/s
[wav @ 0x6ef480] max_analyze_duration 5000000 reached at 5013333
Input #2, wav, from 'AudioB.wav':
  Duration: 00:03:16.18, bitrate: 1536 kb/s
    Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2
channels, s16, 1536 kb/s
[buffer @ 0x861720] w:800 h:600 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
[libx264 @ 0x8448e0] using SAR=1/1
[libx264 @ 0x8448e0] using cpu capabilities: MMX2 SSE2Fast FastShuffle
SSEMisalign LZCNT
[libx264 @ 0x8448e0] profile High, level 3.1
[libx264 @ 0x8448e0] 264 - core 122 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2012 - http://www.videolan.org/x264.html - options:
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2
threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
Output #0, mp4, to 'VideoS.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2012-05-04 12:49:48
    encoder         : Lavf53.32.100
    Stream #0:0(und): Video: h264 (![0][0][0] / 0x0021), yuv420p,
800x600 [SAR 1:1 DAR 4:3], q=-1--1, 30 tbn, 30 tbc
    Metadata:
      creation_time   : 2012-05-04 12:49:48
      handler_name    :
Output #1, ogg, to 'AudioAS.ogg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2012-05-04 12:49:48
    encoder         : Lavf53.32.100
    Stream #1:0: Audio: vorbis, 48000 Hz, 2 channels, s16, 128 kb/s
Output #2, ogg, to 'AudioBS.ogg':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 2012-05-04 12:49:48
    encoder         : Lavf53.32.100
    Stream #2:0: Audio: vorbis, 48000 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> libx264)
  Stream #1:0 -> #1:0 [sync #0:0] (pcm_s16le -> libvorbis)
  Stream #2:0 -> #2:0 [sync #0:0] (pcm_s16le -> libvorbis)
Press [q] to stop, [?] for help
frame= 5889 fps=129 q=-1.0 Lsize=    9925kB time=00:03:16.23 bitrate=
414.3kbits/s
video:9855kB audio:90kB global headers:8kB muxing overhead -0.284032%
[libx264 @ 0x8448e0] frame I:39    Avg QP:17.63  size:137960
[libx264 @ 0x8448e0] frame P:1557  Avg QP:24.23  size:  2904
[libx264 @ 0x8448e0] frame B:4293  Avg QP:28.61  size:    44
[libx264 @ 0x8448e0] consecutive B-frames:  2.3%  1.1%  0.9% 95.7%
[libx264 @ 0x8448e0] mb I  I16..4: 24.8% 47.4% 27.7%
[libx264 @ 0x8448e0] mb P  I16..4:  0.3%  0.8%  0.5%  P16..4:  1.9%
0.3%  0.3%  0.0%  0.0%    skip:95.8%
[libx264 @ 0x8448e0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  1.0%
0.0%  0.0%  direct: 0.0%  skip:98.9%  L0:34.3% L1:65.5% BI: 0.2%
[libx264 @ 0x8448e0] 8x8 transform intra:47.3% inter:61.8%
[libx264 @ 0x8448e0] coded y,uvDC,uvAC intra: 74.1% 71.2% 55.3% inter:
0.2% 0.4% 0.2%
[libx264 @ 0x8448e0] i16 v,h,dc,p: 78% 18%  4%  0%
[libx264 @ 0x8448e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 16% 32%  5%
5%  6%  6%  6%  8%
[libx264 @ 0x8448e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 15%  7%
7%  8%  8%  8%  9%
[libx264 @ 0x8448e0] i8c dc,h,v,p: 47% 25% 22%  6%
[libx264 @ 0x8448e0] Weighted P-Frames: Y:0.3% UV:0.3%
[libx264 @ 0x8448e0] ref P L0: 76.7%  6.3% 11.5%  5.5%  0.0%
[libx264 @ 0x8448e0] ref B L0: 72.7% 22.9%  4.4%
[libx264 @ 0x8448e0] ref B L1: 86.1% 13.9%
[libx264 @ 0x8448e0] kb/s:411.26


More information about the ffmpeg-user mailing list