Opened 7 years ago

Closed 5 months ago

#6575 closed enhancement (fixed)

Bitrate Atom MP4 enhancement

Reported by: Mista_D Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Missing btrt atom in MP4 files:

FFmpeg currently doesn't store average bitrate, max bitrate and buffer size in MP4 MOOV. Would be great to keep this info in MP4 for streaming purposes

ISO-14496 part15 page 20: http://hsevi.ir/RI_Standard/File/8978

Attachments (1)

btrt_moovatom.patch (1.3 KB ) - added by Mista_D 7 years ago.
libavformat/movenc.c patch

Download all attachments as: .zip

Change History (14)

comment:2 by Mista_D, 7 years ago

Bounty of €250 ($300 USD) to whomever implements it before August 14, 2017 please.

Some work was already done before it seems... https://trac.ffmpeg.org/ticket/551

Thank you

comment:3 by oscord, 7 years ago

@line 1077

+static int mov_write_btrt_tag(AVIOContext *pb, MOVTrack *track)
+{
+ AVCPBProperties *props;
+ int64_t pos = avio_tell(pb);
+ unsigned avg_bitrate;
+ props = (AVCPBProperties*)av_stream_get_side_data(track->st, AV_PKT_DATA_CPB_PROPERTIES, NULL);
+ avg_bitrate = compute_avg_bitrate(track);
+
+ avio_wb32(pb, 0);
+ ffio_wfourcc(pb, "btrt");
+ avio_wb32(pb, props ? props->buffer_size : 0);
+ avio_wb32(pb, props ? FFMAX3(props->max_bitrate, props->avg_bitrate, avg_bitrate) : FFMAX(track->par->bit_rate, avg_bitrate));
+ avio_wb32(pb, avg_bitrate);
+ return update_size(pb, pos);
+}

@line 1939

mov_write_avcc_tag(pb, track);

+ mov_write_btrt_tag(pb, track);

if (track->mode == MODE_IPOD)

Use the cash for something good

comment:4 by oscord, 7 years ago

libavformat/movenc.c

comment:5 by Mista_D, 7 years ago

Its adding some junk into MOOV after btrt. Not working

Thank you for trying though

comment:6 by Mista_D, 7 years ago

Resolution: worksforme
Status: newclosed

Apologies, my file analyzer didn't recognize pasp atom. Your patch is working as intended.

comment:7 by Mista_D, 7 years ago

Donated $250 to http://en.pomogi.org to help sick kids

Transaction ID 91Y16613BC393983T

Thank you.

comment:8 by Carl Eugen Hoyos, 7 years ago

Keywords: btrt moov mp4 removed
Priority: importantwish
Resolution: worksforme
Status: closedreopened

Please consider sending the patch - made with git format-patch - to the FFmpeg development mailing list.

by Mista_D, 7 years ago

Attachment: btrt_moovatom.patch added

libavformat/movenc.c patch

comment:9 by Mista_D, 7 years ago

got it, submitting to the mailing list

Last edited 7 years ago by Mista_D (previous) (diff)

comment:10 by Carl Eugen Hoyos, 7 years ago

No.

Please submit a patch made with git format-patch.

comment:11 by Andy Dust, 3 years ago

It'd be great if this could be added. Thanks.

comment:12 by Balling, 3 years ago

It was added though? 3838e8fc210aa09a9f9058506c0ce80b6ad9b9c3

Abd it is being written. I verified it like a 6 months ago.

Version 0, edited 3 years ago by Balling (next)

comment:13 by Balling, 5 months ago

Resolution: fixed
Status: reopenedclosed

Implemented.

Note: See TracTickets for help on using tickets.