[FFmpeg-devel] Implement muxing AAC in a CAFF container

Lewis Fox lrflew.coll at gmail.com
Sun Nov 11 03:11:18 EET 2018

Firstly, I want to say sorry about the repeat messages yesterday. It
was my first time using git-send-email (and a mailing list in
general), and I had some problems. I think I have things figured out

On Sat, Nov 10, 2018 at 6:32 AM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 2018-11-10 4:31 GMT+01:00, Lewis Fox <lrflew.coll at gmail.com>:
> > I originally planned on putting a shared function for writing the elementary
> > stream descriptor in mov_esds.c, along side the function that reads the
> > elementary stream descriptor. However, the implementation in movenc.c used
> > the MOVTrack class, which wouldn't easily be usable by the CAFF encoder.
> Why not?
> > I ended up copying the function into cafenc.c
> If it can be avoided, please do not copy the function.

This is something I had some challenges figuring out while working on
this. From what I can tell, MOVTrack is specific to the MOV encoder,
being defined in movenc.h. I was unsure how working with MOVTrack in
the CAFF encoder would work, so I made a modified copy of the function
that didn't take that type. I can take another look at it, and see if
there's a better solution (perhaps figuring out how to make the
version in movenc.c not take an MOVTrack), but I'll need to get a
better understanding of how that class works first.

> > I also included a small, related change in this commit. Put simply, the CAFF
> > magic cookie doesn't contain the version+flags field that the MPEG ESDS
> > section has, but it was still trying to be read by ff_mov_read_esds. I moved
> > that field to mov_read_esds, which fixes reading the magic cookie when
> > demuxing CAFF files.
> Please split this patch out, are there no unexpected side-effects?

I can split this out. I wasn't sure if this needed to be split, but
I'll do that once I figure out the other issue mentioned.

As for unexpected side-effects, there should't be any. I searched the
source code, and could only see ff_mov_read_esds being called in two
places: mov_read_esds and CAFF's read_kuki_chunk. Since the change
moves the read call to mov_read_esds, the behavior should be the same
for that function. This means that all it changes is reading of the
AAC kuki value in CAFF files.

More information about the ffmpeg-devel mailing list