[libav-bugs] [Bug 465] New: MP4 AAC Audio is delayed by 2ms when converted to PCM

bugzilla-daemon at aruru.libav.org bugzilla-daemon at aruru.libav.org
Tue Mar 5 16:20:38 CET 2013


https://bugzilla.libav.org/show_bug.cgi?id=465

           Summary: MP4 AAC Audio is delayed by 2ms when converted to PCM
           Product: Libav
           Version: git HEAD
          Platform: All
        OS/Version: Mac OS
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: libavcodec
        AssignedTo: bugzilla at libav.org
        ReportedBy: brennan.chapman at gmail.com


Created attachment 384
  --> https://bugzilla.libav.org/attachment.cgi?id=384
MP4 which causes 2ms delay

I'm trying to extract the audio from an mp4 to a pcm wav file.

When using avconv to convert an aac audio stream from an mp4 to pcm, the result
is out of sync by about 2ms.

The only solution I've been able to find so far is to add -ss 00:00:00.02 after
the input, then the output is correctly aligned.

avconv -v 9 -loglevel 99 -i test100.mp4 -c:a pcm_s16le test100_audio.wav        
avconv version v9-622-g15ea1ac, Copyright (c) 2000-2013 the Libav developers
  built on Mar  4 2013 16:46:59 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/usr/local --enable-static
  libavutil     52.  7. 0 / 52.  7. 0
  libavcodec    54. 41. 1 / 54. 41. 1
  libavformat   54. 21. 3 / 54. 21. 3
  libavdevice   53.  2. 0 / 53.  2. 0
  libavfilter    3.  4. 0 /  3.  4. 0
  libavresample  1.  1. 0 /  1.  1. 0
  libswscale     2.  1. 1 /  2.  1. 1
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with
argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging
level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'test100.mp4'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument
'pcm_s16le'.
Reading option 'test100_audio.wav' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file test100.mp4.
Successfully parsed a group of options.
Opening an input file: test100.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd4e8813a00] Probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd4e8813a00] ISO: File Type Major Brand: mp42
[h264 @ 0x7fd4e882ca00] no picture
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd4e8813a00] All info found
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test100.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2013-03-04 21:40:01
  Duration: 00:00:12.54, start: 0.000000, bitrate: 282 kb/s
    Stream #0.0(eng), 10, 1/24000: Video: h264 (Main), yuv420p, 1280x720 [PAR
1:1 DAR 16:9], 1/48, 85 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc
    Metadata:
      creation_time   : 2013-03-04 21:40:01
    Stream #0.1(eng), 1, 1/48000: Audio: aac, 48000 Hz, stereo, fltp, 189 kb/s
    Metadata:
      creation_time   : 2013-03-04 21:40:01
Successfully openened the file.
Parsing a group of options: output file test100_audio.wav.
Applying option c:a (codec name) with argument pcm_s16le.
Successfully parsed a group of options.
Opening an output file: test100_audio.wav.
File 'test100_audio.wav' already exists. Overwrite ? [y/N] y
Successfully openened the file.
[abuffer source @ 0x7fd4e8405280] Setting value '1/48000' for key 'time_base'
[abuffer source @ 0x7fd4e8405280] Setting value '48000' for key 'sample_rate'
[abuffer source @ 0x7fd4e8405280] Setting value 'fltp' for key 'sample_fmt'
[abuffer source @ 0x7fd4e8405280] Setting value '0x3' for key 'channel_layout'
[abuffer @ 0x7fd4e8405320] tb:1/48000 samplefmt:fltp samplerate: 48000 ch
layout:0x3
[aformat filter @ 0x7fd4e84056a0] Setting value 's16' for key 'sample_fmts'
[abuffersink @ 0x7fd4e8405460] auto-inserting filter 'auto-inserted fifo 0'
between the filter 'audio format for output stream 0:0' and the filter 'output
stream 0:0'
[aformat @ 0x7fd4e8405760] auto-inserting filter 'auto-inserted resampler 0'
between the filter 'Parsed filter 0 anull' and the filter 'audio format for
output stream 0:0'
[AVAudioResampleContext @ 0x7fd4e8407ae0] audio_convert: found function: fltp
to s16  (C)
[AVAudioResampleContext @ 0x7fd4e8407ae0] audio_convert: found function: fltp
to s16  (SSE2)
[AVAudioResampleContext @ 0x7fd4e8407ae0] audio_convert: found function: fltp
to s16  (SSSE3)
[resample @ 0x7fd4e84077e0] fmt:fltp srate:48000 cl:stereo -> fmt:s16
srate:48000 cl:stereo
Output #0, wav, to 'test100_audio.wav':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2013-03-04 21:40:01
    ISFT            : Lavf54.21.3
    Stream #0.0(eng), 0, 1/48000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536
kb/s
    Metadata:
      creation_time   : 2013-03-04 21:40:01
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> pcm_s16le)
Press ctrl-c to stop encoding
No more output streams to write to, finishing.
size=    2344kB time=12.50 bitrate=1536.0kbits/s    
video:0kB audio:2344kB global headers:0kB muxing overhead 0.003250%

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list