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

Christian Ebert blacktrash at gmx.net
Fri Apr 14 19:47:05 EEST 2017

* Mark Burton on Friday, April 14, 2017 at 16:57:06 +0100
> I appreciate this is a tricky area and there appear to be different ways that some encoders create AAC streams with regards to the padding and remaining samples etc. I won’t pretend to fully understand all the factors, but I would like to ask a genuine question which purely comes from the point of view of wanting to create a file for my working environment - an environment dominated by Quicktime 7 and X playback / decoding tools. I’m no great fan of Quicktime and appreciate its not well loved here also. In my industry it is still very much the defecto playback engine though, so if I’m able to tailor a file for this decoder, it would be an enormous help.
> Let me also say, I am not accusing ffmpeg of having an issue, I have read a number of ‘bug’ reports surrounding ffmpeg and AAC priming and there being a sync discrepancy in the resultant encode when played back in certain decoders. I happen to see the exact same issue, but from some of the developers replies, I accept their position is that they feel ffmpeg is doing it the right way and its the decoders that are at fault.
> With that said, I’d like to approach this question purely from the point of view of finding out whether there is a way to tweak a command in order to change this way the aac stream is created to produce an mp4 or mov file using the native aac encoder which decodes in Quicktime 7 or X, in sync. Currently an encoded file plays back 1 frame out of sync (audio is early by approx. 1 frame). In VLC its about 1/2 a frame out of sync.
> The source file is a .mov, DNx115 24p (true 24p, not 23.976), PCM 24bit 48khz audio, which is in sync. This is film material where sync is crucial and always expected.
> 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

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.

  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]
free movies       --->>> https://blacktrash.org/underdogma

More information about the ffmpeg-user mailing list