{"id":814,"date":"2021-04-12T18:07:42","date_gmt":"2021-04-12T17:07:42","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=814"},"modified":"2021-04-12T08:19:27","modified_gmt":"2021-04-12T07:19:27","slug":"ffmpeg-rotating-video-transpose-vs-rotate","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/ffmpeg-rotating-video-transpose-vs-rotate\/","title":{"rendered":"FFMPEG Rotating Video &#8211; Transpose vs Rotate"},"content":{"rendered":"<p>FFMpeg can be used to rotate a video or change the video orientation. There are two ways to do that &#8211; Transpose and Rotate.<\/p>\n<p>But there is a difference &#8211; with Transpose the whole video gets rotated (as is expected to happen) but with Rotate the video gets cropped to fit the existing height of the video and on the sides black border will appear.<\/p>\n<pre class='wp-code-highlight prettyprint'>ffmpeg -y -i INPUT.mp4 -c:v libx264 -crf 23 -acodec copy <strong><span style=\"color: #0000ff;\">-vf \"transpose=1\"<\/span><\/strong> -metadata:s:v rotate=0 -movflags +faststart OUTPUT.mp4\r\n\r\n<strong><span style=\"color: #0000ff;\">transpose=1<\/span><\/strong> will rotate the video clock-wise by 90 degrees.<\/pre>\n<pre class='wp-code-highlight prettyprint'>ffmpeg -y -i INPUT.mp4 -c:v libx264 -crf 23 -acodec copy <span style=\"color: #0000ff;\">-vf \"rotate=PI\/2\"<\/span> -metadata:s:v rotate=0 -movflags +faststart OUTPUT.mp4\r\n\r\n<span style=\"color: #0000ff;\">rotate=PI\/2<\/span> will also rotate the video clock-wise by 90 degrees but the resultant video will get cropped.<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>FFMpeg can be used to rotate a video or change the video orientation. There are two ways to do that &#8211; Transpose and Rotate. But there is a difference &#8211; with Transpose the whole video gets rotated (as is expected to happen) but with Rotate the video gets cropped to fit the existing height of&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/ffmpeg-rotating-video-transpose-vs-rotate\/\">Continue reading <span class=\"screen-reader-text\">FFMPEG Rotating Video &#8211; Transpose vs Rotate<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,3],"tags":[280,283,282,284,281],"class_list":["post-814","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","category-php","tag-ffmpeg","tag-ffmpeg-rotate","tag-ffmpeg-transpose","tag-php-ffmpeg","tag-php-video-rotate","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=814"}],"version-history":[{"count":1,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/814\/revisions"}],"predecessor-version":[{"id":815,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/814\/revisions\/815"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}