I want to modify channel configuration of an ALAC audio stream inside MP4-container without multiplexing the container.
So I need to change letter H of Audio Data Transport Stream with a hex editor for all audio frames. https://wiki.multimedia.cx/index.php/ADTS#Header
I installed AAC Audio ED Viewer to know where I should look at in my hex editor. Because the viewer can only handle AAC streams and I thought ALAC should look similar:
But when I open my AAC reference stream inside the MP4-container I even cannot find the audio frames in the hex editor I see in the viewer:
I can find many syncwords (0xFFF) inside media data container (mdat). But they don't match those I can see in the viewer.
Attachments:
Can someone tell me what I'm doing wrong here?
Best Felix


You have two separate audio tracks (English and German) so you have to edit both
trakentries.In your hex editor, repeat for both
sounatoms...1) Search for start position of text
soun.2) Skip ahead by 101 bytes, should land on start of
stsd(for a/v samples descriptions or config).3) From start position of text
stsdskip ahead 69 bytes...4) The next (or 70th) byte should be an
08and is your 8 channels for the audio channel config.5) Change that number (is one byte only) and then check in a mediaplayer or MediaInfoOnline.
The structure of an STSD atom with ALAC audio config is as follows:
(via studying FFmpeg source code)
From STSD atom name's position skip ahead 48 bytes to reach the fun parts:
(eg: testing from offset 14985 in your example file)