[Libav-user] Wrong duration of AAC files encoded by iTunes 12.3.0

Uwe Klotz uwe_klotz at web.de
Mon Oct 2 15:42:57 EEST 2017

I've encountered inconsistencies when decoding AAC files encoded by iTunes.

An AAC file encoded by iTunes 12.3.0 reports the following stream properties:
start_time = 2112
duration = 1328128

The same file encoded by iTunes 12.7.0 reports the following stream properties:
start_time = 0
duration = 1328128

The actual duration of the first file must be reduced to 1328128 - 2112 = 
1326016 for decoding, because the last frame received from FFmpeg ends at 

Is this inconsistency caused by iTunes or by FFmpeg? As a workaround I need 
to reduce the duration of all AAC files by their start_time (if start_time > 
0) to avoid running into issues when decoding affected files.

FFmpeg version: ffmpeg-3.3.4-1.fc26.x86_64 (Fedora 26 + RPM Fusion repos)

Kind regards,


More information about the Libav-user mailing list