HLS live streaming subtitle? - live-streaming

I am using rtmp to broadcast streams to the server and using HLS to stream the video to my device.
Is there a subtitle protocol that I can update the subtitle on real time,
for example, there is a subtitle file in server, I can keep write into that file and my player also can keep read from that file.
I know WebVTT works for recorded streaming video, but will it work for live streaming video? Can I link my player to the webVTT file and I can just update the subtitle by keeping writing to it?

You can use WebVTT to add subtitles to a live HLS stream. You do this by using a live subtitle playlist. It works just like a live playlist - you add and remove entries from it as time progresses.
First create a master playlist and add a reference to your subtitle playlist (subtitles.m3u8) to it. Here’s a (simplified) example:
#EXTM3U
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",URI="subtitles.m3u8",LANGUAGE="en"
#EXT-X-STREAM-INF:BANDWIDTH=500000,RESOLUTION=1920x1080,SUBTITLES="subs"
prog_index.m3u8
The next step is updating the subtitle playlist during the live broadcast. Let’s say your subtitle playlist looks like this initially:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:10,
1.webvtt
#EXTINF:10,
2.webvtt
#EXTINF:10,
3.webvtt
Notice that the #EXT-X-ENDLIST tag is missing from the playlist. This will cause the player to keep retrieving the playlist.
Then some time later (segment duration) it will look like this:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:2
#EXTINF:10,
2.webvtt
#EXTINF:10,
3.webvtt
#EXTINF:10,
4.webvtt
And so on. You’ll probably have to write some custom code to update the subtitle playlist.

Related

HLS live streaming subtitle doesn't appear

I was trying to add subtitles to my Live HLS stream using this tutorial
1: http://hlsbook.net/how-to-add-subtitles-to-a-live-hls-stream/ , also read all the issues on internet but didn't succeed.
The issue is that streaming works , and browser gets the video segments and subtitle segments (webvtt), then Player starts the video , but doesn't show the subtitles (even if it is selected by default), there no errors in console.
here is my master manifest file :
#EXTM3U
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=YES,AUTOSELECT=YES,FORCED=NO,LANGUAGE="en",URI="subslist/subtitles.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=1118592,CODECS="mp4a.40.2, avc1.64001f",RESOLUTION=640x360,SUBTITLES="subs"
prog_index.m3u8
Video Playlist (prog_index.m3u8):
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:2
#EXT-X-TARGETDURATION:5
#EXTINF:5.0,
seg.ts
#EXTINF:5.0,
seg.ts
#EXTINF:5.0,
seg.ts
subtitles list (subtitles.m3u8) :
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:2
#EXT-X-TARGETDURATION:5
#EXTINF:5.0,
subtitleSeg1.webvtt
#EXTINF:5.0,
subtitleSeg2.webvtt
snapshot of player
browser's network

Selecting high bit rate video from master playlist .m3u8 to play video using AVPlayer

I have mater playlist .m3u8 that files contain's other index file of type .m3u8 now app requirement's is to play video of high bit rate video, is it possible to achieve this and play high bit rate video using AVPlayer(apple tvOS).
Master playlist contains following index files
EXTM3U
EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=378000,RESOLUTION=256x144,CODECS="avc1.42001e,mp4a.40.2"
someurl.m3u8
EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2072000,RESOLUTION=480x270,CODECS="avc1.42001e,mp4a.40.2"
someurl.m3u8
EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2671000,RESOLUTION=640x360,CODECS="avc1.4d001f,mp4a.40.2"
someurl.m3u8
Now according to requirement app needs to play below url from master play list.
ID=1,BANDWIDTH=2671000,RESOLUTION=640x360,CODECS="avc1.4d001f,mp4a.40.2"
someurl.m3u8
Is it possible to achieve this using AVPlayer.
Setting
player.currentItem?.preferredPeakBitRate = 2072000
only sets an upper bound on bitrate, so for example you could exclude the highest bitrate using this.
The thing is, AVFoundation will not choose a bitrate that is higher than the network connection's throughput, because that would result in choppy playback, which is not a sensible strategy.
That said, if you really want to force playback of the highest bitrate asset, you could intercept the fetching of the outer m3u8 file and suppress the lower bitrate entries, or parse the file and play the highest bitrate URL directly with AVPlayer.

JWPlayer 6 playlist - interaction between internal JWPlayer playlist and external dynamic playlist

I am using a count function that queries a MySQL database. Each result creates an a href link that calls the JWPlayer individually with one video filename.
The list of results is my playlist. It is external to JWPlayer.
I want to pass this list into JWPlayer to use as its internal playlist so it will play all the videos in sequence, and so the user can navigate forward and backward in the list.
Both playlists will have exactly the same videos in them, and in the same order.
I also want the user to be able to click on any of the links in my external playlist to play that file and then continue the playlist from that point onwards.
Can the JWPlayer internal playlist be controlled externally?
For example, could I create an RSS feed file that would be updated whenever I clicked on one of my external playlist links?
Would JWPlayer reload the updated RSS file?
Does it matter if the RSS file has the same filename?
Your help is greatly appreciated.
Thank you.
Kind regards,
Kyle

Playing m3u8 on any devices (IOS, Android, PC)

is it possible to play a m3u8 file using video.js on any devices?
So far, I am only able to play them on Android or IOS. Want to play them on PC as well.
This is what I am using but no luck.
Thanks for your help
<source src="http://www.domaine-name.com/name/playlist.m3u8" type='video/mp4'>
From Wikipedia:
An M3U file is a plain text file that specifies the locations of one
or more media files. The file is saved with the "M3U" or "m3u"
filename extension. Each entry carries one specification. The
specification can be any one of the following:
an absolute local pathname; e.g., C:\My Music\Heavysets.mp3
a local pathname relative to the M3U file location; e.g. Heavysets.mp3
a URL.
As M3U only stores the multimedia items locations, you should parse it and play them using the proper audio/video playback lib.
Take a look at this question
EDIT: The link in the comment points to another m3u, you just should get the link to the multimedia files:
Content of first m3u:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=613798
http://tveurope1.zion3media.com:1935/demoweb1/mystream/playlist.m3u8?wowzasessionid=506379083
When you follow that link you will get a playlist like this:
#EXTM3U
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:1343
#EXTINF:11,
media_1343.ts?wowzasessionid=506379083
#EXTINF:12,
media_1344.ts?wowzasessionid=506379083
#EXTINF:9,
media_1345.ts?wowzasessionid=506379083
Example of multimedia resource from playlist:
http://tveurope1.zion3media.com:1935/demoweb1/mystream/media_1343.ts?wowzasessionid=506379083

Finding video content in iPhone playlist

Running iOS 4.2.1 I'm able to create a mixed playlist containing both audio and video. 3 items, first a video then 2 audio tracks. I know I'm working with the correct playlist.
However, cycling through the items like this...
for (MPMediaItem *mediaItem in [playlist items]) {
NSLog(#"%#",mediaItem);
NSLog(#"path %#",[mediaItem valueForProperty:MPMediaItemPropertyAssetURL]);
}
...returns me output of...
<MPConcreteMediaItem: 0x1303d0> 9016712715169871401
path ipod-library://item/item.mp3?id=9016712715169871401
<MPConcreteMediaItem: 0x12e9e0> 9016712715169871401
path ipod-library://item/item.mp3?id=9016712715169871401
...so my video asset is being excluded from the playlist. The iPhone plays the playlist correctly when I'm using it as an iPod.
I've gotten as far as I have using Ole Begemann's sample code from here. Does anyone know if video assets are supposed to be excluded? Is there another approach which would combine audio and video assets, assuming they're mixed in a playlist which I know the name of?