Skip to content
Permalink
Browse files

movenc: use similar logic to DASH when writing bit rate to ISML

This way, in case of bit rate not being set, max_rate will be used
instead. This enables, for example, remuxing of MPEG-TS to ISMV+ISML
without losing general bit rate information.
  • Loading branch information
jeeb committed Sep 4, 2016
1 parent 8b4e4bc commit 298d88f6c24383eb66a05505f7c80cae1f5378cd
Showing with 8 additions and 2 deletions.
  1. +8 −2 libavformat/movenc.c
@@ -3581,6 +3581,8 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
{
int64_t pos = avio_tell(pb);
int i;
int64_t manifest_bit_rate = 0;

static const uint8_t uuid[] = {
0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
@@ -3615,9 +3617,13 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
} else {
continue;
}

AVCPBProperties *props = (AVCPBProperties*)av_stream_get_side_data(track->st, AV_PKT_DATA_CPB_PROPERTIES, NULL);

manifest_bit_rate = track->par->bit_rate ? track->par->bit_rate : props ? props->max_bitrate : 0;
avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
(int64_t)track->par->bit_rate);
param_write_int(pb, "systemBitrate", track->par->bit_rate);
(int64_t)manifest_bit_rate);
param_write_int(pb, "systemBitrate", manifest_bit_rate);
param_write_int(pb, "trackID", track_id);
if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
if (track->par->codec_id == AV_CODEC_ID_H264) {

0 comments on commit 298d88f

Please sign in to comment.