shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
1.91k stars 497 forks source link

Packager produces a master playlist with no stream variants in HLS #980

Open mariocynicys opened 2 years ago

mariocynicys commented 2 years ago

System info

Operating System: Ubuntu 18.04 Shaka Packager Version: c1f64e5-release

Issue and steps to reproduce the problem

When an (audio+text)-only stream is packaged using shaka packager, shaka packager would not produce a stream variant for the audio content, would not produce a stream variant at all. In contrast, it will produce a video stream variant when packaging a video+any content and an audio stream variant when packaging an audio-only content.

Packager Command:

packager 'in=testvid4.mp4,stream=audio,language=eng,init_segment=output_files/audio_eng_2c_128k_aac_init.mp4,segment_template=output_files/audio_eng_2c_128k_aac_$Number$.mp4' 'in=testvid4.vtt,stream=text,language=eng,init_segment=output_files/text_eng_init.mp4,segment_template=output_files/text_eng_$Number$.mp4' --segment_duration 10 --generate_static_live_mpd --mpd_output output_files/dash.mpd --hls_playlist_type VOD --hls_master_playlist_output output_files/hls.m3u8

What is the expected result? To have an audio stream variant in the master playlist.

What happens instead? Shaka Packager outputs no stream variants in the master playlist.

#EXTM3U
## Generated with https://github.com/google/shaka-packager version c1f64e5-release

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-MEDIA:TYPE=AUDIO,URI="stream_0.m3u8",GROUP-ID="default-audio-group",LANGUAGE="en",NAME="stream_0",AUTOSELECT=YES,CHANNELS="2"

#EXT-X-MEDIA:TYPE=SUBTITLES,URI="stream_1.m3u8",GROUP-ID="default-text-group",LANGUAGE="en",NAME="stream_1",AUTOSELECT=YES

The needed test files are sent by email.

cosmin commented 2 months ago

the shown output seems to show an audio and subtitle variants as expected in the master m3u8?

mariocynicys commented 2 months ago

I think variants are #EXT-X-STREAM-INF streams (used this as a refresher). Playlists created using packager with no videos has none of these.

IIRC, ShakaPlayer wasn't able to play streams with no #EXT-X-STREAM-INF. I wasn't able to determine whether the spec guides that #EXT-X-STREAM-INF is optional or required (thus this should be fixed from the packager or player end).

cosmin commented 2 months ago

Ah yes. This is due to this code https://github.com/shaka-project/shaka-packager/blob/main/packager/hls/base/master_playlist.cc#L514-L515

It currently specifically only handles video + audio/text or audio only (with no text) further down.

Is there an example of what an audio + text only master playlist should look like?

github-actions[bot] commented 1 month ago

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.