Can .m3u8 playlist files reference OTHER .m3u8 playlist files? - http-live-streaming

I know that the EXT-X-STREAM-INF tag provides a mechanism for linking to another playlist file, but this appears to be to support variant encoding's (at lower or higher bandwidth) of the same stream. What I would like to do is return a playlist that references actual .ts files but the last reference in the playlist is to the "next" .m3u8.
The reason I want this is that I can use this mechanism to build a stateless HLS server that is not necessarily serving a "live" stream (because the playlist URL can encode information about WHERE in the stream you are). Any idea what players support this (does iOS?)?

It is not supported in the draft specification (as of draft 10).

Yes They can. The main m3u8 that holds other m3u8 is called variant playlist m3u8.
But why we need a variant playlist? - for storing various bit rates of the same stream
I used "One Click m3u8" app from the mac app store - that created the variant playlist as well the children m3u8. No need of ffmpeg or mediafilesegmenter.
How to video here from youtube
Website

Related

Rearranging the order of ts files in m3u8 causes them to get stuck during playback

I have one m3u8 file and several TS files.
The following is the actual output of the m3u8 file.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:5
#EXTINF:4.027222,
test0000.ts
#EXTINF:4.004000,
test0001.ts
#EXTINF:4.004000,
test0002.ts
#EXTINF:4.004000,
test0003.ts
#EXT-X-ENDLIST
I rewrote this m3u8 in the following format, saved it, and played it.
Then the playback order of the video was exactly as I changed the m3u8.
However, the video playback does not work as expected and gets stuck.
#extm3u.
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:5
#EXTINF:4.027222,
test0003.ts
#EXTINF:4.004000,
test0002.ts
#EXTINF:4.004000,
test0001.ts
#EXTINF:4.004000,
test0000.ts
#EXT-X-ENDLIST
If I want to change the order of the TS files like this, how do I edit the m3u8 file?
Or can I use the ffmpeg command to change the order of the ts files and then recreate the m3u8 file?
I'm afraid you're not allowed to manually edit the playlist (or re-generate it using ffmpeg command). Due to the restriction of HLS protocol (RFC8216) , media segments (the .ts files in your case) in the middle must NOT be removed when you set either value event or vod to -hls_playlist_type option in your ffmpeg command , even without -hls_playlist_type, it is still limited to change the playlist (and NOT including freely removing any media segment).
Quote from General Server Responsibilities in RFC8216
The server MUST NOT change the Media Playlist file, except to:
Append lines to it (Section 6.2.1).
Remove Media Segment URIs from the Playlist in the order that they
appear, along with any tags that apply only to those segments
(Section 6.2.2).
Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X-
DISCONTINUITY-SEQUENCE tags (Section 6.2.2).
Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1).
A Media Playlist has further constraints on its updates if it
contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with
a value of VOD indicates that the Playlist file MUST NOT change. An
EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the
server MUST NOT change or delete any part of the Playlist file; it
MAY append lines to it.
Note that the EXT-X-PLAYLIST-TYPE in your playlist related to -hls_playlist_type in ffmpeg

For an HLS VOD Stream, Is it possible to only play specific Media Sequences in a Media Playlist File?

I'd like to play specific time-segments from an HLS Stream, without needing to re-edit the original MP4 file. Is it possible to alter the Media Playlist File to play specific TS Media Sequences that are out of order?
For instance, in the below M3U list, is it possible to only play fileSequence0-fileSequence2, then skip over fileSequence3 and go right to fileSequence4?
Example M3U List:
#EXTM3U
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
fileSequence0.ts
#EXTINF:10.0,
fileSequence1.ts
#EXTINF:10.0,
fileSequence2.ts
#EXTINF:10.0,
fileSequence3.ts
#EXTINF:10.0,
fileSequence4.ts
According to HLS Documentation, I would need to change or omit the Media Sequence Number for fileSequence3.ts in order to skip it, but I'm unsure if this is possible.
6.3.5. Determining the Next Segment to Load
...
The first segment to load is generally the segment that the client has chosen to play first (see Section 6.3.3).
In order to play the presentation normally, the next Media Segment to load is the one with the lowest Media Sequence Number that is greater than the Media Sequence Number of the last Media Segment loaded.
Yes, you can play them in any order, Just put a #EXT-X-DISCONTINUITY tag before any 'splice'. You also need #EXT-X-ENDLIST at the end, or the player will assume this is a live manifest and only play the most recent segments.
If the segments do not begin with keyframes however, you may not get the result you want.

how to play mpd file

.
I am trying to understand how mpd file plays and i am referring to the following data set:
http://www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/Valkaama/MPDs/Valkaama_1s_act_isoffmain_DIS_23009_1_v_2_1c2_2011_08_30.mpd
In mpd file format there is segment base consists of mp4 chunk and within it has chunk list with extension .m4s.I downloaded mpd file using :
http://www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/Valkaama/valkaama_1s/valkaama_1s_50kbit/valkaama_50kbit_dash.mp4
and m4s chunk by following link:
http://www-itec.uni-klu.ac.at/ftp/datasets/mmsys12/Valkaama/valkaama_1s/valkaama_1s_50kbit/valkaama_1s1.m4s
I tried to play both mp4 and m4s in vlc player but not able to play any of these two so i want to ask which of the chunk links in the mpd file forma i can be able to play standalone in vlc player.
Please correct me if any of my observations is wrong:
Regards
Mayank
MPD file is just a index of streams with various formats in order to adapt to your bandwidth, to get more information follow the links of the other answers here.
It's possible to download all streams and merge them into a single file, you could achieve this by using youtube-dl:
youtube-dl http://URL/TO/manifest.mpd
You can get more information in https://stackoverflow.com/a/39931712/1522342.
Also, VLC 3.0.0+ can play that kind of file from a url, just open VLC, use the shortcut CTRL+N, paste the url and enjoy.
A DASH player plays an MPD by selecting a Period, and in the Period one or more AdaptationSet, and then one Representation per AdaptationSet. For the chosen Representation, it downloads and passes the intialization segment and some media segments to the media engine. As indicated by others you can simulate that by concatenating (simply using caton Linux).
The MPEG-DASH standard requires that initialization segments (in your case the mp4 file) contain no data. This is because when switching the player might use several times the initialization segment. You can open it in a player but it does not contain any media.
For m4s files, they contain media data but they cannot be interpreted without the associated initialization segment.
you can download init segment (SegmentBase/Initialization#sourceURL) and all media segments (SegmentList/SegmentURL#media) and concatenate everything (e.g. with the copy command on windows). The result should be playable on VLC. This has to be done for audio and video separately. In the next step you can then use MP4Box or similar tools to mux audio and video.
Alternatively you can use www.dash-downloader.com to download everything in one step. The page will display some log explaining what it's doing. That might be helpfull.
(full disclosure: that's my website).
I dont think it is possible to play any of the files in a standalone player. The mp4 is the init segment which is required to decode the .m4s media segments. I dont think there is an option in the vlc player to map an init segment to multiple media segments. Nevertheless you can try a Dash player to play the manifest file. For instance dash.js
Initialization segment: A sequence of bytes that contain all of the initialization information required to decode a sequence of media segments. This includes codec initialization data, Track ID mappings for multiplexed segments, and timestamp offsets (e.g. edit lists).
Media segment: A sequence of bytes that contain packetized & timestamped media data for a portion of the media timeline. Media segments are always associated with the most recently appended initialization segment.
Source: http://www.w3.org/TR/media-source/#init-segment

Getting info about an mp3 file in ios 5

How do I get the info about a mp3 file? I mean, like, the tags and the artwork? Any one?
I'm not entirely sure if this answers your question, but here goes:
Assuming you mean any kind of audio file that resides in the iPod library, this information is contained in an MPMediaItem instance. These objects can be obtained in various ways, for example by using the MPMediaPickerController. The MPMediaItem is contained in the Media Player framework.
Reference here:
http://developer.apple.com/library/ios/#DOCUMENTATION/MediaPlayer/Reference/MPMediaItem_ClassReference/Reference/Reference.html
Small Example:
NSString *songTitle = [MPMediaItem valueForProperty: MPMediaItemPropertyTitle];
Now, if you're actually talking about an mp3 file residing in your App's sandbox, the answer you're looking for is located in this thread: Reading MP3 information using objective c

Is there anyway to get ID3 metadata from an MP3 or Vorbis comments from Ogg via the HTML5 audio element?

Mozilla Developer Center's HTML5 media guide describes an event for audio and video elements called "loadedmetadata". Is there anyway to get the metadata for files? I am writing an HTML5 extension for Google Chrome and I don't know what the metadata for the audio files I'm creating a player for beforehand.
Edit: This question seems to be kicking everyone's ass. :/
According to this you can use filereader.readAsBinaryString(file); to get the binary data of the ID3 tag.
filereader.readAsBinaryString(file); will asynchronously return a binary string with each byte represented by an integer in the range [0..255]. This is useful for binary manipulations of a file’s data, for example to look for ID3 tags in an MP3 file, or to look for EXIF data in a JPEG image.

Resources