HTTP Live Streaming

RSS for tag

Send audio and video over HTTP from an ordinary web server for playback on Mac, iOS, and tvOS devices using HTTP Live Streaming (HLS).

HTTP Live Streaming Documentation

Posts under HTTP Live Streaming tag

93 Posts
Sort by:
Post marked as solved
2 Replies
1.4k Views
Hi,When I run mediastreamvalidator on HLS streams (produced by mediafilesegmenter), with SAMPLE-AES applied, the latest version always signals :Unsupported audio track codec: Unknown - As a 'MUST FIX' issue.This result occurs even when I run the validator against the FairPlayStreaming example content supplied with the developer SDK package.This seems to have been introduced in HTTPLiveStreamingTools version:Version 1.2(170524)It does not happen with tools version:Version 1.2(160525)Is this a bug in the tool? or a new requirement perhaps?Hopefully someone can help me out with this...
Posted
by
Post not yet marked as solved
1 Replies
1.3k Views
Hello,When streaming and playing HLS streams on Safari using <video> tag, is there way to be notified at application level (javascript) of the presence of SCTE-35 data ranges in the stream (playlist)?When using the <video> tag on Safari, it is the responsibility of the the native video element to download and parse the playlists, thus there is no way for web application to know about the presence of such tags/markers in the playlists.Does the native video element trigger some events (like cue events for example) to signal the presence of these SCTE-35 data ranges?I tried to listen for cue events but unsuccessfully.
Posted
by
Post not yet marked as solved
1 Replies
3.7k Views
When describing closed captions renditions through HLS master playlists, should a properly formed playlist with closed captions contain one closed caption rendition with the DEFAULT=YES attribute? I searched the HLS RFC and section 4.3.4.1 on EXT-X-MEDIA mentions that no more than one should contain the DEFAULT=YES attribute. I was hoping to find recommendations around whether with one or more EXT-X-MEDIA renditions in the same group, if it is required that one of them contain DEFAULT=YES.The media player I am using does not display closed captions if one of the closed captions renditions does not contain the DEFAULT=YES attribute and I am wondering if that is an issue with the player or an issue with a malformed HLS playlist. Note the lack of a DEFAULT=YES attribute in the example playlist below. Should this still be considered a valid playlist?#EXTM3U #EXT-X-VERSION:3 #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="CC",LANGUAGE="eng",NAME="English",INSTREAM-ID="CC1" #EXT-X-STREAM-INF:BANDWIDTH=2103200,AVERAGE-BANDWIDTH=2305600,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=960x540,FRAME-RATE=30.000,CLOSED-CAPTIONS="CC" https://the.link.to.my.stream #EXT-X-STREAM-INF:BANDWIDTH=804760,AVERAGE-BANDWIDTH=875600,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=640x360,FRAME-RATE=30.000,CLOSED-CAPTIONS="CC" https://the.link.to.my.stream #EXT-X-STREAM-INF:BANDWIDTH=1304160,AVERAGE-BANDWIDTH=1425600,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=768x432,FRAME-RATE=30.000,CLOSED-CAPTIONS="CC" https://the.link.to.my.stream #EXT-X-STREAM-INF:BANDWIDTH=505120,AVERAGE-BANDWIDTH=545600,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=480x270,FRAME-RATE=30.000,CLOSED-CAPTIONS="CC" https://the.link.to.my.stream #EXT-X-STREAM-INF:BANDWIDTH=3102000,AVERAGE-BANDWIDTH=3405600,CODECS="avc1.640029,mp4a.40.2",RESOLUTION=1280x720,FRAME-RATE=30.000,CLOSED-CAPTIONS="CC" https://the.link.to.my.stream
Posted
by
Post not yet marked as solved
2 Replies
1.7k Views
Hello Guys,Recently, I'm getting this kind of issue on the HLS live streaming content,The error detail is like belowerror -16832/CoreMediaErrorDomain Warning: restarting 12.494080s from end of live playlist; target duration 9s - stall danger for https://C4--147-21-8-0-24-8395.dfwlive-v1-c4p1-sponsored.dfw.vcdn.att-idns.net/Content/HLS.abre/Live/channel(CMTHD-8395.dfw.1080)/uc9zjusg758wyw3zmumhqyck92mpguti-ks7qcjbcm2aaaaaa-20191125T201851-197474271-114.vttAnyone know what this is? It seems make the picture frozen, or degrade the streaming quality. Sometimes end up restarting the playback.Thanks & regards.
Posted
by
Post not yet marked as solved
7 Replies
1.7k Views
I notice that precious few HTTP Live Streaming questions have gotten responses, let alone answers. But I'll be optimistic!I'd like to try streaming my own live video through the LL-HLS tools (currently prerelease 73), in multiple bitrates.I succeeded in following directions: I use tsrecompressor to generate "bip-bop" video and pass three compressed variations of that into three instances of mediastreamsegmenter, then out through three instances of ll-hls-origin-example.go. It works as promised, end-to-end. (Brief aside, for any who may stumble after me: it took me too long to realize that I should improve my knowledge of IP Multicasting and use the prescribed 224.0.0.50 address. I got nowhere trying to simply route familiar UDP unicast between my processes.)So far, so good. Now I want to supply my own video from an external feed. Not the generated "bip-bop" or any local capture devices.% tsrecompressor --help tsrecompressor: unrecognized option `--help' Read input MPEG-2 TS, recompress and write to output. Usage: tsrecompressor [options] where options are: -i | --input-file= : input file path (default is stdin) ... etc.That sounds fantastic — I'd love to feed tsrecompressor through stdin! But in what format? It doesn't say, and my first few dozen guesses came up cold.The man page for mediastreamsegmenter appears to point the way: The mediastreamsegmenter only accepts MPEG-2 Transport Streams as defined in ISO/IEC 14496-1 as input. The transport stream must contain H.264 (MPEG-4, part 10) video and AAC or MPEG audio. If AAC audio is used, it must have ADTS headers. H.264 video access units must use Access Unit Delimiter NALs, and must be in unique PES packets.Of course, that's mediastreamsegmenter and not tsrecompressor. But it's a start. So this is my best guess at the appropriate ffmpeg output. (Recall that I want to eventually pass a live stream into ffmpeg; for now I'm starting with an m4v file.)% ffmpeg -re -i infile.m4v \ -c:v h264_************ \ -c:a aac_at \ -f mpegts \ - | tsrecompressor -h -a \ -O 224.0.0.50:9121 \ -L 224.0.0.50:9123 \ -P 224.0.0.50:9125This ends abruptly after 9 frames.av_interleaved_write_frame(): Broken pipe Error writing trailer of pipe:: Broken pipe//My best results are when I change from H.264 to H.265:% ffmpeg -re -i infile.m4v \ -c:v hevc_************ \ -c:a aac_at \ -f mpegts \ - | tsrecompressor -h -a \ -O 224.0.0.50:9121 \ -L 224.0.0.50:9123 \ -P 224.0.0.50:9125Now it doesn't break the pipe. It keeps counting along, frame after frame. The VTEncoderXPCService starts up, and sampling of the tsrecompressor process shows both producer and consumer threads for audio recompression.But there's no output. There was output for the generated "bip-bop" video. Not for HEVC-TS via stdin. I'm not 100% certain yet but I see no indication of any UDP output from tsrecompressor. The three mediastreamsegmenter processes sit idle.Am I missing some tag, or something, in the input stream? Do I need to pay more attention to chunk sizes and frame offsets?Thanks, all, for any insight or experience.
Posted
by
Post not yet marked as solved
10 Replies
6.0k Views
Hi, I'm working on an app where a user can scroll through a feed of short videos (a bit like TikTok). I do some pre-fetching of videos a couple positions ahead of the user's scroll position, so the video can start playing as soon as he or she scrolls to the video. Currently, I just pre-fetch by initializing a few AVPlayers. However, I'd like to add a better caching system. I'm looking for the best way to: get videos to start playing as possible, while making sure to minimize re-downloading of videos if a user scrolls away from a video and back to it. Is there a way that I can cache the contents of an AVPlayer that has loaded an HLS video? Alternatively, I've explored using AVAssetDownloadTask to download the HLS videos. My issue is that I can't download the full video and then play it - I need to start playing the video as soon as the user scrolls to it, even if it's not done downloading. Is there a way to start an HLS download with an AVAssetDownloadTask, and then start playing the video while it continues downloading? Thank you!
Posted
by
Post not yet marked as solved
1 Replies
1k Views
Hi, i have this problem in web app context running in safari 14.0 on Apple Iphone X device. It seems that when i capture the user's microphone via: var opts = { //audio: true, audio: true, video: true }; navigator.mediaDevices.getUserMedia(opts) This causes all audio playback within the page to be played as mono e.g. i have a file that should only be heard through the left headphone and it is heard through both headphones. Setting audio to false above means that the audio files play normally. Seems like some sort of bug where capturing the microphone seems to affect the output audio context. Any advice on what i can do to be able to get microphone input and stereo output simultaneously?
Posted
by
Post marked as solved
4 Replies
6.0k Views
Hello there, in our team we were requested to add the possibility to manually select the video quality. I know that HLS is an adaptive stream and that depending on the network condition it choose the best quality that fits to the current situation. I also tried some setting with preferredMaximumResolution and preferredPeakBitRate but none of them worked once the user was watching the steam. I also tried something like replacing the currentPlayerItem with the new configuration but anyway this only allowed me to downgrade the quality of the video. When I wanted to set it for example to 4k it did not change to that track event if I set a very high values to both params mentioned above. My question is if there is any method which would allow me to force certain quality from the manifest file. I already have some kind of extraction which can parse the manifest file and provide me all the available information but I couldn't still figure out how to make the player reproduce specific stream with my desired quality from the available playlist.
Posted
by
Post not yet marked as solved
3 Replies
1.9k Views
Hi, We are using AVPlayer for FPL HLS stream, after migrating to iOS 15 (currently Beta 3), we have observed a strange behavior during segments download; The player downloads last video segment of VOD HLS stream The player downloads all audio segments Playback starts playing from the end (last segment) Needs to restart playback to start downloading all video segments. Note that we do not have this behavior with older versions of iOS (14 and before). m3u8 file Thank you,
Posted
by
Post not yet marked as solved
2 Replies
2.1k Views
I am trying to insert timed metadata (id3) into a live HLS stream created with Apple's mediastreamsegmenter tool. I am getting the video from an ffmpeg stream, here is the command I run to test from an existing file: ffmpeg -re -i vid1.mp4 -vcodec libx264 -acodec aac -f mpegts - | mediastreamsegmenter -f /Users/username/Sites/video -s 10 -y test -m -M 4242 -l log.txt To inject metadata, I run this command: id3taggenerator -text '{"x":"data dan","y":"36"}' -a localhost:4242 This setup creates the expected .ts files and I can play back the video/audio with no issues. However the metadata I am attempting to insert does not work in the final file. I know the metadata is there in some form, when I file-compare a no-metadata version of the video to one I injected metadata into, I can see the ID3 tags within the binary data. Bad File Analysis When I analyze the generated files using ffmpeg: ffmpeg -i video1.ts the output I get is: [mpegts @ 0x7fb00a008200] start time for stream 2 is not set in estimate_timings_from_pts[mpegts @ 0x7fb00a008200] stream 2 : no TS found at start of file, duration not set[mpegts @ 0x7fb00a008200] Could not find codec parameters for stream 2 (Audio: mp3, 0 channels): unspecified frame sizeConsider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options Input #0, mpegts, from 'video1.ts':  Duration: 00:00:10.02, start: 0.043444, bitrate: 1745 kb/s  Program 1   Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 848x464 [SAR 1:1 DAR 53:29], 30 fps, 30 tbr, 90k tbn, 60 tbc   Stream #0:1[0x101] Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 130 kb/s  No Program   Stream #0:2[0x102]: Audio: mp3, 0 channels Note how the third stream (stream #0:2) is marked as mp3...this is incorrect! Also it says "No Program", instead of being in "Program 1". When I analyze a properly encoded video file with inserted ID3 metadata that I created with Apple's mediafilesegmenter tool, the analysis shows a "timed_id3" track and this metadata track works properly in my web browser. Good File Analysis ffmpeg -i video1.ts —Input #0, mpegts, from 'video1.ts':  Duration: 00:00:10.08, start: 19.984578, bitrate: 1175 kb/s  Program 1   Stream #0:0[0x101]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 848x464, 30 fps, 30 tbr, 90k tbn, 180k tbc  Stream #0:1[0x102]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 67 kb/s  Stream #0:2[0x103]: Data: timed_id3 (ID3  / 0x20334449) I must use mediastreamsegmenter because that is required for live streams. Does anyone know how I can get timed ID3 metadata into a live HLS stream properly?
Posted
by
Post not yet marked as solved
1 Replies
1.3k Views
Hi Team, I am pre-caching first 5 seconds of vidoes to improve start up playback latency. I am using AVAssetDownloadTask(AVAssetDownloadTask | Apple Developer Documentation) for pre-caching first 5 seconds in movpkg container in local. Now during playback of pre-cache vidoe from local file, AVPlayer start downloading remaining video chunks hence completely download video in local which increase space in device. Is there any way to stop AVPlayer to cache/download chunks in local during playback ?
Posted
by
Post not yet marked as solved
1 Replies
1.6k Views
I am trying to figure out why there is no audio on my iPhone or iPad, my code is working on other devices. I am on IPad iOS 15.3.1 and I test on my computer using Safari. Video is working, and both the video and audio work on Android, Chrome, etc. This is just an audio problem on iOS. From my WebRTC I have HTML5 Audio Track tracks as such: <audio muted="false" autoplay="1" id="xxxx"></audio> When debugging, I connect my IPad and have run this volume check: document.getElementById('***').volume And it returns the value of 1, so the volume is on its loudest (I think according to HTML5 audio tags range from 0, 0.1, 0.2, xxxx 1). document.getElementById('***').end The ended returns false. Next I try to run the play() function as such: $('#***')[0].play() .then((resp) => { console.log("Success"); console.log(resp) }) .catch(error => {console.log(error)}) And it executes the success response. But there is still no sound. What could be causing this issue on iOS and Safari only?enter code here
Posted
by
Post marked as solved
3 Replies
2.4k Views
Issue: I am supporting an iOS application that streams Fairplay DRM protected content. On iOS 16 devices, I am seeing intermittent exceptions thrown when trying to process the CKC returned by the license server. The thrown exception is as follows: -[AVContentKeyRequest processContentKeyResponse:] AVContentKeySession's keySystem is not same as that of keyResponse This issue does not occur on older devices (we support iOS 13, 14, 15) I am unable to find documentation about this error so any insight is appreciated: High-Level Code Overview Use ContentKeyRequest to request an application certificate Use returned Cert to call makeStreamingContentKeyRequestData Use returned data to request FairPlay license Use returned CKC to generate AVContentKeyResponse (i.e. AVContentKeyResponse(fairPlayStreamingKeyResponseData:_)) Call processContentKeyResponse(_) App crash/exception thrown when callling processContentKeyResponse I am seeing other issues related to DRM and iOS 16 but these are specific to downloaded and offline content which do not match my use case.
Posted
by
Post not yet marked as solved
1 Replies
714 Views
We have implemented an optimization feature for HLS VOD streaming in the form of an EVENT Manifest. General manifest hour The bottom line is that on the first request, we return the HLS EVENT Manifest within 30 seconds and launch certain processin mechanisms in the background, as soon as everything has ready, on the next requests we return an EVENT Manifest with an EXT-X-ENDLIST tag What does it look like 1st request: #EXTM3U #EXT-X-PLAYLIST-TYPE: EVENT 1.ts 2.ts 3.ts 2nd req (if background completed) #EXTM3U #EXT-X-PLAYLIST-TYPE: EVENT 1.ts 2.ts 3.ts .... .... .... 1000.ts #EXT-X-ENDLIST This approach worked in VLC player and hls.js players but this thing doesn't work in native Safari player It has very strange behavior: Live is shown first in the timeline (which is okay) then, as he has already downloaded the manifest with EXT-X-ENDLIST, it shows the real duration (hour) but literally after 2 seconds it cuts the timeline and leaves only 2 minutes in the timeline by DevTools-> Network, I see that it stops downloading after 8-9 segments And now I would like to know if anyone has encountered such a safari problem and if maybe you need to somehow reconfigure the browser player.
Posted
by
Post not yet marked as solved
0 Replies
452 Views
I am testing a video stream (HLS) using the Video.js player. After updating my iPhone's iOS to version 16.4.1, the player's subtitles default to 'unknown', and I am using the 'textTracks' function where 'track.length' is equal to 1. However, in other versions (e.g. 15.X.X), 'track.length' is equal to 2 (English and unknown). I want the subtitles to default to English on my device (version 16.4.1). Thanks in advance for your help! Example link: https://codepen.io/wendyhsiao/pen/wvYqeJx
Posted
by
Post not yet marked as solved
0 Replies
664 Views
I am trying to playback live content generated using Apple tools setup with Safari Browser, and having difficulty playing back. Here is more information of my Server setup: %tsrecompressor -c -O 224.0.0.50:9121 -L 224.0.0.50:9123 -P 224.0.0.50:9125 %mediastreamsegmenter --part-target-duration-ms=200 -f /usr/local/Cellar/nginx/1.23.4/html/ -t 1 224.0.0.50:9121 -D %cd /usr/local/share/hlstools %go run ll-hls-origin-example.go -dir /usr/local/Cellar/nginx/1.23.4/html -http :443 I am able to playback the content using hls.js demo player and the above Server set-up. I do see a "Failed to load resource: Plug-in handled load" error and don't see any content being played. Any ideas as to how to work around the error? Makes me wonder does Safari support ext-x-part tag at all? Thanks!
Posted
by
Post not yet marked as solved
2 Replies
804 Views
I see it lightly documented that the first variant listed in the manifest is the first variant to play, then adaptive streaming takes over to pick the next variants. When we do this we find the 3rd variant is loaded first. How can I investigate the reason for this? I've run media analyzer and there were some suggestion but nothing that made the 3d variant different from the first 2. #EXTM3U #EXT-X-VERSION:3 #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-STREAM-INF:BANDWIDTH=14985704,AVERAGE-BANDWIDTH=6811200,CODECS="avc1.4d4033,mp4a.40.2",RESOLUTION=3840x2160,FRAME-RATE=29.970 clip4_2160p30-6M.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=24835374,AVERAGE-BANDWIDTH=11211200,CODECS="avc1.4d4033,mp4a.40.2",RESOLUTION=3840x2160,FRAME-RATE=29.970 clip4_2160p30-10M.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=37147462,AVERAGE-BANDWIDTH=16711200,CODECS="avc1.4d4033,mp4a.40.2",RESOLUTION=3840x2160,FRAME-RATE=29.970 clip4_2160p30-15M.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=49459550,AVERAGE-BANDWIDTH=22211200,CODECS="avc1.640033,mp4a.40.2",RESOLUTION=3840x2160,FRAME-RATE=29.970 clip4_2160p30-20M.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=74013326,AVERAGE-BANDWIDTH=33140800,CODECS="avc1.640033,mp4a.40.2",RESOLUTION=3840x2160,FRAME-RATE=29.970 clip4_2160p30-30M.m3u8
Posted
by
Post not yet marked as solved
0 Replies
612 Views
Hello, I am running some simple playback tests. I would like to playback content streamed via HLS manifest on my AppleTV device, ideally with playback metrics. I should be able to use something like the VLC app: https://www.videolan.org/vlc/download-appletv.html (open to suggestions) But as for metrics, im not 100%. Does anyone have experience on this topic? As for the specific metrics, Im just looking for something that I can use to objectively measure different tests. I was thinking anything related to buffer rates, error rates, and percentage of time playing back specific streams.
Posted
by
Post not yet marked as solved
1 Replies
1.3k Views
Hello, I've encountered a recurring issue while trying to play back live streams using AVPlayer in an iOS app. The video stream is being delivered via Amazon Kinesis Video Streams (KVS) using HLS. The specific issue is that audio frequently gets interrupted during playback. The video continues to play just fine, but the audio stops. This issue seems to occur only on iOS devices and not on other platforms or players. When I check the console logs, I see a number of error messages that may be related to the issue: 2023-05-11 20:57:27.494719+0200 Development[53868:24121620] HALPlugIn::DeviceGetCurrentTime: got an error from the plug-in routine, Error: 1937010544 (stop) 2023-05-11 20:57:27.534340+0200 Development[53868:24121620] [aqme] AQMEIO.cpp:199 timed out after 0.011s (6269 6269); suspension count=0 (IOSuspensions: ) 2023-05-11 20:57:30.592067+0200 Development[53868:24122309] HALPlugIn::DeviceGetCurrentTime: got an error from the plug-in routine, Error: 1937010544 (stop) 2023-05-11 20:57:30.592400+0200 Development[53868:24122309] HALPlugIn::DeviceGetCurrentTime: got an error from the plug-in routine, Error: 1937010544 (stop) I've attempted to troubleshoot this issue in various ways, including trying different iOS devices and networks. I've also attempted to use VLC's player on iOS, which doesn't have the audio interruption issue, but it does encounter other problems. I believe there might be some compatibility issue between AVPlayer and KVS. I've posted a similar issue on the Amazon KVS GitHub repo but I am reaching out here to see if anyone has faced a similar issue with AVPlayer and has found a solution or can provide some guidance. Has anyone encountered this issue before, or does anyone have suggestions on how to address it? Any help would be greatly appreciated!
Posted
by
Post not yet marked as solved
1 Replies
842 Views
Has anyone else had issues live streaming HLS on XCode 14.3? I am using an IOS 16.2 simulator as it seems the bugs with streaming on the 16.4 simulators still haven't been resolved. I have been able to play on-demand videos fine, although when I try and play a live stream, I just get a black screen with a play button with a cross through it.
Posted
by