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.98k stars 507 forks source link

[HLS] Support audio only master playlist #461

Closed kevinolinger closed 5 years ago

kevinolinger commented 6 years ago

System info

Operating System: Ubuntu 14.04.5 (docker) Shaka Packager Version: e071710-release

Issue and steps to reproduce the problem

I'm segmenting an audio file 1059.zip (mp4/aac, stream info below) and creating a HLS playlist. The resulting playlist fails to play in shaka player (v2.4.2, in Chrome 68.0.3440.75 on Windows) with error 4032 even though the codec is supported. I think the problem is that the master playlist doesn't contain an EXT-X-STREAM-INF tag, but I'm unsure how to get shaka packager to add it.

#EXTM3U
## Generated with https://github.com/google/shaka-packager version v2.2.0-9e9833ea63-release

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

Packager Command:

packager 'in=/audio/1059,m4a,stream=audio,init_segment=init.mp4,segment_template=seg_$Number$.m4s,playlist_name=test.m3u8' --hls_master_playlist_output master.m3u8

Extra steps to reproduce the problem? (1) Stream info:

Found 1 stream(s).
Stream [0] type: Audio
 codec_string: mp4a.40.2
 time_scale: 48000
 duration: 3968462 (82.7 seconds)
 is_encrypted: false
 codec: AAC
 sample_bits: 16
 num_channels: 2
 sampling_frequency: 48000
 language: 

(2) https://shaka-player-demo.appspot.com/support.html

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36
v2.4.4

{
  "manifest": {
    "application/dash+xml": true,
    "application/x-mpegurl": true,
    "application/vnd.apple.mpegurl": true,
    "application/x-offline-manifest": true,
    "mpd": true,
    "m3u8": true,
    "application/vnd.ms-sstr+xml": false,
    "ism": false
  },
  "media": {
    "video/mp4; codecs=\"avc1.42E01E\"": true,
    "video/mp4": true,
    "video/mp4; codecs=\"avc3.42E01E\"": true,
    "video/mp4; codecs=\"hev1.1.6.L93.90\"": false,
    "video/mp4; codecs=\"hvc1.1.6.L93.90\"": false,
    "video/mp4; codecs=\"hev1.2.4.L153.B0\"; eotf=\"smpte2084\"": false,
    "video/mp4; codecs=\"hvc1.2.4.L153.B0\"; eotf=\"smpte2084\"": false,
    "video/mp4; codecs=\"vp9\"": false,
    "video/mp4; codecs=\"vp09.00.10.08\"": true,
    "audio/mp4; codecs=\"mp4a.40.2\"": true,
    "audio/mp4": true,
    "audio/mp4; codecs=\"ac-3\"": false,
    "audio/mp4; codecs=\"ec-3\"": false,
    "audio/mp4; codecs=\"opus\"": false,
    "audio/mp4; codecs=\"flac\"": true,
    "video/webm; codecs=\"vp8\"": true,
    "video/webm": true,
    "video/webm; codecs=\"vp9\"": true,
    "video/webm; codecs=\"vp09.00.10.08\"": true,
    "audio/webm; codecs=\"vorbis\"": true,
    "audio/webm": true,
    "audio/webm; codecs=\"opus\"": true,
    "video/mp2t; codecs=\"avc1.42E01E\"": false,
    "video/mp2t": false,
    "video/mp2t; codecs=\"avc3.42E01E\"": false,
    "video/mp2t; codecs=\"hvc1.1.6.L93.90\"": false,
    "video/mp2t; codecs=\"mp4a.40.2\"": false,
    "video/mp2t; codecs=\"ac-3\"": false,
    "video/mp2t; codecs=\"ec-3\"": false,
    "text/vtt": true,
    "application/mp4; codecs=\"wvtt\"": true,
    "application/mp4": true,
    "application/ttml+xml": true,
    "application/mp4; codecs=\"stpp\"": true
  },
  "drm": {
    "org.w3.clearkey": {
      "persistentState": false
    },
    "com.widevine.alpha": {
      "persistentState": true
    },
    "com.microsoft.playready": null,
    "com.apple.fps.2_0": null,
    "com.apple.fps.1_0": null,
    "com.apple.fps": null,
    "com.adobe.primetime": null
  },
  "offline": true
}

What is the expected result? The playlist will playback in shaka player. What happens instead? Error 4032 is returned.

<Please attach the input files or email to shaka-packager-issues@google.com.>

kqyang commented 6 years ago

We do not support audio only master playlist right now. You may also try using the generated media playlists directly, which should work on most HLS clients/players, including Safari.

It should be pretty easy to add support for audio only master playlist. Add it to v2.3 milestone.

We also welcome external contributions. Let me know if you'd like to help. I can point you to the part of the code that needs to be updated.

kevinolinger commented 6 years ago

Thanks for the prompt response. Unfortunately, shaka player doesnt' support playback without a master playlist (see HLS_MASTER_PLAYLIST_NOT_PROVIDED )

kqyang commented 6 years ago

Keep it open to track the support for audio only master playlist.