Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simple (to use) video rotater?

4 views
Skip to first unread message

pH

unread,
Sep 22, 2022, 6:56:51 PM9/22/22
to
My daughter sent me some videos via her iphone. Some of them are sideways
so I want to rotate them and save them in the rotated format rather than
toggle the playback every time.

I've seen that mPlayer can rotate playback, but not store.

I see that VLC *can* rotate and store the videos...so this looks like the
tool to use.
There are instructions on how to do this on the internet...but it seems a
bit tedious (whine whine).

Before I dive into it, does anyone know a a simple-to-use rotational tool
along the lines of "twist -90degrees infile outfile"?

This is not a major issue, I just know that Linux usually has 20 ways to
skin any particular cat.

Pureheart in Aptos

Computer Nerd Kev

unread,
Sep 22, 2022, 7:30:35 PM9/22/22
to
pH <wNOS...@gmail.org> wrote:
> My daughter sent me some videos via her iphone. Some of them are sideways
> so I want to rotate them and save them in the rotated format rather than
> toggle the playback every time.
> [snip]
> Before I dive into it, does anyone know a a simple-to-use rotational tool
> along the lines of "twist -90degrees infile outfile"?

My exact instructions for dealing with your exact problem are on
another computer, but rotation is done with ffmpeg using:
ffmpeg [arguments] -vf "transpose=[number]" [output]

Where a web search brings up [number] being:
"1 = 90Clockwise, 2 = 90CounterClockwise, 3 = 90Clockwise and
Vertical Flip, "transpose=2,transpose=2" for 180 degrees".

--
__ __
#_ < |\| |< _#

stepore

unread,
Sep 22, 2022, 10:26:08 PM9/22/22
to
On 9/22/22 15:56, pH wrote:
> My daughter sent me some videos via her iphone. Some of them are sideways
> so I want to rotate them and save them in the rotated format rather than
> toggle the playback every time.

I second ffmpeg, it'll do anything.

If you want a GUI then avidemux has tons of these simple video (rotate,
crop, etc) features.

Andreas Kohlbach

unread,
Sep 23, 2022, 1:47:50 PM9/23/22
to
But that will re-encode it with loss of quality, no? Because "-vf"
implies "video filter", which alters the video data.

For meta data found

ffmpeg -i original_file.mp4 -metadata:s:v rotate="1" -c copy outfile.mp4

to just tells the video player about the orientation. Player (and the video
format) must support that. That should take a split second per video, as
its data are not altered.

Numbers (where the above command has a "0" for not rotating) are as in
Computer Nerd Kev's example ("1" = rotate clockwise by 90 degrees...).

I also found that in the internet. Not tested myself.
--
Andreas

pH

unread,
Sep 23, 2022, 1:55:10 PM9/23/22
to
Ahh! Thank-you. I'll have a look at this before I dive in...it's only a few
videos, thankfully.

Now if I can just remember this tool in the future...better keep notes.

pH in Aptos

pH

unread,
Sep 23, 2022, 1:57:10 PM9/23/22
to
Looking like ffmpeg is the one. Also thank-you.

pH

pH

unread,
Sep 23, 2022, 1:58:45 PM9/23/22
to
Having come from CP/M back in the beginning of time, I kind of like the
command line when I can. Thanks for the tip that a gui exists that may do
the trick, too, though.

pH

Carlos E.R.

unread,
Sep 23, 2022, 2:28:11 PM9/23/22
to
On 2022-09-23 19:47, Andreas Kohlbach wrote:
> On 23 Sep 2022 09:30:22 +1000, Computer Nerd Kev wrote:
>>
>> pH <wNOS...@gmail.org> wrote:
>>> My daughter sent me some videos via her iphone. Some of them are sideways
>>> so I want to rotate them and save them in the rotated format rather than
>>> toggle the playback every time.
>>> [snip]
>>> Before I dive into it, does anyone know a a simple-to-use rotational tool
>>> along the lines of "twist -90degrees infile outfile"?
>>
>> My exact instructions for dealing with your exact problem are on
>> another computer, but rotation is done with ffmpeg using:
>> ffmpeg [arguments] -vf "transpose=[number]" [output]
>>
>> Where a web search brings up [number] being:
>> "1 = 90Clockwise, 2 = 90CounterClockwise, 3 = 90Clockwise and
>> Vertical Flip, "transpose=2,transpose=2" for 180 degrees".
>
> But that will re-encode it with loss of quality, no? Because "-vf"
> implies "video filter", which alters the video data.
>
> For meta data found
>
> ffmpeg -i original_file.mp4 -metadata:s:v rotate="1" -c copy outfile.mp4
>
> to just tells the video player about the orientation. Player (and the video
> format) must support that. That should take a split second per video, as
> its data are not altered.

But is the conversion on the fly done by the player lossy, or not? I wonder.

And of course, the destination player must support this flag.

>
> Numbers (where the above command has a "0" for not rotating) are as in
> Computer Nerd Kev's example ("1" = rotate clockwise by 90 degrees...).
>
> I also found that in the internet. Not tested myself.

Interesting find, thanks.

--
Cheers, Carlos.


Rich

unread,
Sep 23, 2022, 5:21:13 PM9/23/22
to
On the player, unlikely, as a 90 degree rotation (without any
recompression) is a lossless transformation (no need to resample any
pixels, just move them to different 'grid' locations in display
memory).

> And of course, the destination player must support this flag.

This is always the case. And since pH says the originals came from an
iPhone, that implies the 'orientation' metadata may already be set, and
the fact that pH has them playing back sideways implies that pH's
player does not support the orientation flag.

Computer Nerd Kev

unread,
Sep 23, 2022, 7:07:21 PM9/23/22
to
Andreas Kohlbach <a...@spamfence.net> wrote:
> On 23 Sep 2022 09:30:22 +1000, Computer Nerd Kev wrote:
>> My exact instructions for dealing with your exact problem are on
>> another computer, but rotation is done with ffmpeg using:
>> ffmpeg [arguments] -vf "transpose=[number]" [output]
>>
>> Where a web search brings up [number] being:
>> "1 = 90Clockwise, 2 = 90CounterClockwise, 3 = 90Clockwise and
>> Vertical Flip, "transpose=2,transpose=2" for 180 degrees".
>
> But that will re-encode it with loss of quality, no? Because "-vf"
> implies "video filter", which alters the video data.

Yes I expect so. I always convert videos into MPEG4 AVIs and
often reduce the resolution as well. So it doesn't matter for me
unless the video is already MPEG4 and a sensible resolution, which
doesn't happen anymore.

> For meta data found
>
> ffmpeg -i original_file.mp4 -metadata:s:v rotate="1" -c copy outfile.mp4
>
> to just tells the video player about the orientation. Player (and the video
> format) must support that. That should take a split second per video, as
> its data are not altered.

Interesting. Sounds like it's specific to particular container
formats though.

stepore

unread,
Sep 24, 2022, 2:03:05 AM9/24/22
to
On 9/23/22 11:02, Andreas Kohlbach wrote:

> What package is this part of? Cannot find it in Debian. And can it deal

It's in the Christian Marillat deb-multimedia repos:
www.deb-multimedia.org

package list for bullseye:
http://www.deb-multimedia.org/dists/stable/main/binary-amd64/

also available as an appImage.

> with "modern" formats/containers, like MP4 or MKV?

Yes, of course.
I've used it for many many years. It's a simple video editor. It's great.

Carlos E.R.

unread,
Sep 24, 2022, 8:00:11 AM9/24/22
to
Right.

>
>> And of course, the destination player must support this flag.
>
> This is always the case. And since pH says the originals came from an
> iPhone, that implies the 'orientation' metadata may already be set, and
> the fact that pH has them playing back sideways implies that pH's
> player does not support the orientation flag.

Right.

vlc does, AFAIR.


--
Cheers, Carlos.


hexagonwin

unread,
Sep 24, 2022, 12:14:16 PM9/24/22
to
Hello.

I searched the internet for the matter, and it seems like ffmpeg has the
function to do what you need.

$ ffmpeg -i input.mp4 -vf "transpose=1" -c copy output.mp4
## transpose=1 : rotate by 90 degrees clockwise
## transpose=2 : rotate by 90 degrees counterclockwise

Hope this helps.
-Hexagonwin

pH

unread,
Sep 24, 2022, 8:59:23 PM9/24/22
to
Hi, All.

Well it seemed from ffmpeg pages that:

ffmpeg -i input.mp4 -vf "transpose=1" output.mp4

would be the magic button. (Where "1" meant rotate 90 degrees clockwise.)

No joy...it ended up flipping the videon right to left...so still sideways
but the top now being on the right.

I then tried:
ffmpeg -i input.mp4 -vf "transpose=0" output.mp4

Which is supposed to rotate 90 degrees then flip it vertically.

That *also* produced a simple 180 flip...still horizontal.

But then, I only viewed them w/ Mplayer...maybe I should have tried VLC and
others.

Anyway...more futzing needed.

pH

pH

unread,
Sep 24, 2022, 9:01:32 PM9/24/22
to
I reported an earlier failure just now....I did not include the
"-c copy" in my command line.

Perhaps that is the rub....I'll try again after I finish my cigar and BBQ
outside and report back.

Thanks to all lending advice.

pH
(in Aptos)
0 new messages