Opened 11 years ago

Last modified 11 years ago

#2883 new defect

avi+aac - AudioSpecificConfig missing

Reported by: Kees Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: aac
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When muxing an avi (video only) and lc aac with ffmpeg:

1) cbSize is set to zero in the WAVEFORMATEX structure.
2) AudioSpecificConfig is missing.

avi: http://www.datafilehost.com/d/abf5b1ae
aac: http://www.datafilehost.com/d/6ca94fe8

ffmpeg -i h264.avi -i SurroundTest20.aac -c copy SurroundTest20.avi

Since wFormatTag = WAVE_FORMAT_RAW_AAC1, cbSize should be two (and five for SBR?) and AudioSpecificConfig should be filled (with cbSize its size):

http://msdn.microsoft.com/en-us/library/windows/desktop/dd317599%28v=vs.85%29.aspx

Here is the resulting file:
http://www.datafilehost.com/d/a7f35def

At the address 0x1168 the WAVEFORMATEX structure starts. I expect something like

FF 0002 0044 AC00 0094 3E00 0000 0610 0002 0012 10 ...

instead of

FF 0002 0044 AC00 0094 3E00 0000 0610 0000 004A 55 ...

version info:
Zeranoe's FFmpeg Builds Home Page: <http://ffmpeg.zeranoe.com/builds/>
This build was compiled on: Aug 16 2013, at: 20:10:34.

Regards, Wilbert

Change History (4)

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: aac added

Did you test if setting the correct values fixes playback with any application?
The output file you uploaded plays fine here with ffplay, MPlayer and vlc.

comment:2 by Kees, 11 years ago

Fcchandler's AAC ACM codec does some validation on the stream format structure contents. So I can't open the file in Virtualdub and AviSynth with that codec:

http://forum.doom9.org/showthread.php?p=1639389#post1639389

Accordingly to some other participant in that thread it doesn't play in GOM Media Player either (but i didn't know GOM, so i can't comment on that).

in reply to:  2 comment:3 by Carl Eugen Hoyos, 11 years ago

Replying to Wilbert:

Fcchandler's AAC ACM codec does some validation on the stream format structure contents. So I can't open the file in Virtualdub and AviSynth with that codec

Were you able to test if setting cbSize and/or adding AudioSpecificConfig fixes decoding?

comment:4 by Kees, 11 years ago

I don't know how to do that properly. If i just replace 00 004A 55 with 02 0012 10, Virtualdub is able to open the file, play it and i hear the sound. But beforehand i get a warning 'AVI: Truncated or invalid compressed audio format detected (18 bytes, should be 20). Attempting to fix.'.

If i use AVIMux to mux the files (which does write AudioSpecificConfig and sets cbSize=2), it plays fine in Virtualdub.

Last edited 11 years ago by Kees (previous) (diff)
Note: See TracTickets for help on using tickets.