[{"data":1,"prerenderedAt":170},["ShallowReactive",2],{"blog-post-ffmpeg-rotate-video-vertical-axis-3d-trapezoid":3,"recent-posts":106},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":11,"slugs":12,"linked_documents":14,"lang":15,"alternate_languages":16,"data":17},"auJXuhEAACsAw-p2","ffmpeg-rotate-video-vertical-axis-3d-trapezoid",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=avzZABIAACgAeKzX&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22auJXuhEAACsAw-p2%22%29+%5D%5D",[],"2026-10-28T20:20:13+0000","2026-10-28T20:20:36+0000",[13],"ffmpeg-how-to-rotate-video-on-vertical-axis-to-3d-trapezoid-look",[],"en-us",[],{"title":18,"date":24,"description":25,"image":30,"content":40},[19],{"type":20,"text":21,"spans":22,"direction":23},"heading1","FFmpeg: How to Rotate Video on Vertical Axis to 3D Trapezoid Look",[],"ltr","2026-10-26",[26],{"type":27,"text":28,"spans":29,"direction":23},"heading2","Rotate a video on its vertical axis to create a stylized 3D trapezoid effect",[],{"dimensions":31,"alt":6,"copyright":6,"url":34,"id":35,"edit":36},{"width":32,"height":33},1376,768,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FQuIxg7vsZ1G3rRhw_Rotatevideofora3dtrapezoidlook.jpeg?auto=format,compress","QuIxg7vsZ1G3rRhw",{"x":37,"y":37,"zoom":38,"background":39},0,1,"transparent",[41,45,49,52,55,59,62,65,68,71,74,77,93],{"type":42,"text":43,"spans":44,"direction":23},"paragraph","To follow along, you just need FFmpeg installed on your system, access to a terminal, and a video file named \u003Ccode>input.mp4\u003C\u002Fcode> in your current folder.",[],{"type":46,"text":47,"spans":48,"direction":23},"heading3","1. Core Trapezoid Effect",[],{"type":42,"text":50,"spans":51,"direction":23},"First, let's create the core trapezoid effect. This applies a perspective filter that skews the vertical edges and draws a white border around your video.",[],{"type":42,"text":53,"spans":54,"direction":23},"Open your terminal and run this command:",[],{"type":56,"text":57,"spans":58,"direction":23},"preformatted","ffmpeg -i input.mp4 -vf \"drawbox=t=1:c=white,perspective=x0=0:y0=250:x1=W:y1=0:x2=0:y2=H:x3=W:y3=H-250:sense=destination\" output.mp4",[],{"type":46,"text":60,"spans":61,"direction":23},"2. Asymmetric Version",[],{"type":42,"text":63,"spans":64,"direction":23},"If you want a more realistic 3D appearance rather than a flat keystone, you can use an asymmetric version that calculates frame progression.",[],{"type":42,"text":66,"spans":67,"direction":23},"First, count the total frames in your video with \u003Ccode>ffprobe\u003C\u002Fcode> and set a fallback value by running these lines:",[],{"type":56,"text":69,"spans":70,"direction":23},"F=$(ffprobe -v error -select_streams v:0 -count_frames -show_entries stream=nb_read_frames -of csv=p=0 input.mp4)\nF=${F:-1000}\nffmpeg -i input.mp4 -vf \"perspective=eval=frame:x0=0:y0='400*max(0,1-in\u002F$F)':x1=W:y1='-200*max(0,1-in\u002F$F)':x2=0:y2=H:x3=W:y3=H:sense=destination\" -c:a copy output_3d_trapezoid.mp4",[],{"type":42,"text":72,"spans":73,"direction":23},"Depending on your computer's speed and the length of your clip, rendering may take a minute or two, so let the terminal complete the export.",[],{"type":42,"text":75,"spans":76,"direction":23},"Once processing completes, do a quick test by playing \u003Ccode>output_3d_trapezoid.mp4\u003C\u002Fcode> in your favorite video viewer or by running \u003Ccode>ffplay output_3d_trapezoid.mp4\u003C\u002Fcode> to check the motion and perspective shift.",[],{"type":78,"oembed":79},"embed",{"embed_url":80,"type":81,"version":82,"title":21,"author_name":83,"author_url":84,"provider_name":85,"provider_url":86,"thumbnail_url":87,"thumbnail_width":88,"thumbnail_height":89,"html":90,"height":91,"width":92},"https:\u002F\u002Fyoutu.be\u002FbWV009bOesA","video","1.0","markster","https:\u002F\u002Fwww.youtube.com\u002F@markster1904","YouTube","https:\u002F\u002Fwww.youtube.com\u002F","https:\u002F\u002Fi.ytimg.com\u002Fvi\u002FbWV009bOesA\u002Fhqdefault.jpg",480,360,"\u003Ciframe width=\"200\" height=\"113\" src=\"https:\u002F\u002Fwww.youtube.com\u002Fembed\u002FbWV009bOesA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen title=\"FFmpeg: How to Rotate Video on Vertical Axis to 3D Trapezoid Look\">\u003C\u002Fiframe>",113,200,{"type":42,"text":94,"spans":95,"direction":23},"You can fine-tune the severity of the 3D slant by adjusting the coordinate offsets like 250 or 400 inside the filter expressions.",[96,100,102,105],{"start":97,"end":98,"type":99},88,91,"em",{"start":97,"end":98,"type":101},"strong",{"start":103,"end":104,"type":99},95,98,{"start":103,"end":104,"type":101},{"results":107,"page":38,"results_per_page":168,"results_size":168,"total_results_size":169,"total_pages":38},[108,130,149],{"id":109,"uid":110,"url":6,"type":7,"href":111,"tags":112,"first_publication_date":113,"last_publication_date":113,"slugs":114,"linked_documents":116,"lang":15,"alternate_languages":117,"data":118},"avg1XREAACsAj4eS","sox-change-bit-depth","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=avzZABIAACgAeKzX&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avg1XREAACsAj4eS%22%29+%5D%5D",[],"2026-11-17T22:45:19+0000",[115],"sox-how-to-change-bit-depth",[],[],{"image":119,"title":127},{"dimensions":120,"alt":123,"copyright":6,"url":124,"id":125,"edit":126},{"width":121,"height":122},1280,720,"SoX: How to Change Bit Depth","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FGm9ND5avh6VMrQoP_sox-change-bit-depth.png?auto=format,compress","Gm9ND5avh6VMrQoP",{"x":37,"y":37,"zoom":38,"background":39},[128],{"type":20,"text":123,"spans":129,"direction":23},[],{"id":131,"uid":132,"url":6,"type":7,"href":133,"tags":134,"first_publication_date":113,"last_publication_date":113,"slugs":135,"linked_documents":137,"lang":15,"alternate_languages":138,"data":139},"avg1XxEAACcAj4eg","sox-reverse-audio","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=avzZABIAACgAeKzX&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avg1XxEAACcAj4eg%22%29+%5D%5D",[],[136],"sox-how-to-reverse-audio",[],[],{"image":140,"title":146},{"dimensions":141,"alt":142,"copyright":6,"url":143,"id":144,"edit":145},{"width":121,"height":122},"SoX: How to Reverse Audio","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F6yWWTbolMOE4a3JL_sox-reverse-audio.png?auto=format,compress","6yWWTbolMOE4a3JL",{"x":37,"y":37,"zoom":38,"background":39},[147],{"type":20,"text":142,"spans":148,"direction":23},[],{"id":150,"uid":151,"url":6,"type":7,"href":152,"tags":153,"first_publication_date":113,"last_publication_date":113,"slugs":154,"linked_documents":156,"lang":15,"alternate_languages":157,"data":158},"avg1XBEAACwAj4eL","sox-convert-stereo-to-mono","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=avzZABIAACgAeKzX&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avg1XBEAACwAj4eL%22%29+%5D%5D",[],[155],"sox-how-to-convert-stereo-to-mono",[],[],{"image":159,"title":165},{"dimensions":160,"alt":161,"copyright":6,"url":162,"id":163,"edit":164},{"width":121,"height":122},"SoX: How to Convert Stereo to Mono","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FPgqFJaqMdDkYQkE6_sox-convert-stereo-to-mono.png?auto=format,compress","PgqFJaqMdDkYQkE6",{"x":37,"y":37,"zoom":38,"background":39},[166],{"type":20,"text":161,"spans":167,"direction":23},[],3,64,1794955544653]