{"id":14,"date":"2024-11-02T19:00:48","date_gmt":"2024-11-02T19:00:48","guid":{"rendered":"https:\/\/www.visitnyc.store\/blog\/?p=14"},"modified":"2024-11-13T19:47:02","modified_gmt":"2024-11-13T19:47:02","slug":"ffmpeg-vr-180-to-flat-video-for-visionos-app-store-preview","status":"publish","type":"post","link":"https:\/\/www.visitnyc.store\/blog\/ffmpeg-vr-180-to-flat-video-for-visionos-app-store-preview\/","title":{"rendered":"ffmpeg VR 180 to flat video for visionOS App Store preview"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The App Store preview size is 3840&#215;2160 and I wanted to create an asset from the published file that is distributed through the app. That input file is a spatial MOV with left and right and the image is in the VR180 half equirectangular format. It seems with this you can go from any format to any format, so in this case I want to go from 3d image format to 2d image format<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Found these links:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ffmpeg.org\/ffmpeg-filters.html#v360\">https:\/\/ffmpeg.org\/ffmpeg-filters.html#v360<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/paulpaul999\/vr-video-notes\/blob\/main\/vr-to-flat\/README.md\">https:\/\/github.com\/paulpaul999\/vr-video-notes\/blob\/main\/vr-to-flat\/README.md<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So there is a ffmpeg filter called v360 that does this and here is the command I came to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg \\\n    -t 3 \\\n    -I \"file-input.mov\" \\\n    -y \\\n    -filter:v \"v360=input=hequirect:output=flat:in_stereo=3d:out_stereo=2d:d_fov=90:w=3840:h=2160:pitch=0\" \\\n    -map 0 -c copy -c:v libx264 -crf 18 -pix_fmt yuv420p \"file-output.mp4\"<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>-t 3 for limiting the file output to 3 seconds<\/li>\n\n\n\n<li>-I input file<\/li>\n\n\n\n<li>-y to say yes to overwrite file<\/li>\n\n\n\n<li>-filter:v\n<ul class=\"wp-block-list\">\n<li>v360 has a bunch of options, but here I&#8217;m saying input is hequirect<\/li>\n\n\n\n<li>and in stereo 3d format<\/li>\n\n\n\n<li>and then output is 2d<\/li>\n\n\n\n<li>FOV is 90 because this is a flat video<\/li>\n\n\n\n<li>pitch is 0<\/li>\n\n\n\n<li>and width and height are set to the resolution I want<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>other commands for codec and whatnot and mp4 out<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I take my output files and edit in Premiere (sequencing them)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">export from Premiere with default settings and uploading the App Store Connect.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">are we a codec? does taste have a codec?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">no re-encoding allowed! vcodec copy only!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">do you know this website is just ffmpeg behind nginx?<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Interview with FFMPEG enthusiast\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/9kaIXkImCAM?start=21&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">These original files are so big I can never have them play on my Macs at the full 16k resolution. Apple Vision Pro is the only device that I own that can deal with that file size and play the video at its resolution how cool is that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The App Store preview size is 3840&#215;2160 and I wanted to create an asset from the published file that is distributed through the app. That input file is a spatial MOV with left and right and the image is in the VR180 half equirectangular format. It seems with this you can go from any format [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":6,"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions\/154"}],"wp:attachment":[{"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.visitnyc.store\/blog\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}