How can you extract the header data of an audio file using libav?

28 Views Asked by At

I'm using libav/ ffmpeg to transcode an audio file from one format to another in c++. I have written it in a way so that it works for receiving streamed audio, where first the header of an audio file is sent, followed by chunks of encoded audio.

Now I'd like to generate some test files, where I separate an existing audio file into the header component, followed by chunks of encoded audio data, preferably frame aligned. (I would store this as base64 text for readability with each piece separated by some token, e.g. a newline character)

Is it possible using ffmpeg/ libav to extract the raw data of the header of an audio file? If not, does anyone have any suggestions for how I can find the point in the audio file between the header data and the audio data, so I can then split it at this point?

Note: actually if this is possible using the tool ffmpeg that would also be a viable solution

0

There are 0 best solutions below