Streaming

RSS for tag

Deep dive into the technical specifications that influence seamless playback for streaming services, including bitrates, codecs, and caching mechanisms.

Streaming Documentation

Posts under Streaming subtopic

Post

Replies

Boosts

Views

Activity

AVPlayer currentTime not match the displayed frame
I have a m3u8 file which i want to use with HLS.  My problem is that when i seek many times, the currentTime not match with the displayed frame. I experience that, the more seeking there is more difference. (it's like a constant +offset) Our use case is very timing sensitive, we need to stop the videos at specific positions. For this we use the following code: [_player addBoundaryTimeObserverForTimes:times queue:dispatch_get_main_queue() usingBlock:^{ weakSelf.player.rate = 0.0; // The time is correct here, but the displayed frame is not sync with this time CMTimeShow(weakSelf.player.currentTime); } ] I read that AVURLAssetPreferPreciseDurationAndTimingKey can help, but the currentTime still wrong. NSDictionary<NSString *, id> *options = @{AVURLAssetPreferPreciseDurationAndTimingKey:@YES}; AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:url options:options]; AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:urlAsset]; I also read that there is a problem with the m3u8 itself. (for example wrong GOP size.) What is the reason for the incorrect currentTime, and how can i fix this? ffprobe output: ffprobe https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.m3u8 ffprobe version 5.1 Copyright (c) 2007-2022 the FFmpeg developers built with Apple clang version 13.1.6 (clang-1316.0.21.2.5) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [hls @ 0x152f04280] Skip ('#EXT-X-INDEPENDENT-SEGMENTS') [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate.m3u8' for reading [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [https @ 0x154045000] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate.m3u8' for reading [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [https @ 0x154045000] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate.m3u8' for reading [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate_00001.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate_00002.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate_00001.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate_00002.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate_00001.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate_00002.ts' for reading Input #0, hls, from 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.m3u8': Duration: 00:49:43.00, start: 2.033367, bitrate: 0 kb/s Program 0 Metadata: variant_bitrate : 8133826 Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn Metadata: variant_bitrate : 8133826 Program 1 Metadata: variant_bitrate : 18870392 Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn Metadata: variant_bitrate : 18870392 Program 2 Metadata: variant_bitrate : 40776144 Stream #0:2: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 2704x1520 [SAR 1:1 DAR 169:95], 29.97 fps, 29.97 tbr, 90k tbn Metadata: variant_bitrate : 40776144
1
1
1.7k
Aug ’22
State of FORCED tag in HLS
I cannot seem to get the FORCED tag available in the HLS standard to work correctly. Using the native HLS players in safari, iOS, and tvOS, none of them render a subtitle track defined as #EXT-X-MEDIA:TYPE=SUBTITLES,URI="text/text-open.m3u8",GROUP-ID="text",LANGUAGE="sv",NAME="Svenska",DEFAULT=YES,AUTOSELECT=YES,FORCED=YES or #EXT-X-MEDIA:TYPE=SUBTITLES,URI="text/text-open.m3u8",GROUP-ID="text",LANGUAGE="sv",NAME="Svenska",DEFAULT=NO,AUTOSELECT=YES,FORCED=YES I've seen that Apple TV+ uses forced subtitles with the same settings as the latter example in their playlists, and I assume they work there. Is there something obvious that I'm missing?
2
0
1.9k
Aug ’22
How to track video dimension changes (videoRect) while in PictureInPicture (PiP)
I'm trying to get the width and height of an HLS AVPlayer in PiP mode. It seems that you would get this in the videoRect attribute of AVPlayerLayer, but it doesn't seem to update correctly in PiP or background modes (playing a video's audio while in lock screen for example doesn't update width and height to 0 as expected). Any ideas on how to get the video resolution/dimension while in PictureInPicture?
0
0
886
Sep ’22
What does the error mean: CoreMediaErrorDomain -12863
Hi, We have been having issues with playback that result in the playback stopping due to the error code below: **CoreMediaErrorDomain Code=-12863 ** 10:57:05.306794+0200 mediaserverd <<<< FigStreamPlayer >>>> fpfs_StopPlayingItem: [0x104fe78d0|P/XL] <0x1079a9000|I/SFH.01> Stopping, err=Error Domain=CoreMediaErrorDomain Code=-12863{code} However I am unable to find any reference to what this error code means. Could anyone help? Regards
1
1
1.8k
Sep ’22
What does this actually indicate? CoreMediaErrorDomain" "Internal error: restarting too far ahead
During the course of stream a live HTTP Video Stream intermittently these errors show up in the logs for AVPlayer. What problem are they indicating for AVPlayer and what conditioning of the media stream is needed to resolve these errors?2015/06/16 01:16:35.035 http://127.0.0.1:49815/f1434502503.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.3884s)" lan2015/06/16 01:17:14.014 http://127.0.0.1:49815/f1434502617.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.9554s)" lan2015/06/16 02:01:23.023 http://127.0.0.1:49815/f1434510588.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.1115s)" lan2015/06/16 02:01:31.031 http://127.0.0.1:49815/f1434510612.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 - -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.4285s)" lan2015/06/16 02:47:36.036 http://127.0.0.1:49815/f1434518949.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.5811s)" lan2015/06/16 02:55:34.034 http://127.0.0.1:49815/f1434520383.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.7908s)" lan2015/06/16 03:10:49.049 http://127.0.0.1:49815/f1434523140.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.7415s)" lan2015/06/16 03:41:46.046 http://127.0.0.1:49815/f1434528732.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.5722s)" lan2015/06/16 07:13:08.008 http://127.0.0.1:49815/f1434566955.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.2835s)" lan2015/06/16 07:13:10.010 http://127.0.0.1:49815/f1434566964.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.1441s)" lan2
9
0
13k
Sep ’22
Questions about FairPlay(kTestAppCert, content key)
Hi,I have three questions about FairPlay.1. In FairPlayStreaming_PG.pdf on page 27, the document says that"In the code sample shown in the iOS FPS Client sample (included in the SDK),kTestAppCert contains the Application Certificate.".So I searched kTestAppCert, but kTestAppCert did not show up in the iOS FPS Client sample.Where does kTestAppCert appears and what is it?2. In FairPlayStreaming_PG.pdf page 26, the document says that"Do not hard-code the Application Certificate in the playback application".I would like to know a prefered way to store the Application Certificate.3. In SKDServer.c, line 1487, there is a 16 bit length key.If my understanding is correct, this is a content key and must be set a vaild key at this time.Is my understanding correct?Any advice and suggestions will be greatly appreciated.Thank you.
2
0
1.5k
Sep ’22
Need more detail on loudness box('ludt')
Hi team, In this spec https://developer.apple.com/documentation/http_live_streaming/http_live_streaming_hls_authoring_specification_for_apple_devices 2.19. In fMP4 files, you SHOULD provide loudness information by way of a loudness box ('ludt'). When present, the loudness box takes precedence over any loudness information in the audio stream. Here is a statement on loudness box. But this is not clear, what is the loudness box? How to set this information? Is there an example fmp4 file which can be the reference? Thanks,
1
0
642
Sep ’22
HLS STREAMING TOOL
HI, I am trying to use mediastreamsegmenter and tsrecompressor but seems like I am unable to make udp connection. As I am getting "video encoder pipeline full" error while using tsrecompressor. mediastreamsegmenter -w 1002 -t 4 224.0.0.50:9123 -s 16 -D -T -f /path tsrecomprtsrecompressor -L 224.0.0.50:9123 -h -g -x -a. PLease let me know what else need to done. Thanks
1
0
825
Sep ’22
Illegal MIME type confusion .m3ue for application/x-mpegURL
Hello. I was just wondering why the mediastreamvalidator shows issues for my .m3u8 file by flagging application/x-mpegURL as an illegal MIME type. Based on the documentation here it clearly shows that we should be using this MIME type for .m3u8 https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/DeployingHTTPLiveStreaming/DeployingHTTPLiveStreaming.html Can someone explain to me why this happens and how to work around or fix this?
1
0
3.3k
Sep ’22
Airplay 2 Compatible TVs playback failure for long DVR window Live streams
We deliver 24h DVR window live streams to our customers and having issues AirPlaying those streams to all AirPlay 2 Compatible TV There are 2 cases with different outcomes we found Case 1. start watching a LIVE stream with DVR window more than 14 hours on any iOS device from safari or any App with AVPlayer that supports airplaying Cast to any AirPlay 2 Compatible TV Observe playback fails with an error Domain: Other error Comment: No valid variant enabled Status code: 0 Case 2. start watching a LIVE stream with growing DVR window with initial DVR window less then 13 hours on any iOS device from safari or any App with AVPlayer that supports airplaying Cast to any AirPlay 2 Compatible TV Wait until DVR window grows to 14hours+ Observe airplay disconnected on any AirPlay 2 Compatible TV Observe Safari player saying it is still connected to AirPlay 2 Compatible TV (or crash in case of Mobile app that supports airplaying) Expected behaviour: Stream continues to play on AirPlay 2 Compatible TV regardless of Live stream DVR Window after casting from iOS device Additional info: we use 6 second segments for our live streams issue is not present when airplaying to AppleTV Please let us know how to fix this issue, thanks
0
0
2.0k
Sep ’22
FairPlay streaming issue
I am using a sample test app provided by Apple (HLSCatalog) - https://developer.apple.com/streaming/fps/ that works with FairPlay streaming. I changed the manifest URL and the content keys as well as specifying a different application certificate and loading that certificate to the device. With the same manifest and app cert, the content plays successfully on Safari with FPS. I get this error in the callback that should be returning the SPC data: Error Domain=AVFoundationErrorDomain Code=-11836 "Cannot Open" UserInfo={NSLocalizedFailureReason=This app is not authorized to play this file., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x28146bbd0 {Error Domain=NSOSStatusErrorDomain Code=-42679 "(null)"}
2
1
1.7k
Sep ’22
Is it possible to use FairPlay and HLS with audio only streams?
I've been searching all over to find an answer to this question. I know that FairPlay/HLS supports audio Streams since there's obviously audio in video, but I'm wondering if this is practical? Also is there any way to stream FairPlay DRM encrypted content without HLS? or if I use HLS could I create only a single audio bitrate format in order to save on hosting costs? I work on and Audio Book app that requires DRM for some content. Also any links to documentation, videos, tutorials, blog posts... etc on the topic would be awesome too. Very much appreciate anyone who takes the time to answer this. I wish this was more explicitly talked about on the Apple Dev site, but it seems very geared towards video streaming.
1
0
1.5k
Oct ’22
How does the loudness box('ludt') affect the output sound?
I found this statement here. 2.19. In fMP4 files, you SHOULD provide loudness information by way of a loudness box ('ludt'). When present, the loudness box takes precedence over any loudness information in the audio stream. I'm trying manually adding 'ludt' box to my MP4 file, complying with ISO/IEC 14496-12 and 23003-4, but when I play it, it sounds no difference. How does player deal with this box? Is there anything that will(should) be different if I insert a loudness box into the audio file? Or is there any code/application that can read loudness information of an audio file? or just check if an 'ludt' box is in the correct format?
0
0
552
Oct ’22
Media validator shows issue in bitrate for i-frame playlist
Media validator shows an issue for iframe playlist alone - "Measured peak bitrate compared to master playlist declared value exceeds error tolerance" It shows a difference of 2k%. We are calculating the bitrate for the iframe layer as 15% of the respective video layer. But from the validator it shows a much higher max rate and shows the bitrate as invalid. Can anyone please help us to understand how the validator calculates the bitrate for iframe layer and also how the %Diff value is calculated? Thanks in advance.
1
0
1k
Oct ’22
FairPlay/CENC cbcs mode compliance
We want to protect media content in fmp4 format for HLS. The content are encoded in H.264 and H.265. Apple devices need to be supported. So FairPlay/CENC cbcs mode are key DRM methods. Following questions have emeged once we started the development work:1. For H.264 sample encryption, Apple's FairPlay spec says to leave the first 32 bytes of VCL NALU clear (1 byte for VCL NALU type + following 31 bytes). Then pattern (1:9) encryption starts. But in CENC spec (ISO-23001-7:2016), it requires to leave 1 byte for VCL NALU type + slice header to be clear. Then patern (1:9) encryption starts. Which spec should we follow to encrypt h.264 samples in fmp4 format? We think what Apple's FairPlay spec describes is a better method. But we will comply with the standard regardless;2. In Section 9.5.2.2 of ISO-23001-7:2016, it is mentioned that:"Encrypted slice headers were not prohibited in the first edition of this part of ISO/IEC 23001 butwere prohibited by application specifications. A “SHOULD” requirement to leave slice headers unencrypted for‘avc1’ allows possible legacy content with encrypted slice headers to remain conformant to this new edition.But, new content should not encrypt slice headers or it may not decode properly in secure video decoders."Our video codec type is "avc1". Does that mean we are allowed to enctypt the slice headers of video also?3. Where can we find the guidlines fot H.265 encryption by FairPlay/CENC cbcs mode?Thanks!
3
0
4.3k
Oct ’22
HLS broadcasting is not working on iOS 16.1
Hi everyone, Currently on new iOS version I have an issue with Live streaming. Everything works fine on earlier iOS versions. But after the update player shows infinite loader. I'm using native AVPlayer. And after macOS Ventura update Safari failed to play too. Here is my index file: #EXT-X-TARGETDURATION:2.0 #EXT-X-VERSION:7 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:EVENT #EXT-X-MAP:URI="https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/playerMap.mp4" #EXTINF:0.33333, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/0.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/1.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/2.m4s #EXTINF:1.00000, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/3.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/4.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/5.m4s #EXTINF:1.00000, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/6.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/7.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/8.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/9.m4s #EXTINF:1.00000, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/10.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/11.m4s #EXTINF:1.03500, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/12.m4s And capture settings:         let videoOutputSettings: [String: Any] = [             AVVideoCodecKey: AVVideoCodecType.h264,             AVVideoWidthKey: size.width,             AVVideoHeightKey: size.height,             AVVideoCompressionPropertiesKey: [                 AVVideoAverageBitRateKey: bitRate             ]         ] assetWriter.outputFileTypeProfile = .mpeg4AppleHLS Any suggestion why player cannot load index file?
1
0
2.2k
Oct ’22
AVPlayer currentTime not match the displayed frame
I have a m3u8 file which i want to use with HLS.  My problem is that when i seek many times, the currentTime not match with the displayed frame. I experience that, the more seeking there is more difference. (it's like a constant +offset) Our use case is very timing sensitive, we need to stop the videos at specific positions. For this we use the following code: [_player addBoundaryTimeObserverForTimes:times queue:dispatch_get_main_queue() usingBlock:^{ weakSelf.player.rate = 0.0; // The time is correct here, but the displayed frame is not sync with this time CMTimeShow(weakSelf.player.currentTime); } ] I read that AVURLAssetPreferPreciseDurationAndTimingKey can help, but the currentTime still wrong. NSDictionary<NSString *, id> *options = @{AVURLAssetPreferPreciseDurationAndTimingKey:@YES}; AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:url options:options]; AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:urlAsset]; I also read that there is a problem with the m3u8 itself. (for example wrong GOP size.) What is the reason for the incorrect currentTime, and how can i fix this? ffprobe output: ffprobe https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.m3u8 ffprobe version 5.1 Copyright (c) 2007-2022 the FFmpeg developers built with Apple clang version 13.1.6 (clang-1316.0.21.2.5) configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [hls @ 0x152f04280] Skip ('#EXT-X-INDEPENDENT-SEGMENTS') [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate.m3u8' for reading [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [https @ 0x154045000] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate.m3u8' for reading [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [https @ 0x154045000] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate.m3u8' for reading [hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3') [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate_00001.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate_00002.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate_00001.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate_00002.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate_00001.ts' for reading [hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate_00002.ts' for reading Input #0, hls, from 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.m3u8': Duration: 00:49:43.00, start: 2.033367, bitrate: 0 kb/s Program 0 Metadata: variant_bitrate : 8133826 Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn Metadata: variant_bitrate : 8133826 Program 1 Metadata: variant_bitrate : 18870392 Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn Metadata: variant_bitrate : 18870392 Program 2 Metadata: variant_bitrate : 40776144 Stream #0:2: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 2704x1520 [SAR 1:1 DAR 169:95], 29.97 fps, 29.97 tbr, 90k tbn Metadata: variant_bitrate : 40776144
Replies
1
Boosts
1
Views
1.7k
Activity
Aug ’22
State of FORCED tag in HLS
I cannot seem to get the FORCED tag available in the HLS standard to work correctly. Using the native HLS players in safari, iOS, and tvOS, none of them render a subtitle track defined as #EXT-X-MEDIA:TYPE=SUBTITLES,URI="text/text-open.m3u8",GROUP-ID="text",LANGUAGE="sv",NAME="Svenska",DEFAULT=YES,AUTOSELECT=YES,FORCED=YES or #EXT-X-MEDIA:TYPE=SUBTITLES,URI="text/text-open.m3u8",GROUP-ID="text",LANGUAGE="sv",NAME="Svenska",DEFAULT=NO,AUTOSELECT=YES,FORCED=YES I've seen that Apple TV+ uses forced subtitles with the same settings as the latter example in their playlists, and I assume they work there. Is there something obvious that I'm missing?
Replies
2
Boosts
0
Views
1.9k
Activity
Aug ’22
How to track video dimension changes (videoRect) while in PictureInPicture (PiP)
I'm trying to get the width and height of an HLS AVPlayer in PiP mode. It seems that you would get this in the videoRect attribute of AVPlayerLayer, but it doesn't seem to update correctly in PiP or background modes (playing a video's audio while in lock screen for example doesn't update width and height to 0 as expected). Any ideas on how to get the video resolution/dimension while in PictureInPicture?
Replies
0
Boosts
0
Views
886
Activity
Sep ’22
What does the error mean: CoreMediaErrorDomain -12863
Hi, We have been having issues with playback that result in the playback stopping due to the error code below: **CoreMediaErrorDomain Code=-12863 ** 10:57:05.306794+0200 mediaserverd <<<< FigStreamPlayer >>>> fpfs_StopPlayingItem: [0x104fe78d0|P/XL] <0x1079a9000|I/SFH.01> Stopping, err=Error Domain=CoreMediaErrorDomain Code=-12863{code} However I am unable to find any reference to what this error code means. Could anyone help? Regards
Replies
1
Boosts
1
Views
1.8k
Activity
Sep ’22
What does this actually indicate? CoreMediaErrorDomain" "Internal error: restarting too far ahead
During the course of stream a live HTTP Video Stream intermittently these errors show up in the logs for AVPlayer. What problem are they indicating for AVPlayer and what conditioning of the media stream is needed to resolve these errors?2015/06/16 01:16:35.035 http://127.0.0.1:49815/f1434502503.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.3884s)" lan2015/06/16 01:17:14.014 http://127.0.0.1:49815/f1434502617.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.9554s)" lan2015/06/16 02:01:23.023 http://127.0.0.1:49815/f1434510588.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.1115s)" lan2015/06/16 02:01:31.031 http://127.0.0.1:49815/f1434510612.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 - -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.4285s)" lan2015/06/16 02:47:36.036 http://127.0.0.1:49815/f1434518949.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.5811s)" lan2015/06/16 02:55:34.034 http://127.0.0.1:49815/f1434520383.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.7908s)" lan2015/06/16 03:10:49.049 http://127.0.0.1:49815/f1434523140.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.7415s)" lan2015/06/16 03:41:46.046 http://127.0.0.1:49815/f1434528732.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.5722s)" lan2015/06/16 07:13:08.008 http://127.0.0.1:49815/f1434566955.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.2835s)" lan2015/06/16 07:13:10.010 http://127.0.0.1:49815/f1434566964.ts 6376DBAA-A074-4F6A-B240-5CD1A838CE88 127.0.0.1 -12645 "CoreMediaErrorDomain" "Internal error: restarting too far ahead (-1.1441s)" lan2
Replies
9
Boosts
0
Views
13k
Activity
Sep ’22
Questions about FairPlay(kTestAppCert, content key)
Hi,I have three questions about FairPlay.1. In FairPlayStreaming_PG.pdf on page 27, the document says that"In the code sample shown in the iOS FPS Client sample (included in the SDK),kTestAppCert contains the Application Certificate.".So I searched kTestAppCert, but kTestAppCert did not show up in the iOS FPS Client sample.Where does kTestAppCert appears and what is it?2. In FairPlayStreaming_PG.pdf page 26, the document says that"Do not hard-code the Application Certificate in the playback application".I would like to know a prefered way to store the Application Certificate.3. In SKDServer.c, line 1487, there is a 16 bit length key.If my understanding is correct, this is a content key and must be set a vaild key at this time.Is my understanding correct?Any advice and suggestions will be greatly appreciated.Thank you.
Replies
2
Boosts
0
Views
1.5k
Activity
Sep ’22
Need more detail on loudness box('ludt')
Hi team, In this spec https://developer.apple.com/documentation/http_live_streaming/http_live_streaming_hls_authoring_specification_for_apple_devices 2.19. In fMP4 files, you SHOULD provide loudness information by way of a loudness box ('ludt'). When present, the loudness box takes precedence over any loudness information in the audio stream. Here is a statement on loudness box. But this is not clear, what is the loudness box? How to set this information? Is there an example fmp4 file which can be the reference? Thanks,
Replies
1
Boosts
0
Views
642
Activity
Sep ’22
HLS STREAMING TOOL
HI, I am trying to use mediastreamsegmenter and tsrecompressor but seems like I am unable to make udp connection. As I am getting "video encoder pipeline full" error while using tsrecompressor. mediastreamsegmenter -w 1002 -t 4 224.0.0.50:9123 -s 16 -D -T -f /path tsrecomprtsrecompressor -L 224.0.0.50:9123 -h -g -x -a. PLease let me know what else need to done. Thanks
Replies
1
Boosts
0
Views
825
Activity
Sep ’22
Illegal MIME type confusion .m3ue for application/x-mpegURL
Hello. I was just wondering why the mediastreamvalidator shows issues for my .m3u8 file by flagging application/x-mpegURL as an illegal MIME type. Based on the documentation here it clearly shows that we should be using this MIME type for .m3u8 https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/DeployingHTTPLiveStreaming/DeployingHTTPLiveStreaming.html Can someone explain to me why this happens and how to work around or fix this?
Replies
1
Boosts
0
Views
3.3k
Activity
Sep ’22
[FairPlay Streaming] - Dask in FPS SDK can be used to test stream or not?
The dask hardcoded and provided by Apple can be used to test vectors (parse spc and validate ckc). But when I test with client playback software in Safari, this Dask can not be used to decrypt Skr1 payload of the spc. How can I obtain a valid Dask to test secure delivery content between Key Server and playback software?
Replies
1
Boosts
0
Views
952
Activity
Sep ’22
Airplay 2 Compatible TVs playback failure for long DVR window Live streams
We deliver 24h DVR window live streams to our customers and having issues AirPlaying those streams to all AirPlay 2 Compatible TV There are 2 cases with different outcomes we found Case 1. start watching a LIVE stream with DVR window more than 14 hours on any iOS device from safari or any App with AVPlayer that supports airplaying Cast to any AirPlay 2 Compatible TV Observe playback fails with an error Domain: Other error Comment: No valid variant enabled Status code: 0 Case 2. start watching a LIVE stream with growing DVR window with initial DVR window less then 13 hours on any iOS device from safari or any App with AVPlayer that supports airplaying Cast to any AirPlay 2 Compatible TV Wait until DVR window grows to 14hours+ Observe airplay disconnected on any AirPlay 2 Compatible TV Observe Safari player saying it is still connected to AirPlay 2 Compatible TV (or crash in case of Mobile app that supports airplaying) Expected behaviour: Stream continues to play on AirPlay 2 Compatible TV regardless of Live stream DVR Window after casting from iOS device Additional info: we use 6 second segments for our live streams issue is not present when airplaying to AppleTV Please let us know how to fix this issue, thanks
Replies
0
Boosts
0
Views
2.0k
Activity
Sep ’22
FairPlay streaming issue
I am using a sample test app provided by Apple (HLSCatalog) - https://developer.apple.com/streaming/fps/ that works with FairPlay streaming. I changed the manifest URL and the content keys as well as specifying a different application certificate and loading that certificate to the device. With the same manifest and app cert, the content plays successfully on Safari with FPS. I get this error in the callback that should be returning the SPC data: Error Domain=AVFoundationErrorDomain Code=-11836 "Cannot Open" UserInfo={NSLocalizedFailureReason=This app is not authorized to play this file., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x28146bbd0 {Error Domain=NSOSStatusErrorDomain Code=-42679 "(null)"}
Replies
2
Boosts
1
Views
1.7k
Activity
Sep ’22
Is it possible to use FairPlay and HLS with audio only streams?
I've been searching all over to find an answer to this question. I know that FairPlay/HLS supports audio Streams since there's obviously audio in video, but I'm wondering if this is practical? Also is there any way to stream FairPlay DRM encrypted content without HLS? or if I use HLS could I create only a single audio bitrate format in order to save on hosting costs? I work on and Audio Book app that requires DRM for some content. Also any links to documentation, videos, tutorials, blog posts... etc on the topic would be awesome too. Very much appreciate anyone who takes the time to answer this. I wish this was more explicitly talked about on the Apple Dev site, but it seems very geared towards video streaming.
Replies
1
Boosts
0
Views
1.5k
Activity
Oct ’22
How does the loudness box('ludt') affect the output sound?
I found this statement here. 2.19. In fMP4 files, you SHOULD provide loudness information by way of a loudness box ('ludt'). When present, the loudness box takes precedence over any loudness information in the audio stream. I'm trying manually adding 'ludt' box to my MP4 file, complying with ISO/IEC 14496-12 and 23003-4, but when I play it, it sounds no difference. How does player deal with this box? Is there anything that will(should) be different if I insert a loudness box into the audio file? Or is there any code/application that can read loudness information of an audio file? or just check if an 'ludt' box is in the correct format?
Replies
0
Boosts
0
Views
552
Activity
Oct ’22
Media validator shows issue in bitrate for i-frame playlist
Media validator shows an issue for iframe playlist alone - "Measured peak bitrate compared to master playlist declared value exceeds error tolerance" It shows a difference of 2k%. We are calculating the bitrate for the iframe layer as 15% of the respective video layer. But from the validator it shows a much higher max rate and shows the bitrate as invalid. Can anyone please help us to understand how the validator calculates the bitrate for iframe layer and also how the %Diff value is calculated? Thanks in advance.
Replies
1
Boosts
0
Views
1k
Activity
Oct ’22
FairPlay/CENC cbcs mode compliance
We want to protect media content in fmp4 format for HLS. The content are encoded in H.264 and H.265. Apple devices need to be supported. So FairPlay/CENC cbcs mode are key DRM methods. Following questions have emeged once we started the development work:1. For H.264 sample encryption, Apple's FairPlay spec says to leave the first 32 bytes of VCL NALU clear (1 byte for VCL NALU type + following 31 bytes). Then pattern (1:9) encryption starts. But in CENC spec (ISO-23001-7:2016), it requires to leave 1 byte for VCL NALU type + slice header to be clear. Then patern (1:9) encryption starts. Which spec should we follow to encrypt h.264 samples in fmp4 format? We think what Apple's FairPlay spec describes is a better method. But we will comply with the standard regardless;2. In Section 9.5.2.2 of ISO-23001-7:2016, it is mentioned that:"Encrypted slice headers were not prohibited in the first edition of this part of ISO/IEC 23001 butwere prohibited by application specifications. A “SHOULD” requirement to leave slice headers unencrypted for‘avc1’ allows possible legacy content with encrypted slice headers to remain conformant to this new edition.But, new content should not encrypt slice headers or it may not decode properly in secure video decoders."Our video codec type is "avc1". Does that mean we are allowed to enctypt the slice headers of video also?3. Where can we find the guidlines fot H.265 encryption by FairPlay/CENC cbcs mode?Thanks!
Replies
3
Boosts
0
Views
4.3k
Activity
Oct ’22
HLS broadcasting is not working on iOS 16.1
Hi everyone, Currently on new iOS version I have an issue with Live streaming. Everything works fine on earlier iOS versions. But after the update player shows infinite loader. I'm using native AVPlayer. And after macOS Ventura update Safari failed to play too. Here is my index file: #EXT-X-TARGETDURATION:2.0 #EXT-X-VERSION:7 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:EVENT #EXT-X-MAP:URI="https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/playerMap.mp4" #EXTINF:0.33333, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/0.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/1.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/2.m4s #EXTINF:1.00000, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/3.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/4.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/5.m4s #EXTINF:1.00000, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/6.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/7.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/8.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/9.m4s #EXTINF:1.00000, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/10.m4s #EXTINF:1.00167, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/11.m4s #EXTINF:1.03500, https://byn-frankfurt164028-dev.s3.eu-central-1.amazonaws.com/public/AF12A307-654B-484C-A93E-FA97EF608BEE/10/12.m4s And capture settings:         let videoOutputSettings: [String: Any] = [             AVVideoCodecKey: AVVideoCodecType.h264,             AVVideoWidthKey: size.width,             AVVideoHeightKey: size.height,             AVVideoCompressionPropertiesKey: [                 AVVideoAverageBitRateKey: bitRate             ]         ] assetWriter.outputFileTypeProfile = .mpeg4AppleHLS Any suggestion why player cannot load index file?
Replies
1
Boosts
0
Views
2.2k
Activity
Oct ’22