虽然这个发布有一段时间了,但似乎苹果并不成熟,连一个播放 3D电影的软件的 APP 都还没有。
感谢这个作者提供的工具:
https://blog.mikeswanson.com/spatial
我尝试把一个 3D的 MKV 的格式转为 VisionPro 可以观看的格式时,遇到了麻烦了,这个命令似乎并不支持 MKV 的格式。
一直提示:
(base) jeffcheng@JEFFs-MacBook-Air Avatar.2009.EXTENDED.1080p.3D.BluRay.Half-SBS.x264.DTS-HD.MA.5.1-RARBG % spatial make -i "Avatar.2009.EXTENDED.1080p.3D.BluRay.Half-SBS.x264.DTS-HD.MA.5.1-RARBG.mkv" -f hsbs --hadjust 1.0 --t 10 -o 1.mkv Warning: for video to show as 'Spatial' in Apple Photos, specify at least 'hfov' and either 'cdist' or 'hadjust'. Input: Avatar.2009.EXTENDED.1080p.3D.BluRay.Half-SBS.x264.DTS-HD.MA.5.1-RARBG.mkv (halfSideBySide) Output: 1.mkv (spatial/mv-hevc) Specified time range starts after video ends.
尝试搜索 “
Specified time range starts after video ends.
”无果。
所以我先使用 ffmpeg 把这个 MKV 转为普通的 mov 文件。
ffmpeg -i Avatar.2009.EXTENDED.1080p.3D.BluRay.Half-SBS.x264.DTS-HD.MA.5.1-RARBG.mkv -c:v copy -c:a aac -ac 2 -t 100 2.mp4
再使用以下这个命令:
spatial make -i 2.mp4 -f hsbs -o 3.mov --cdist 19.24 --hfov 63.4 --hadjust 0.02 --primary right --projection rect
转出来是有效果了。
再分别看看这些参数是什么意思:
spatial make -h OVERVIEW: Make spatial video from formatted video. Makes a MV-HEVC spatial video from a stereo-formatted input video or two separate videos (first for the left eye and second for the right eye). For video to show as 'Spatial' in Apple Photos, specify at least 'hfov' and either/both 'cdist' or 'hadjust'. NOTE: This command does not work on Intel machines. USAGE: spatial make [<options>] --output <output> OPTIONS: -i, --input <input> Input video files. -o, --output <output> Output video file. -f, --format <format> Stereo format of input video. Not necessary if two input videos. (values: hsbs, sbs, hou, ou)左右半宽,左右全宽,上下半,上下全 -r, --reverse Reverse eyes during encode (not just metadata). -b, --bitrate <bitrate> Bitrate for output video (examples: 750K, 20M, 20000000). --scale <scale> Scale the output video (examples: w=200:h=100, 200:100, 200x100, 200:-1). -1 maintains original aspect ratio. -q, --quality <quality> Video quality (0.0 to 1.0). NOTE: Values above 0.95 can be unstable. --ss <ss> Start time in seconds or hh:mm:ss[.xxx] format. Relative to the start of the file. --t <t> Duration in seconds or hh:mm:ss[.xxx] format. Relative to start time. --to <to> End time in seconds or hh:mm:ss[.xxx] format. Relative to the start of the file. -n, --no-audio Don't export audio track. --hero <hero> Hero eye for spatial-aware players. (values: left, right) --primary <primary> Primary eye for standard 2D playback. (values: left, right) --cdist <cdist> Distance between camera centers (in millimeters).摄像机中心之间的距离(以毫米为单位)。 --hfov <hfov> Horizontal field-of-view (in degrees).水平视场角(以度为单位)。 --hadjust <hadjust> Horizontal disparity adjustment (-1.0 to 1.0).水平视差调整(-1.0 到 1.0)。 --projection <projection> Projection kind. (values: rect, equirect, halfEquirect, fisheye) -y, --overwrite Overwrite output file. --maxkey <maxkey> Maximum seconds between keyframes (default: 2.0). --use-gpu Use GPU for image processing. --args <args> Arguments file. --version Show the version. -h, --help Show help information.
接下来要做的就是要研究一下 HLS 如何串流。