@@ -607,6 +607,17 @@ static int dash_init(AVFormatContext *s)
char filename[1024];
os->bit_rate = s->streams[i]->codecpar->bit_rate;
+ // if no bit rate detected, try whether bitrates are provided via metadata
+ if(!os->bit_rate) {
+ AVDictionaryEntry *bitrate;
+ bitrate = av_dict_get(s->streams[i]->metadata, "bitrate", NULL, 0);
+ if(bitrate) {
+ char *tail;
+ os->bit_rate = av_strtod(bitrate->value, &tail);
+ if (*tail)
+ os->bit_rate = 0;
+ }
+ }
if (os->bit_rate) {
snprintf(os->bandwidth_str, sizeof(os->bandwidth_str),
" bandwidth=\"%d\"", os->bit_rate);
Bandwidth information is required in the manifest, but not always provided by the demuxer. So enable hinting the stream bandwidth via a metadata field, supports same values as codec bitrate setting. Example: -metadata:s:v:0 bitrate=3500k Signed-off-by: Peter Große <pegro@friiks.de> --- libavformat/dashenc.c | 11 +++++++++++ 1 file changed, 11 insertions(+)