How can I rotate a video?
Is there a way to change the rotation angle of a video file?
I have a couple of videos in the wrong direction so all I wanted is to correct it.
video video-editor
add a comment |
Is there a way to change the rotation angle of a video file?
I have a couple of videos in the wrong direction so all I wanted is to correct it.
video video-editor
add a comment |
Is there a way to change the rotation angle of a video file?
I have a couple of videos in the wrong direction so all I wanted is to correct it.
video video-editor
Is there a way to change the rotation angle of a video file?
I have a couple of videos in the wrong direction so all I wanted is to correct it.
video video-editor
video video-editor
edited Nov 29 '11 at 17:20
Michael K
10.2k11521
10.2k11521
asked Nov 29 '11 at 11:19
maniat1k
5,099103149
5,099103149
add a comment |
add a comment |
7 Answers
7
active
oldest
votes
If you are asking for rotate a video 90º or 180º, you should use avidemux.
sudo apt-get update
sudo apt-get install avidemux
- open the video in avidemux
- select a new video format and don't choose copy
- Under "Video" click on Filters
- Choose "Transform" and scroll down until you see rotate.
- Add it
- select the right angle
- select preview
- ok.
- Go to file
- save
- save video
And you're done.
4
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
1
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
3
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
2
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
9
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
|
show 4 more comments
You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):
Rotate 90 clockwise:
ffmpeg -i in.mov -vf "transpose=1" out.mov
For the transpose parameter you can pass:
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
And to flip it horizontally (ffmpeg documentation):
Flip the input video horizontally.
For example to horizontally flip the video in input with `ffmpeg':
ffmpeg -i in.avi -vf "hflip" out.avi
Nota bene
Older versions of Ubuntu supplied avconv
instead of ffmpeg
. In this case just change ffmpeg
to avconv
:
avconv -i in.mov -vf "transpose=1" out.mov
4
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.
– evilsoup
Sep 16 '13 at 9:14
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
2
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
1
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
1
To add to your answer (maybe some people might find this useful): To rotate an x264 video withffmpeg
I had to specify the codec / library explicitly:ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it saysUnknown encoder libx264
, you need to install the appropriatelibavcodec-extra
package.
– balu
Nov 5 '15 at 14:00
|
show 2 more comments
Do you mean rotation on playback or converting it to a rotated version?
As a commandline-user I normally use mplayer:
Playback:
mplayer -vf rotate=1 videofile.mp4
(rotate can have values from 0 to 7, 1 rotates 90deg clockwise)
Convert (requires transcoding):
mencoder -vf rotate=1 videofile.mp4 -oac copy -of lavf -lavfopts format=mp4 -ovc lavc -lavcopts vcodec=mpeg4 -o newfilename.mp4
(you can use other video codecs as well, this is just an example)
And here is a graphical tool to do the latter: kdenlive (a kde application from the universe)
- import your video as a clip
- draw the clip into the timeline
- rightclick onto the video chunk in timeline
- select "Add Effect" -> "Crop and Transform" -> "Rotate (Keyframable)"
- The effect can be configured in the upper central section of the window, set X to 900 (thats 90 deg clockwise)
- Render your project (Project -> Render in the main menu)
- Be careful to choose a video resolution for the resulting portrait format
- select any video codec you like, i recommend x264 or vp8 (webm)
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
1
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thusmplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
@erik Nice hint. Strange, though, when I run my video usingmplayer -vf flip,mirror
everything is fine. But when I try to convert it, usingmencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax formencoder
to flip a video by 180°?
– Würgspaß
Aug 2 '18 at 17:11
add a comment |
If you just want to view a movie in a different orientation, as of Totem 3.1.4 (in Raring 13.04 and beyond), there is a "rotation plugin" which you can turn on (edit/plugins), and then rotate e.g. via ctrl-r.
I think proper rotation should be automatic when there is rotation metadata, and I commented on a relevant Totem bug here: Bug 701950 – Iphone Movies
There are also ways to do this in mplayer (and to convert to a rotated movie with mencoder), e.g.
mplayer -vf rotate file.mov
or
mencoder file.mov -oac lavc -ovc x264 -vf rotate=1 -o file-rotated.mov
add a comment |
The best option (in my opinion!) is OpenShot, you simply follow these easy steps:
- Start OpenShot
- On the File Tab, Import the video file you need to rotate
- Drag the imported video to the timeline field at the bottom (either one will do!).
- Once the videoclip is in the timeline field, right click on it and choose rotate to
the desired angle - Then on the File Tab choose Export video and set the prefered format and location
to it! - And presto!! That's it
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
3
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
add a comment |
OpenShot crops the video when rotated from landscape to portrait. To compensate, I tried these steps and it worked. Hope it works for you too.
- place video on a track, right click and select properties
- Under videos tab, uncheck "maintain aspect ratio" and "stretch full screen"
- Under videos tab, put 90 for rotating clockwise, or -90 to rotate anti-clockwise
- Under Layout tab, decrease width % to lower value (say 70) for both "start of click" and "end of clip". This value should depend upon aspect ratio of shooting, so try accordingly. Mine was 16:9 and value of 70 was fine.
In this way, you would find the video least cropped and it should not be noticeable.
add a comment |
A simple tool that can also rotate is transmageddon. Install it with
sudo apt install transmageddon
then load your file into it and choose the rotation position
add a comment |
protected by Community♦ Sep 10 '14 at 13:38
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are asking for rotate a video 90º or 180º, you should use avidemux.
sudo apt-get update
sudo apt-get install avidemux
- open the video in avidemux
- select a new video format and don't choose copy
- Under "Video" click on Filters
- Choose "Transform" and scroll down until you see rotate.
- Add it
- select the right angle
- select preview
- ok.
- Go to file
- save
- save video
And you're done.
4
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
1
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
3
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
2
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
9
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
|
show 4 more comments
If you are asking for rotate a video 90º or 180º, you should use avidemux.
sudo apt-get update
sudo apt-get install avidemux
- open the video in avidemux
- select a new video format and don't choose copy
- Under "Video" click on Filters
- Choose "Transform" and scroll down until you see rotate.
- Add it
- select the right angle
- select preview
- ok.
- Go to file
- save
- save video
And you're done.
4
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
1
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
3
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
2
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
9
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
|
show 4 more comments
If you are asking for rotate a video 90º or 180º, you should use avidemux.
sudo apt-get update
sudo apt-get install avidemux
- open the video in avidemux
- select a new video format and don't choose copy
- Under "Video" click on Filters
- Choose "Transform" and scroll down until you see rotate.
- Add it
- select the right angle
- select preview
- ok.
- Go to file
- save
- save video
And you're done.
If you are asking for rotate a video 90º or 180º, you should use avidemux.
sudo apt-get update
sudo apt-get install avidemux
- open the video in avidemux
- select a new video format and don't choose copy
- Under "Video" click on Filters
- Choose "Transform" and scroll down until you see rotate.
- Add it
- select the right angle
- select preview
- ok.
- Go to file
- save
- save video
And you're done.
edited Aug 11 '15 at 0:01
Wilbur Whateley
1093
1093
answered Nov 29 '11 at 11:53
Infernodot
90272
90272
4
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
1
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
3
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
2
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
9
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
|
show 4 more comments
4
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
1
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
3
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
2
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
9
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
4
4
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
Not sure what video format i should choose? Can i keep original video format?
– Dziamid
Dec 4 '12 at 9:47
1
1
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
I have rotated videos (.MOV) in Windows XP, using Apple Quicktime Pro ("QTP"). If done correctly the file remains rotated for other Windows machines and on my wife's iMac, but appears unrotated in Dragon Player ("DP") using Kubuntu 12.04.1. DP doesn't claim to be more than a "Simple" player, but I suspect that the problem is that QTP rotates files in a way that is accessible only in QT. Does Avidemux do better?
– WGCman
Dec 9 '12 at 12:14
3
3
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
What does "select a new video format and don't choose copy" mean, exactly?
– Jeff Trull
Jul 6 '14 at 4:57
2
2
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
Echoing @JeffTrull, can you elaborate on the steps? I found that 'Click on Filters' means 'Select Video→Filters from the menu', but then it says 'To apply filters the video must be transcoded'... whatever that means...
– Michael Scheper
Apr 28 '15 at 4:38
9
9
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
Sadly, "avidemux" is no longer in the standard repo.
– Cerin
Oct 24 '17 at 4:13
|
show 4 more comments
You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):
Rotate 90 clockwise:
ffmpeg -i in.mov -vf "transpose=1" out.mov
For the transpose parameter you can pass:
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
And to flip it horizontally (ffmpeg documentation):
Flip the input video horizontally.
For example to horizontally flip the video in input with `ffmpeg':
ffmpeg -i in.avi -vf "hflip" out.avi
Nota bene
Older versions of Ubuntu supplied avconv
instead of ffmpeg
. In this case just change ffmpeg
to avconv
:
avconv -i in.mov -vf "transpose=1" out.mov
4
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.
– evilsoup
Sep 16 '13 at 9:14
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
2
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
1
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
1
To add to your answer (maybe some people might find this useful): To rotate an x264 video withffmpeg
I had to specify the codec / library explicitly:ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it saysUnknown encoder libx264
, you need to install the appropriatelibavcodec-extra
package.
– balu
Nov 5 '15 at 14:00
|
show 2 more comments
You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):
Rotate 90 clockwise:
ffmpeg -i in.mov -vf "transpose=1" out.mov
For the transpose parameter you can pass:
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
And to flip it horizontally (ffmpeg documentation):
Flip the input video horizontally.
For example to horizontally flip the video in input with `ffmpeg':
ffmpeg -i in.avi -vf "hflip" out.avi
Nota bene
Older versions of Ubuntu supplied avconv
instead of ffmpeg
. In this case just change ffmpeg
to avconv
:
avconv -i in.mov -vf "transpose=1" out.mov
4
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.
– evilsoup
Sep 16 '13 at 9:14
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
2
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
1
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
1
To add to your answer (maybe some people might find this useful): To rotate an x264 video withffmpeg
I had to specify the codec / library explicitly:ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it saysUnknown encoder libx264
, you need to install the appropriatelibavcodec-extra
package.
– balu
Nov 5 '15 at 14:00
|
show 2 more comments
You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):
Rotate 90 clockwise:
ffmpeg -i in.mov -vf "transpose=1" out.mov
For the transpose parameter you can pass:
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
And to flip it horizontally (ffmpeg documentation):
Flip the input video horizontally.
For example to horizontally flip the video in input with `ffmpeg':
ffmpeg -i in.avi -vf "hflip" out.avi
Nota bene
Older versions of Ubuntu supplied avconv
instead of ffmpeg
. In this case just change ffmpeg
to avconv
:
avconv -i in.mov -vf "transpose=1" out.mov
You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):
Rotate 90 clockwise:
ffmpeg -i in.mov -vf "transpose=1" out.mov
For the transpose parameter you can pass:
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip
And to flip it horizontally (ffmpeg documentation):
Flip the input video horizontally.
For example to horizontally flip the video in input with `ffmpeg':
ffmpeg -i in.avi -vf "hflip" out.avi
Nota bene
Older versions of Ubuntu supplied avconv
instead of ffmpeg
. In this case just change ffmpeg
to avconv
:
avconv -i in.mov -vf "transpose=1" out.mov
edited Oct 8 '17 at 16:58
slhck
725629
725629
answered Dec 13 '12 at 10:54
franzlorenzon
1,97831521
1,97831521
4
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.
– evilsoup
Sep 16 '13 at 9:14
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
2
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
1
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
1
To add to your answer (maybe some people might find this useful): To rotate an x264 video withffmpeg
I had to specify the codec / library explicitly:ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it saysUnknown encoder libx264
, you need to install the appropriatelibavcodec-extra
package.
– balu
Nov 5 '15 at 14:00
|
show 2 more comments
4
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.
– evilsoup
Sep 16 '13 at 9:14
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
2
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
1
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
1
To add to your answer (maybe some people might find this useful): To rotate an x264 video withffmpeg
I had to specify the codec / library explicitly:ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it saysUnknown encoder libx264
, you need to install the appropriatelibavcodec-extra
package.
– balu
Nov 5 '15 at 14:00
4
4
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.– evilsoup
Sep 16 '13 at 9:14
-sameq
doesn't mean 'same quality', it is actually a very limited option that is almost never practically useful, and has been removed from recent versions of ffmpeg precisely because its name causes confusion.– evilsoup
Sep 16 '13 at 9:14
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
@evilsoup thank you for the comment. I've rolled back the changes. However, a better link to provide is this: trac.ffmpeg.org/wiki/…', which is from the ffmpeg site itself.
– Alaa Ali
Sep 17 '13 at 4:29
2
2
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
N.B. that ffmpeg is now deprecated in favour of avconf "*** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead." See a the answer for avconv: askubuntu.com/questions/269429/…
– Sparhawk
Feb 10 '14 at 6:50
1
1
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
@Sparhawk You are right --- but it seems that ffmpeg has a chance of doing a comeback. lwn.net/Articles/607591 ;-)
– Rmano
Sep 8 '14 at 9:37
1
1
To add to your answer (maybe some people might find this useful): To rotate an x264 video with
ffmpeg
I had to specify the codec / library explicitly: ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it says Unknown encoder libx264
, you need to install the appropriate libavcodec-extra
package.– balu
Nov 5 '15 at 14:00
To add to your answer (maybe some people might find this useful): To rotate an x264 video with
ffmpeg
I had to specify the codec / library explicitly: ffmpeg -i in.mp4 -vcodec libx264 -vf "transpose=2" out.mkv
. If it says Unknown encoder libx264
, you need to install the appropriate libavcodec-extra
package.– balu
Nov 5 '15 at 14:00
|
show 2 more comments
Do you mean rotation on playback or converting it to a rotated version?
As a commandline-user I normally use mplayer:
Playback:
mplayer -vf rotate=1 videofile.mp4
(rotate can have values from 0 to 7, 1 rotates 90deg clockwise)
Convert (requires transcoding):
mencoder -vf rotate=1 videofile.mp4 -oac copy -of lavf -lavfopts format=mp4 -ovc lavc -lavcopts vcodec=mpeg4 -o newfilename.mp4
(you can use other video codecs as well, this is just an example)
And here is a graphical tool to do the latter: kdenlive (a kde application from the universe)
- import your video as a clip
- draw the clip into the timeline
- rightclick onto the video chunk in timeline
- select "Add Effect" -> "Crop and Transform" -> "Rotate (Keyframable)"
- The effect can be configured in the upper central section of the window, set X to 900 (thats 90 deg clockwise)
- Render your project (Project -> Render in the main menu)
- Be careful to choose a video resolution for the resulting portrait format
- select any video codec you like, i recommend x264 or vp8 (webm)
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
1
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thusmplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
@erik Nice hint. Strange, though, when I run my video usingmplayer -vf flip,mirror
everything is fine. But when I try to convert it, usingmencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax formencoder
to flip a video by 180°?
– Würgspaß
Aug 2 '18 at 17:11
add a comment |
Do you mean rotation on playback or converting it to a rotated version?
As a commandline-user I normally use mplayer:
Playback:
mplayer -vf rotate=1 videofile.mp4
(rotate can have values from 0 to 7, 1 rotates 90deg clockwise)
Convert (requires transcoding):
mencoder -vf rotate=1 videofile.mp4 -oac copy -of lavf -lavfopts format=mp4 -ovc lavc -lavcopts vcodec=mpeg4 -o newfilename.mp4
(you can use other video codecs as well, this is just an example)
And here is a graphical tool to do the latter: kdenlive (a kde application from the universe)
- import your video as a clip
- draw the clip into the timeline
- rightclick onto the video chunk in timeline
- select "Add Effect" -> "Crop and Transform" -> "Rotate (Keyframable)"
- The effect can be configured in the upper central section of the window, set X to 900 (thats 90 deg clockwise)
- Render your project (Project -> Render in the main menu)
- Be careful to choose a video resolution for the resulting portrait format
- select any video codec you like, i recommend x264 or vp8 (webm)
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
1
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thusmplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
@erik Nice hint. Strange, though, when I run my video usingmplayer -vf flip,mirror
everything is fine. But when I try to convert it, usingmencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax formencoder
to flip a video by 180°?
– Würgspaß
Aug 2 '18 at 17:11
add a comment |
Do you mean rotation on playback or converting it to a rotated version?
As a commandline-user I normally use mplayer:
Playback:
mplayer -vf rotate=1 videofile.mp4
(rotate can have values from 0 to 7, 1 rotates 90deg clockwise)
Convert (requires transcoding):
mencoder -vf rotate=1 videofile.mp4 -oac copy -of lavf -lavfopts format=mp4 -ovc lavc -lavcopts vcodec=mpeg4 -o newfilename.mp4
(you can use other video codecs as well, this is just an example)
And here is a graphical tool to do the latter: kdenlive (a kde application from the universe)
- import your video as a clip
- draw the clip into the timeline
- rightclick onto the video chunk in timeline
- select "Add Effect" -> "Crop and Transform" -> "Rotate (Keyframable)"
- The effect can be configured in the upper central section of the window, set X to 900 (thats 90 deg clockwise)
- Render your project (Project -> Render in the main menu)
- Be careful to choose a video resolution for the resulting portrait format
- select any video codec you like, i recommend x264 or vp8 (webm)
Do you mean rotation on playback or converting it to a rotated version?
As a commandline-user I normally use mplayer:
Playback:
mplayer -vf rotate=1 videofile.mp4
(rotate can have values from 0 to 7, 1 rotates 90deg clockwise)
Convert (requires transcoding):
mencoder -vf rotate=1 videofile.mp4 -oac copy -of lavf -lavfopts format=mp4 -ovc lavc -lavcopts vcodec=mpeg4 -o newfilename.mp4
(you can use other video codecs as well, this is just an example)
And here is a graphical tool to do the latter: kdenlive (a kde application from the universe)
- import your video as a clip
- draw the clip into the timeline
- rightclick onto the video chunk in timeline
- select "Add Effect" -> "Crop and Transform" -> "Rotate (Keyframable)"
- The effect can be configured in the upper central section of the window, set X to 900 (thats 90 deg clockwise)
- Render your project (Project -> Render in the main menu)
- Be careful to choose a video resolution for the resulting portrait format
- select any video codec you like, i recommend x264 or vp8 (webm)
edited Oct 26 '12 at 17:02
answered Oct 26 '12 at 16:44
Paul Hänsch
2,6791514
2,6791514
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
1
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thusmplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
@erik Nice hint. Strange, though, when I run my video usingmplayer -vf flip,mirror
everything is fine. But when I try to convert it, usingmencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax formencoder
to flip a video by 180°?
– Würgspaß
Aug 2 '18 at 17:11
add a comment |
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
1
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thusmplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
@erik Nice hint. Strange, though, when I run my video usingmplayer -vf flip,mirror
everything is fine. But when I try to convert it, usingmencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax formencoder
to flip a video by 180°?
– Würgspaß
Aug 2 '18 at 17:11
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
convert to a rotated form.
– Bennett
Oct 26 '12 at 16:46
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
Out of curiosity: did you use mencoder in the end or kdenlive? There is a lot of documentation available online for tweaking mencoder options btw. Also some recommendations for "the perfect mencoder command line"(TM), most of them good.
– Paul Hänsch
Oct 27 '12 at 13:01
1
1
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thus
mplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
If you want to rotate by 180 degrees, you have to use option flip and mirror at the same time, thus
mplayer -vf flip,mirror videofile.mkv
– erik
Jan 20 '17 at 16:40
@erik Nice hint. Strange, though, when I run my video using
mplayer -vf flip,mirror
everything is fine. But when I try to convert it, using mencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax for mencoder
to flip a video by 180°?– Würgspaß
Aug 2 '18 at 17:11
@erik Nice hint. Strange, though, when I run my video using
mplayer -vf flip,mirror
everything is fine. But when I try to convert it, using mencoder -vf flip,mirror
, it is still rotated by 90°. Is there a different syntax for mencoder
to flip a video by 180°?– Würgspaß
Aug 2 '18 at 17:11
add a comment |
If you just want to view a movie in a different orientation, as of Totem 3.1.4 (in Raring 13.04 and beyond), there is a "rotation plugin" which you can turn on (edit/plugins), and then rotate e.g. via ctrl-r.
I think proper rotation should be automatic when there is rotation metadata, and I commented on a relevant Totem bug here: Bug 701950 – Iphone Movies
There are also ways to do this in mplayer (and to convert to a rotated movie with mencoder), e.g.
mplayer -vf rotate file.mov
or
mencoder file.mov -oac lavc -ovc x264 -vf rotate=1 -o file-rotated.mov
add a comment |
If you just want to view a movie in a different orientation, as of Totem 3.1.4 (in Raring 13.04 and beyond), there is a "rotation plugin" which you can turn on (edit/plugins), and then rotate e.g. via ctrl-r.
I think proper rotation should be automatic when there is rotation metadata, and I commented on a relevant Totem bug here: Bug 701950 – Iphone Movies
There are also ways to do this in mplayer (and to convert to a rotated movie with mencoder), e.g.
mplayer -vf rotate file.mov
or
mencoder file.mov -oac lavc -ovc x264 -vf rotate=1 -o file-rotated.mov
add a comment |
If you just want to view a movie in a different orientation, as of Totem 3.1.4 (in Raring 13.04 and beyond), there is a "rotation plugin" which you can turn on (edit/plugins), and then rotate e.g. via ctrl-r.
I think proper rotation should be automatic when there is rotation metadata, and I commented on a relevant Totem bug here: Bug 701950 – Iphone Movies
There are also ways to do this in mplayer (and to convert to a rotated movie with mencoder), e.g.
mplayer -vf rotate file.mov
or
mencoder file.mov -oac lavc -ovc x264 -vf rotate=1 -o file-rotated.mov
If you just want to view a movie in a different orientation, as of Totem 3.1.4 (in Raring 13.04 and beyond), there is a "rotation plugin" which you can turn on (edit/plugins), and then rotate e.g. via ctrl-r.
I think proper rotation should be automatic when there is rotation metadata, and I commented on a relevant Totem bug here: Bug 701950 – Iphone Movies
There are also ways to do this in mplayer (and to convert to a rotated movie with mencoder), e.g.
mplayer -vf rotate file.mov
or
mencoder file.mov -oac lavc -ovc x264 -vf rotate=1 -o file-rotated.mov
edited Feb 28 '15 at 22:05
answered Jul 9 '14 at 21:11
nealmcb
2,0032444
2,0032444
add a comment |
add a comment |
The best option (in my opinion!) is OpenShot, you simply follow these easy steps:
- Start OpenShot
- On the File Tab, Import the video file you need to rotate
- Drag the imported video to the timeline field at the bottom (either one will do!).
- Once the videoclip is in the timeline field, right click on it and choose rotate to
the desired angle - Then on the File Tab choose Export video and set the prefered format and location
to it! - And presto!! That's it
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
3
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
add a comment |
The best option (in my opinion!) is OpenShot, you simply follow these easy steps:
- Start OpenShot
- On the File Tab, Import the video file you need to rotate
- Drag the imported video to the timeline field at the bottom (either one will do!).
- Once the videoclip is in the timeline field, right click on it and choose rotate to
the desired angle - Then on the File Tab choose Export video and set the prefered format and location
to it! - And presto!! That's it
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
3
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
add a comment |
The best option (in my opinion!) is OpenShot, you simply follow these easy steps:
- Start OpenShot
- On the File Tab, Import the video file you need to rotate
- Drag the imported video to the timeline field at the bottom (either one will do!).
- Once the videoclip is in the timeline field, right click on it and choose rotate to
the desired angle - Then on the File Tab choose Export video and set the prefered format and location
to it! - And presto!! That's it
The best option (in my opinion!) is OpenShot, you simply follow these easy steps:
- Start OpenShot
- On the File Tab, Import the video file you need to rotate
- Drag the imported video to the timeline field at the bottom (either one will do!).
- Once the videoclip is in the timeline field, right click on it and choose rotate to
the desired angle - Then on the File Tab choose Export video and set the prefered format and location
to it! - And presto!! That's it
edited Nov 14 '13 at 4:23
answered Nov 13 '13 at 5:52
ADOLFO HERNANDEZ
8112
8112
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
3
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
add a comment |
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
3
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
You don't really explain how to acutally rotate it. Please edit your answer and add that information.
– MadMike
Nov 13 '13 at 7:20
3
3
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
No, it rotates the video but keeps the aspect ratio vertical, making the video cropped and square
– Magnetic_dud
Mar 4 '15 at 9:16
add a comment |
OpenShot crops the video when rotated from landscape to portrait. To compensate, I tried these steps and it worked. Hope it works for you too.
- place video on a track, right click and select properties
- Under videos tab, uncheck "maintain aspect ratio" and "stretch full screen"
- Under videos tab, put 90 for rotating clockwise, or -90 to rotate anti-clockwise
- Under Layout tab, decrease width % to lower value (say 70) for both "start of click" and "end of clip". This value should depend upon aspect ratio of shooting, so try accordingly. Mine was 16:9 and value of 70 was fine.
In this way, you would find the video least cropped and it should not be noticeable.
add a comment |
OpenShot crops the video when rotated from landscape to portrait. To compensate, I tried these steps and it worked. Hope it works for you too.
- place video on a track, right click and select properties
- Under videos tab, uncheck "maintain aspect ratio" and "stretch full screen"
- Under videos tab, put 90 for rotating clockwise, or -90 to rotate anti-clockwise
- Under Layout tab, decrease width % to lower value (say 70) for both "start of click" and "end of clip". This value should depend upon aspect ratio of shooting, so try accordingly. Mine was 16:9 and value of 70 was fine.
In this way, you would find the video least cropped and it should not be noticeable.
add a comment |
OpenShot crops the video when rotated from landscape to portrait. To compensate, I tried these steps and it worked. Hope it works for you too.
- place video on a track, right click and select properties
- Under videos tab, uncheck "maintain aspect ratio" and "stretch full screen"
- Under videos tab, put 90 for rotating clockwise, or -90 to rotate anti-clockwise
- Under Layout tab, decrease width % to lower value (say 70) for both "start of click" and "end of clip". This value should depend upon aspect ratio of shooting, so try accordingly. Mine was 16:9 and value of 70 was fine.
In this way, you would find the video least cropped and it should not be noticeable.
OpenShot crops the video when rotated from landscape to portrait. To compensate, I tried these steps and it worked. Hope it works for you too.
- place video on a track, right click and select properties
- Under videos tab, uncheck "maintain aspect ratio" and "stretch full screen"
- Under videos tab, put 90 for rotating clockwise, or -90 to rotate anti-clockwise
- Under Layout tab, decrease width % to lower value (say 70) for both "start of click" and "end of clip". This value should depend upon aspect ratio of shooting, so try accordingly. Mine was 16:9 and value of 70 was fine.
In this way, you would find the video least cropped and it should not be noticeable.
edited May 4 '16 at 9:47
answered May 3 '16 at 14:18
Shaurabh Bharti
23119
23119
add a comment |
add a comment |
A simple tool that can also rotate is transmageddon. Install it with
sudo apt install transmageddon
then load your file into it and choose the rotation position
add a comment |
A simple tool that can also rotate is transmageddon. Install it with
sudo apt install transmageddon
then load your file into it and choose the rotation position
add a comment |
A simple tool that can also rotate is transmageddon. Install it with
sudo apt install transmageddon
then load your file into it and choose the rotation position
A simple tool that can also rotate is transmageddon. Install it with
sudo apt install transmageddon
then load your file into it and choose the rotation position
answered Dec 31 '18 at 14:20
ptetteh227
940219
940219
add a comment |
add a comment |
protected by Community♦ Sep 10 '14 at 13:38
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?