{"id":1149,"date":"2014-01-04T10:14:44","date_gmt":"2014-01-03T22:14:44","guid":{"rendered":"http:\/\/p-s.co.nz\/wordpress\/?p=1149"},"modified":"2016-09-19T14:30:11","modified_gmt":"2016-09-19T02:30:11","slug":"rotate-video-and-cope-with-frame-rate-problem","status":"publish","type":"post","link":"http:\/\/p-s.co.nz\/wordpress\/rotate-video-and-cope-with-frame-rate-problem\/","title":{"rendered":"Rotate video (and cope with frame rate problem)"},"content":{"rendered":"<p>The problem &#8211; I had taken a video on a smart phone upside down and needed to rotate it (Note &#8211; rotating is not the same as flipping). Here is the successful command I used on Ubuntu:<\/p>\n<p><code>avconv -i \"my_input_video.mp4\" -r 25 -vf transpose=1,transpose=1 my_output_video.mp4<\/code><\/p>\n<p>Note &#8211; I needed to rotate it so chaining two 90 degree transpose commands (transpose=1 is a single 90 degree transposition) worked (see <a href=\"http:\/\/askubuntu.com\/questions\/269429\/how-can-i-rotate-video-by-180-degrees-with-avconv\" target=\"_blank\">How can I rotate video by 180 degrees with avconv<\/a>).<\/p>\n<p>Note the -r 25. I don&#8217;t pretend to understand all the options of ffmpeg\/avconv but the -r 25 forced the conversion to use a manageable number of frames. Without it, converting one particular video was failing, thrashing the CPU, and taking forever. There was a message in the ffmpeg\/avconv output about MB rate > level limit. Another video worked fine without -r 25 but if you have the same problem with MB rate give -r 25 a try. Or better yet, learn more about what you&#8217;re doing ;-). I didn&#8217;t have the time or inclination so tried to do the least I could to get a good result.<\/p>\n<p>Update &#8211; needed to alter aspect ratio as per:<\/p>\n<p><code>avconv -i \"my_image.MOD\" <strong>-aspect 0.487<\/strong> -r 25 -vf transpose=1,transpose=1,transpose=1 -strict -2 \"my_image.mp4\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The problem &#8211; I had taken a video on a smart phone upside down and needed to rotate it (Note &#8211; rotating is not the same as flipping). Here is the successful command I used on Ubuntu: avconv -i &#8220;my_input_video.mp4&#8221; &hellip; <a href=\"http:\/\/p-s.co.nz\/wordpress\/rotate-video-and-cope-with-frame-rate-problem\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[13],"tags":[],"class_list":["post-1149","post","type-post","status-publish","format-standard","hentry","category-audiovisual"],"_links":{"self":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1149"}],"collection":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/comments?post=1149"}],"version-history":[{"count":5,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1149\/revisions"}],"predecessor-version":[{"id":1400,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1149\/revisions\/1400"}],"wp:attachment":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/media?parent=1149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/categories?post=1149"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/tags?post=1149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}