Okay after debugging with carefulness, I found that the connection.preferredVideoStabilizationMode must be set to .cinematicExtendedEnhanced to enable isSpatialVideoCaptureSupported to be true. Apple's engineers should have mentioned the cascade relation here!!!
guard let connection = output.connection(with: .video) else { return }
guard connection.isVideoStabilizationSupported else { return }
// The key setting to enable `isSpatialVideoCaptureSupported`
connection.preferredVideoStabilizationMode = .cinematicExtendedEnhanced
Post
Replies
Boosts
Views
Activity
Apple engineer mentioned in this video Deliver video content for spatial experiences where it says
The HLS multivariant playlist format should be:
EXT-X-VERSION is updated to version 12
New REQ-VIDEO-LAYOUT attribute
For EXT-X-STREAM-INF tag for video content
Video Channel Specifier can have values CH-STEREO or CH-MONO or a mix
Firstly I tried using the simple command to parse a mv-hevc spatial video recored by a vision pro, but it ended up with an error "Unsupported media type 'hvc1' in track 0"
Then I tried @altonelli 's answer, i.e. added a param "-iso-fragmented", it worked.
mediafilesegmenter -iso-fragmented -t 4 -f output/sp_video-1-ip ./videos/sp_video-1-vp.MOV
Feb 22 2024 19:38:59.996: ISO fragmented mode, forcing segments to start with I-Frame
Feb 22 2024 19:38:59.997: Processing file /Users/sizhe/workspace/projects/avp-spatial-video/videos/sp_video-1-vp.MOV
Feb 22 2024 19:39:00.020: Finalized 2300 bytes in 0: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence0.mp4
Feb 22 2024 19:39:00.027: Finalized 14560188 bytes in 1: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence1.m4s
Feb 22 2024 19:39:00.027: Wrote full file size 14560188 to /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence1.m4s
Feb 22 2024 19:39:00.027: segment bitrate 27.96 Mbits/sec is new max
Feb 22 2024 19:39:00.053: Finalized 14689506 bytes in 2: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence2.m4s
Feb 22 2024 19:39:00.053: Wrote full file size 14689506 to /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence2.m4s
Feb 22 2024 19:39:00.078: Finalized 15339992 bytes in 3: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence3.m4s
Feb 22 2024 19:39:00.078: Wrote full file size 15339992 to /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence3.m4s
Feb 22 2024 19:39:00.078: segment bitrate 28.76 Mbits/sec is new max
Feb 22 2024 19:39:00.103: Finalized 15668274 bytes in 4: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence4.m4s
Feb 22 2024 19:39:00.103: Wrote full file size 15668274 to /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence4.m4s
Feb 22 2024 19:39:00.103: segment bitrate 29.38 Mbits/sec is new max
Feb 22 2024 19:39:00.128: Finalized 14482468 bytes in 5: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence5.m4s
Feb 22 2024 19:39:00.128: Wrote full file size 14482468 to /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence5.m4s
Feb 22 2024 19:39:00.138: Finalized 4188748 bytes in 6: /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence6.m4s
Feb 22 2024 19:39:00.138: Wrote full file size 4188748 to /Users/sizhe/workspace/projects/avp-spatial-video/output/sp_video-1-ip/fileSequence6.m4s
Feb 22 2024 19:39:00.139: average bit rate is 28.19 Mbits/sec - max file bit rate is 29.38 Mbits/sec
But when I looked into the m3u8 file, there is no REQ-VIDEO-LAYOUT attribute, neither the EXT-X-VERSION is 12 but 7. Any idea why?
#EXTM3U
#EXT-X-TARGETDURATION:4
#EXT-X-VERSION:7
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="fileSequence0.mp4"
#EXTINF:4.16652,
#EXT-X-BITRATE:27957
fileSequence1.m4s
#EXTINF:4.26653,
#EXT-X-BITRATE:27544
fileSequence2.m4s
#EXTINF:4.26652,
#EXT-X-BITRATE:28763
fileSequence3.m4s
#EXTINF:4.26652,
#EXT-X-BITRATE:29379
fileSequence4.m4s
#EXTINF:4.26652,
#EXT-X-BITRATE:27156
fileSequence5.m4s
#EXTINF:1.16663,
#EXT-X-BITRATE:28724
fileSequence6.m4s
#EXT-X-ENDLIST