Opened 14 months ago

Last modified 9 months 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)

input.ts (1.1 MB) - added by barhom 14 months ago.

Download all attachments as: .zip

Change History (12)

Changed 14 months ago by barhom

comment:1 follow-ups: Changed 14 months ago by 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.

comment:2 Changed 14 months 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.

Last edited 14 months ago by j_karthic (previous) (diff)

comment:3 in reply to: ↑ 1 Changed 14 months 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 14 months ago by barhom

double post, sorry

Last edited 14 months ago by barhom (previous) (diff)

comment:5 Changed 14 months 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 14 months 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.

Version 0, edited 14 months ago by j_karthic (next)

comment:7 Changed 9 months ago by barhom

I am closing this since it does not seem like it is something that needs fixing.

comment:8 Changed 9 months ago by barhom

  • Resolution set to invalid
  • Status changed from new to closed

comment:9 follow-up: Changed 9 months 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 9 months 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 9 months ago by cehoyos

I don't know.

Note: See TracTickets for help on using tickets.