Re: [FFmpeg-devel] [PATCH 1/2 v2] movenc: use similar logic to DASH when writing bit rate to ISML

2016-09-28 Thread Michael Niedermayer
On Wed, Sep 28, 2016 at 05:55:02PM +0200, Carl Eugen Hoyos wrote:
> 2016-09-28 1:14 GMT+02:00 Jan Ekström :
> > This way, in case of bit rate not being set, max_bitrate will be
> > used instead.
> 
> Makes sense to me but I'd prefer if somebody else (looks
> again and) applies.

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2 v2] movenc: use similar logic to DASH when writing bit rate to ISML

2016-09-28 Thread Carl Eugen Hoyos
2016-09-28 1:14 GMT+02:00 Jan Ekström :
> This way, in case of bit rate not being set, max_bitrate will be
> used instead.

Makes sense to me but I'd prefer if somebody else (looks
again and) applies.

Thank you, Carl Eguen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2 v2] movenc: use similar logic to DASH when writing bit rate to ISML

2016-09-27 Thread Jan Ekström
This way, in case of bit rate not being set, max_bitrate will be
used instead. This enables, for example, re-using max_bitrate
information from the input or doing transcoding with a rate
control mode that is not bit rate based.

Signed-off-by: Jan Ekström 
---
 libavformat/movenc.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 449d0b5..8992782 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3581,6 +3581,9 @@ 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;
+AVCPBProperties *props = NULL;
+
 static const uint8_t uuid[] = {
 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
@@ -3615,9 +3618,18 @@ static int mov_write_isml_manifest(AVIOContext *pb, 
MOVMuxContext *mov, AVFormat
 } else {
 continue;
 }
+
+props = (AVCPBProperties*)av_stream_get_side_data(track->st, 
AV_PKT_DATA_CPB_PROPERTIES, NULL);
+
+if (track->par->bit_rate) {
+manifest_bit_rate = track->par->bit_rate;
+} else if (props) {
+manifest_bit_rate = props->max_bitrate;
+}
+
 avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
-(int64_t)track->par->bit_rate);
-param_write_int(pb, "systemBitrate", track->par->bit_rate);
+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) {
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel