[FFmpeg-user] Create an AAC stream matching the Core Media Audio packet format / priming etc?

Christian Ebert blacktrash at gmx.net
Sat Apr 15 00:22:19 EEST 2017


* Mark Burton on Friday, April 14, 2017 at 21:45:07 +0100
>> * Mark Burton on Friday, April 14, 2017 at 16:57:06 +0100
>>> Here is the basic command to reproduce. I have attached the uncut loglevel 99 console output for this command:
>>> ffmpeg -i SyncTest24p.mov -c:v libx264 -pix_fmt yuv420p -movflags faststart -c:a aac -b:a 128k ffmpeg.mp4
>> 
>> Can you try:
>> 
>> -filter:a aresample=first_pts=0
> 
> Thanks for your reply and these options to test. This first one does not appear to change the outcome. ffprobe for ffmpeg_v2 attached.
> 
>> Also, when you run with -v verbose, you'll see a delay (depends
>> on audio codec), for you case it's probably 1024. Maybe try:
>> 
>> -filter:a aresample=first_pts=0,asetpts=PTS-STARTPTS+1024
>> 
>> Especially the latter could be exactly the wrong thing for your
>> purpose, but it doesn't hurt trying.
> 
> 1024 looks correct. This method successfully changes the start, and the encoded audio plays, almost, 100% in sync. Its slightly cut off at the head, but only very slightly. However the downside of this method is that the audio now overruns the end of the picture further and is not trimmed from remaining samples I’m guessing. This results in a blank video frame being added to the tail of clip. ffprobe for ffmpeg_v3 attached
> .
> 
> I tried using -shortest, but that didn’t help address the above issue.

Inserting

-t `ffprobe -v quiet -of default=nw=1:nk=1 -select_streams V -show_entries stream=duration SyncTest24p.mov`

into your commandline should do the trick.

imho this is a muxing bug in dealing with aac priming in many
situations, but making my case fell on deaf ears.

-- 
\black\trash movie         _SAME  TIME  SAME  PLACE_
 --->> https://blacktrash.org/underdogma/stsp.php
\black\trash audio   _ANOTHER  TIME  ANOTHER  PLACE_
--->> https://blacktrash.org/underdogma/atap.html


More information about the ffmpeg-user mailing list