Opened 2 years ago
Last modified 2 years ago
#7403 reopened defect
HLS Master Playlist fails being generated correctly
Reported by: | barhom | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | avformat |
Version: | git-master | Keywords: | hls |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
ffmpeg -i input.ts -c copy -f hls -master_pl_name master.m3u8 -var_stream_map "v:0,a:0" "vs_%v/playlist.m3u8"
input.ts is attached.
This has been tested on ffmpeg compiled on 2018-09-05.
What is wrong:
FFmpeg fails to read the bitrate of the input.ts and thus fails to write the master.m3u8
The code below is what controls this error.
if (!bandwidth) { av_log(NULL, AV_LOG_WARNING, "Bandwidth info not available, set audio and video bitrates\n"); return; }
My thoughts is that the proper way would not to return if bandwidth is not available but simply write the playlist without the bandwidth information since it was not available.
Attachments (1)
Change History (12)
Changed 2 years ago by barhom
comment:1 follow-ups: ↓ 3 ↓ 4 Changed 2 years ago by j_karthic
comment:2 Changed 2 years ago by j_karthic
A possible method of handling such cases is to manually pass the video bitrate and audio bitrate in the command line.
For example
ffmpeg -i input.ts -c copy -b:v 1000k -b:a 128k -f hls -master_pl_name master.m3u8 -var_stream_map "v:0,a:0" "vs_%v/playlist.m3u8"
The above command will create the master playlist.
comment:3 in reply to: ↑ 1 Changed 2 years ago by barhom
Replying to j_karthic:
As per the HLS specification, bandwidth attribute is mandatory. So it would be in violation of the spec to create a master playlist without bandwidth information.
If so, should we not even copy the input to the output vs_0/playlist.m3u8?
Otherwise we are creating a working playlist.m3u8 but a non-working master.m3u8.
MPEG2 video inside HLS containers are also invalid according to the spec but they are still allowed.
comment:4 in reply to: ↑ 1 Changed 2 years ago by barhom
double post, sorry
comment:5 Changed 2 years ago by cehoyos
- Keywords hls added; hlsplaylist.c removed
- Priority changed from normal to minor
- Reproduced by developer set
- Version changed from unspecified to git-master
comment:6 Changed 2 years ago by j_karthic
HLS clients can still playout the playlist.m3u8 directly, even without a master playlist.
Master playlist is primarily meant for choosing content between different playlists based on bandwidth. Hence bandwidth has been made mandatory attribute by the spec.
As far as I understand HLS spec doesn't impose any restriction on codec type.
comment:7 Changed 2 years ago by barhom
I am closing this since it does not seem like it is something that needs fixing.
comment:8 Changed 2 years ago by barhom
- Resolution set to invalid
- Status changed from new to closed
comment:9 follow-up: ↓ 10 Changed 2 years ago by cehoyos
- Resolution invalid deleted
- Status changed from closed to reopened
There is definitely a bug, I don't know if it is the level of the console log or something else.
comment:10 in reply to: ↑ 9 Changed 2 years ago by barhom
Replying to cehoyos:
There is definitely a bug, I don't know if it is the level of the console log or something else.
You mean the bug is that it cant read the bitrate? Or that it should continue generating the master playlist without the bitrate?
comment:11 Changed 2 years ago by cehoyos
I don't know.
As per the HLS specification, bandwidth attribute is mandatory. So it would be in violation of the spec to create a master playlist without bandwidth information.