samgardner / ffmbc

Automatically exported from code.google.com/p/ffmbc
0 stars 0 forks source link

FFmbc 0.7 rc7 Audio sync #105

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Got an 25fps mp4 pulled from the BPAV folder of a camera recording.

If I transcode it to wav the output file is 40ms shorter than the input file.

Note the input is 6.84 and the output is 6.80

I will send you a link on IRC to the original file.
(encoding with FFmpeg git head outputs the full length of clip)

Comparing the output of FFmpeg and FFmbc in Audacity, it looks like FFmbc is 
missing the audio from the first video frame and all the audio is shifted 
towards the start of the output file by 40ms.

ffmbc -loglevel debug -i clapper\ test\ footage\ KEEP/BPAV/CLPR/BM_\ 
0344_01/BM_\ 0344_01.MP4 -vn -acodec pcm_s16le -ac 4 -map_audio_channel 
0:1:0:0:0:0 -map_audio_channel 0:2:0:0:0:1 -map_audio_channel 0:3:0:0:0:2 
-map_audio_channel 0:4:0:0:0:3 -y out.wav
FFmbc version 0.7-rc7-static
Copyright (c) 2008-2012 Baptiste Coudurier and the FFmpeg developers
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] Format mov,mp4,m4a,3gp,3g2,mj2 probed 
with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] 0: start_time: 1000 duration: 171000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] 1: start_time: 0 duration: 328320
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] 2: start_time: 0 duration: 328320
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] 3: start_time: 0 duration: 328320
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xa78bb00] 4: start_time: 0 duration: 328320
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'clapper test footage 
KEEP/BPAV/CLPR/BM_ 0344_01/BM_ 0344_01.MP4':
  Metadata:
    major_brand: mp42
    minor_version: 0
    compatible_brands: mp42
    creation_time: 2012-05-28 09:53:43
  Duration: 00:00:06.84, start: 0.000000, bitrate: 38113 kb/s
    Stream #0.0(eng), 2, 1/25000: Video: mpeg2video (Main), yuv420p, 1920x1080i tff [PAR 1:1 DAR 16:9], tbc 2/50, 35000 kb/s, tbr 25/1, tba 25/1, 25.00 fps
    Stream #0.1(eng), 12, 1/48000: Audio: pcm_s16be, 48000 Hz, 1 channels, s16, 768 kb/s
    Stream #0.2(eng), 12, 1/48000: Audio: pcm_s16be, 48000 Hz, 1 channels, s16, 768 kb/s
    Stream #0.3(eng), 12, 1/48000: Audio: pcm_s16be, 48000 Hz, 1 channels, s16, 768 kb/s
    Stream #0.4(eng), 12, 1/48000: Audio: pcm_s16be, 48000 Hz, 1 channels, s16, 768 kb/s
Output #0, wav, to 'out.wav':
  Metadata:
    encoder: FFmbc 0.7
    Stream #0.0(und), 0, 1/48000: Audio: pcm_s16le, 48000 Hz, 4 channels, s16, 3072 kb/s
Stream mapping:
  Stream #0.1 -> #0.0 [channel: 0 -> 0]
  Stream #0.2 -> #0.0 [channel: 0 -> 1]
  Stream #0.3 -> #0.0 [channel: 0 -> 2]
  Stream #0.4 -> #0.0 [channel: 0 -> 3]
Press [q] to stop, [?] for help
discarding 1920 audio samples in stream #0.1
discarding 1920 audio samples in stream #0.2
discarding 1920 audio samples in stream #0.3
discarding 1920 audio samples in stream #0.4
size=    2550kB time=00:00:06.80 bitrate=3072.1kbits/s
video:0kB audio:2550kB global headers:0kB muxing overhead 0.001685%

ffmbc -loglevel debug -i out.wav                                                
       FFmbc version 0.7-rc7-static
Copyright (c) 2008-2012 Baptiste Coudurier and the FFmpeg developers
[wav @ 0xa28fb00] Format wav probed with size=2048 and score=99
[wav @ 0xa28fb00] All info found
[wav @ 0xa28fb00] 0: start_time: 0 duration: 326400
Input #0, wav, from 'out.wav':
  Duration: 00:00:06.80, start: 0.000000, bitrate: 3072 kb/s
    Stream #0.0(und), 1, 1/48000: Audio: pcm_s16le, 48000 Hz, 4 channels, s16, 3072 kb/s
At least one output file must be specified

Original issue reported on code.google.com by mark.him...@gmail.com on 21 Jun 2012 at 12:35

GoogleCodeExporter commented 9 years ago
These mp4 doesn't set the edit list correctly and therefore the timing 
information is wrong, and the first audio frame is discarded.
Use .mov :)
Can you tell me what created this file ?

Original comment by baptiste...@gmail.com on 22 Jun 2012 at 12:12

GoogleCodeExporter commented 9 years ago
Sony PMW-500 camera.

Original comment by mark.him...@gmail.com on 22 Jun 2012 at 6:39