I tried configuring the preferredForwardBufferDuration on devices using 4G and Wi-Fi, and in these cases, AVPlayer works correctly according to the configured buffer duration. However, when the device is connected to a 5G network, the configuration value no longer works.
For example, if I set preferredForwardBufferDuration to 30 seconds, AVPlayer preloads with a buffer of over 100 seconds. I’m not sure how to resolve this, as it’s causing issues with my system.
HTTP Live Streaming
RSS for tagSend audio and video over HTTP from an ordinary web server for playback on Mac, iOS, and tvOS devices using HTTP Live Streaming (HLS).
Posts under HTTP Live Streaming tag
75 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
We are experiencing an issue with our HLS MPEG-TS streams on Apple devices, where the AVPlayer in our iOS app and Safari jumps back to the start when the player automatically changes quality. This occurs despite the stream still indicating that it is live and there is no change in the seekbar. After testing our streams with the Apple HLS Validator, the only problem that occured was an "Measured peak bitrate compared to multivariant playlist declared value exceeds error tolerance"-Error.
On Chrome and on our Android-App this playback bug does not happen. Has someone else experienced similar issues with the AVPlayer?
The media services used for HLS streaming in an AVPlayer seem to crash if your segments are too large.
Anything over 20Mbps seems to cause a crash. I have tried adjusting the segment length to 1 second also and it didn't help.
I am remuxing Dolby Vision and HDR video and want to avoid transcoding and losing any metadata. However the segments are too large.
Is there a workaround for this? Otherwise it seems AVFoundation is not suited to high bitrate HLS and I should be using MPV or similar.
Hello, we have HLS stream app and we use AVPlayer for HLS stream. We want to implement dynamic resulotion feature as user's selection. For example, if user want to watch only 1080p user has to watch only 1080p but we have tried to implement "preferredMaximumResolution" and "preferredPeakBitRate" parameters and but AVPlayer does not force it which means that setting preferredMaximumResolution= CGSize(width: 1920, height: 1080) player does not only force to play 1080p profile, player drops resulotion to 720p but we do not want 720p stream if user selected 1080p resulotion. Is there any method to force it even if stream stalls? Thank you in advance
Observing 4K playback issues on tvOS 18. Encountering HTTP 416 (Range Not Satisfiable) errors when the player attempts to request byte ranges that are outside the available data on the server. This leads to fatal playback error resulting in the error
CoreMediaErrorDomain error -12939 - HTTP 416: Requested Range Not Satisfiable
Notably, there are no customizations or modifications to the standard AVPlayerViewController on tvOS player.
AVPlayer is trying to request the resource of length equals 739 bytes with an invalid byte range (739-) request. Since the request is not satisfiable server returns with 416. Note this is only limited to tvOS 18 and we are trying to understand why AVPlayer is making this invalid request in tvOS 18 resulting in playback error.
Hi, I am trying to stream spatial video in realtime from my iPhone 16.
I am able to record spatial video as a file output using:
let videoDeviceOutput = AVCaptureMovieFileOutput()
However, when I try to grab the raw sample buffer, it doesn't include any spatial information:
let captureOutput = AVCaptureVideoDataOutput()
//when init camera
session.addOutput(captureOutput)
captureOutput.setSampleBufferDelegate(self, queue: sessionQueue)
//finally
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
//use sample buffer (but no spatial data available here)
}
Is this how it's supposed to work or maybe I am missing something?
this video: https://developer.apple.com/videos/play/wwdc2023/10071 gives us a clue towards setting up spatial streaming and I've got the backend all ready for 3D HLS streaming. Now I am only stuck at how to send the video stream to my server.
Critical: START-DATE has changed
--> Detail: Line: #EXT-X-DATERANGE:ID="36",START-DATE="2024-10-16T18:11:42.775+0530",PLANNED-DURATION=30,SCTE35-OUT=0xfc302000000000000000fff00f05000000247ffffe002932e0a9b5000000006d4149c0
--> Source: <error -12788>
Hi,
I’m seeking information about the HLS protocol version supported in Safari on macOS. The official documentation only provides details about iOS support. Is there an official document that addresses this?
Best regards
We have observed consistent glitches in video playback when using AVPlayer to stream HLS (HTTP Live Streaming) videos on iOS. The issue manifests as intermittent frame drops, stuttering, and playback instability during HLS streams. However, the same behavior is not present when playing MP4 videos using the same AVPlayer instance. The HLS streams being used follow standard encoding practices, and network conditions have been ruled out as a cause for this problem.
https://drive.google.com/file/d/1lhdpHTyjPYCYLHjzvb6ZF6P6jehIuwY0/view?usp=sharing
Steps to Reproduce:
1. Load an HLS video into AVPlayer and initiate playback.
2. Observe intermittent glitches and stuttering during video playback.
3. Load and play an MP4 video in the same AVPlayer instance.
4. Notice that MP4 playback is smooth without any glitches.
I am trying to play HLS videos on my iPhone app and I see frequent glitch on the video, it is not happening with MP4.
https://drive.google.com/file/d/1lhdpHTyjPYCYLHjzvb6ZF6P6jehIuwY0/view?usp=sharing.
Hi,
Brief background on what I'm trying to achieve:
I have an IoT device that produces a HLS stream of saved videos when they are accessed through the device's broadcast hotspot. To access the hotspot, I use an NEHotspotConfiguration. When I use AVPlayer to watch the HLS stream, everything is fine! When I use a media pod (VLC) to try to consume the HLS stream, traffic goes over cellular network even though the device's host address is 192.168.1.254. I am under the impression this is ALWAYS a local network device.
I haven't spent much time digging into the code for VLC to figure out why, but when I disable cell network in my app's settings, the VLC request resolves perfectly. I have been served radio silence on their forums and issues, so I thought if there's another solution this would be the place to ask!
Is there something going on with the way iOS handles web requests to local network devices? My IoT device's hotspot never has internet access, and after reading Quinn's Extra-ordinary Networking advice (https://developer.apple.com/forums/thread/734348), I'm still lost for how I can force my request to go to the WiFi network rather than cellular...
Does anyone have any recommendations?
Thanks in advance!
I use AVPlayer to play HLS video successfully on macOS Sonoma, but I encountered this error on macOS Sequoia. Please help me:
Error Domain=AVFoundationErrorDomain Code=-11833 ‘Cannot Decode’ UserInfo={NSUnderlyingError=0x600001e57330 {Error Domain=CoreMediaErrorDomain Code=-12906 ‘(null)’}, NSLocalizedFailureReason=The decoder required for this media cannot be found., AVErrorMediaTypeKey=vide, NSLocalizedDescription=Cannot Decode}
Thanks!
Hi,
I am writing to seek any help or workaround regarding an issue I have encountered while implementing Low-Latency HLS playback using the AVAssetResourceLoaderDelegate.
I have been successfully loading playlists during HLS live playback using the AVAssetResourceLoaderDelegate. However, after introducing Low-Latency HLS, I have run into a problem.
When the AVPlayer loads low-latency content playback natively, everything works fine. But when I use the delegate for loading, I encounter the following error from AVPlayer's status observer:
CoreMediaErrorDomain -15410
Low Latency: Server must support http2 ECN and SACK
It seems there is no problem since playback does not stop, but there is a very critical part missing. The playback does not achieve the expected low latency and behaves similarly to standard HLS.
Additionally, this behavior only occurs on iOS 16 devices and simulators. On iOS 17 simulators and devices, the error message does not appear, and the latency remains low as expected.
Therefore, I suspect that there might be some misjudgment in the verification process within the internal implementation of AVPlayer.
Since our app needs to support iOS 16, I would appreciate any solutions, methods to try, or workarounds that you could share regarding this issue.
Thank you.
How do I enable the system hand controls within an immersive space?
I have an ImmersiveScene and would like to enable the new 2.0 system controls like the home button and volume slider.
ImmersiveSpace(id: appModel.immersiveSpaceID) {
ImmersiveView()
}
.immersionStyle(selection: .constant(.full), in: .full)
.upperLimbVisibility(.visible)
While I can see my hands and arms in this view, I cannot get the "New Hand Gestures" to show up when on visionOS 2.0. When I leave the immersive space, they appear.
First, when the player uses m3u8
There should be a restart button on the player banner
As a result, sometimes the frame image does not update when seeking forward
The same behavior observed with AppleTV's default app
In addition, the same issue occurs when playing Apple event videos
After the update on iOS 18, FairPlay content does not play.
We get an error: CoreMediaErrorDomain Code=-12891.
this error occurs after sending a ckc message. What does this error mean? Everything works fine on iOS < 18.
Hello,
I'm trying to create HLS output with segment time of 6 seconds, but sync samples (fragments) every 1 second.
I want to have AVAssetWriter write a sync sample / moof header every second.
Am I correct in understanding that I could only achieve this with a pre-fragmented MP4 and use a passthrough rendition with setting preferredOutputSegmentInterval to indefinite and running flushSegment() as needed? Or is there another method using AVFoundation?
Thanks in advance.
Hi,
I am trying to detect if an audio stream is Dolby Atmos. I have existing code that determines if a stream is Dolby Atmos based on the following:
Channel count is greater than equal to 8
Binaural is true
Immersive is true
Downmix is false
I am trying to determine if these rules are correct and documentation that specifies these rules that I can reference in the future.
Any help you can provide is greatly appreciated.
Regards,
John
I’m developing an app for IPTV where users can add their own links to TV channels and watch them through the app. Since not all IPTV links use HTTPS, I’ve set NSAllowsArbitraryLoads to true in the Info.plist.
Apple mentions that if you set this to true, you need to provide an explanation. What kind of explanation do they require, and how should I provide it?
Thanks!
I have an application that downloads content using AVAssetDownloadTask. In the iOS Settings app, these downloads are listed in the Storage section as a collection of downloaded movies, displaying the asset image, whether it's already watched, the file size, and an option to delete it.
Curious about how other apps handle this display, I noticed that Apple Music shows every downloaded artist, album, and song individually. This feature made me wonder: can I achieve something similar in my application? On the other hand, apps like Spotify and Amazon Music don’t show any downloaded files in the Settings app. Is it possible to implement that approach as well?
Here is print screen of the Apple Music Storage section in the Settings App:
I tried moving the download directory into sub folder using the FileManager, but all the results made the downloads stop showing in the setting app