Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th December 2024, 04:44   #1  |  Link
UFOxyz
Registered User
 
Join Date: Aug 2005
Posts: 46
how can i rotate an image file to 270 degrees or 90 degrees in clockwise?

how can i rotate an image file to 270 degrees or 90 degrees in clockwise?

none of these below worked.
ffmpeg -y -rotate=90 -i "%1" "m:\aaa.bmp"
ffmpeg -y -rotate=90 -i "%~1" "m:\aaa.bmp"
ffmpeg -y -display_rotation 90 -i b.bmp "m:\aaa.bmp"
ffmpeg -y -display_rotation 90 -codec copy -i b.bmp "m:\aaa.bmp"


are these in below the same?
-c copy
-codec copy
-c codec copy
*************************


PS
now i kind of got it after a long floundering
-codec copy must not be included

ffmpeg -y -display_rotation 270 -i "%1" output2.bmp
if there is a way to improve or refine the command line, please do add

Last edited by UFOxyz; 18th December 2024 at 05:26. Reason: i kind of made it work, but hope to refine the command line
UFOxyz is offline   Reply With Quote
Old 18th December 2024, 13:42   #2  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,923
You cannot use -c copy since it does unmodified stream copy. If you rotate, that's a modification. As the name implies, it copies content 1:1, hence the name copy. If you modify something, it's no longer "copy" and it won't work.

To rotate 90° clockwise, use -vf transpose=1
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 18th December 2024, 18:50   #3  |  Link
Z2697
Registered User
 
Join Date: Aug 2024
Posts: 531
hflip or vflip should be used after transpose to create actual rotation effect. There's also a filter that's just called "rotate".
Z2697 is offline   Reply With Quote
Old 18th December 2024, 19:54   #4  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,923
Not mandatory. Just using transpose=<value> rotates just fine.
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 19th December 2024, 20:24   #5  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 4,054
Something like this?
Code:
ffplay -i "your_source" -vf "rotate='15*PI/180:ow=hypot(iw,ih):oh=ow',scale=w=-2:h=576,setsar=1/1"
or
Code:
ffmpeg -i "your_source" -vf "rotate='0.2*PI*t:ow=hypot(iw,ih):oh=ow:fillcolor=yellow',scale=w=-2:h=720,setsar=sar=1/1" -c:a copy -c:v libx264 -crf 20 "rotated.mp4"

Last edited by Sharc; 19th December 2024 at 20:48.
Sharc is offline   Reply With Quote
Old 19th December 2024, 23:41   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,167
Maybe see this (Open Source, I think), Lossless rotate for jpg, apparently.
FreeVimager
https://www.contaware.com/software/freevimager.html
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Reply

Tags
rotate image

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.