[FFmpeg-devel] [PATCH 1/2] Add experimental muxing support for FLAC in ISO BMFF (MP4).

Matthew Gregan kinetik at flim.org
Tue Nov 1 03:11:01 EET 2016


At 2016-10-31T11:04:16-0300, James Almer wrote:
> > +static int mov_write_dfla_tag(AVIOContext *pb, MOVTrack *track)
> > +{
> > +    const size_t FLAC_STREAMINFO_SIZE = 34;
> > +    int64_t pos = avio_tell(pb);
> > +    avio_wb32(pb, 0);
> > +    ffio_wfourcc(pb, "dfLa");
> > +    avio_w8(pb, 0); /* version */
> > +    avio_wb24(pb, 0); /* flags */
> > +
> > +    /* Expect the encoder to pass a METADATA_BLOCK_TYPE_STREAMINFO. */
> 
> The encoder may (or most likely will) also pass an updated streaminfo as
> packet side data.  See the flac muxer, you'll have to do the same here.

Thanks.  It looks like libavcodec/flacenc.c#flac_encode_frame updates the
extradata at the same time it emits the packet side data, so I'm slightly
confused why this is needed.

Seems to be easy to handle by extending the existing case for
AV_CODEC_ID_MP4ALS in mov_write_single_packet.  That assumes pkt->size == 0,
which seems to be true when the packet side data is emitted in
flac_encode_frame.

Updated patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-experimental-muxing-support-for-FLAC-in-ISO-BMFF.patch
Type: text/x-diff
Size: 6312 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161101/6a500b76/attachment.patch>


More information about the ffmpeg-devel mailing list