Page 1 of 2

AutoRotate Video

Posted: Mon Apr 28, 2014 9:41 pm
by Registered55
Mobile devices usually apply a rotation figure (MediaInfo shows this as Rotation = 90o for example)

is there a way for Handbrake to apply an AutoRotate to the file to automatically apply a Rotate 4 to this kind of file,

or better still, could handbrake preserve this Rotation information field, and when writing the destination file, if this field exists, then apply the field back in the destination file, this way, videos will still play correctly on all devices that read this information. This would be the better choice really as it would account for a much wider audience. Although having an AutoRotate feature in Handbrake would be nice though, but i'm thinking a little more complicated to program.

Thanks.

Re: AutoRotate Video

Posted: Mon Apr 28, 2014 10:00 pm
by Smithcraft
I believe it's only available in the CLI.

I don't think Handbrake passes it through, but I'm not sure if it would be included in the metadata.

SC

Re: AutoRotate Video

Posted: Tue Apr 29, 2014 9:51 am
by Registered55
Auto rotation of the video is in the cli..... i would love to know what command line to use for that.

I'm already aware of the "--Rotation=x" command, which i can get the GUI to pass over to the CLI, but getting Handbrake to automatically apply the correct rotation on the video depending on what rotation is in the metadata.... that i didn't know handbrake could do???

how do i do that, i would love to know....thanks.

Re: AutoRotate Video

Posted: Tue Apr 29, 2014 4:30 pm
by Deleted User 11865
It's on the TO-DO list. Currently waiting for our MP4 demuxer (libavformat) to actually expose that information to us; it's being worked on but may take a while longer to complete.

Re: AutoRotate Video

Posted: Sun Apr 17, 2016 7:40 pm
by Pak
Hi all, I am new to this forum, started using Handbrake a couple weeks ago, and absolutely love it. Thanks for such a great work.
It's on the TO-DO list
I came here to suggest this feature and was very happy to read this. Is this implemented in the latest version of Handbrake using some extra command line, or is still on the TO-DO list?

This auto-rotation is literally the only thing preventing a user from mass-automating the compression all of the domestic videos in a folder.

As far as I understand, when recording in a smartphone, in my case from the iPhone for example, videos are recorded always in the same orientation relative to the camera, but are then given the appropriate orientation when playing them probably using the metadata mentioned above. Nowadays, as far as I can see, most players automatically correct the orientation, so it would be really great if Handbrake could copy this property automatically.

Right now I have to first process-recode the videos using Handbrake, and some of them end up in an incorrect orientation. Since I do not know how to get this meta-data from the original file, I always do this first step to find out, which is a slow method. Then I select one by one the ones that need rotating by 90, -90, or 180, and process them individually with the ", --rotate=X" command.

Re: AutoRotate Video

Posted: Sun Apr 17, 2016 7:42 pm
by s55
Still on the todo list.

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 5:06 pm
by Cantar4
We need to convert 30fps lens-down shot iPhone films to 24fps.
HandBrake is very good at the 30 to 24 conversion but
as soon as it touches these iphone images, whatever the required operation,
it puts them back into their initial out-of-the sensor state!

This would not be too much of a problem if [, --rotate=3] was still working
but this is not the case on Mac version 0.10.5 ! What can I do?

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 5:09 pm
by rollin_eng
Could you please post your logs, instructions can be found here:

viewtopic.php?f=6&t=31236

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 7:13 pm
by Cantar4
how can I trigger a log, there is no bug per se.

The problem is that opening iPhone films shot with the lens down the case
instead of at the top, HB generates upside down images, 180°rotated in fact,
that the CLI command of the additional option tab doesn't prevent.

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 7:23 pm
by rollin_eng
If the rotate switch is not working, that would be a bug would it not?

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 7:56 pm
by Woodstock
The problem is that the handbrake GUI doesn't use the command line program anymore, so there is no "passing the switch" (as mentioned in the original post from 2 years ago) in that way.

The CLI version still handles the switch, but the GUI doesn't call the CLI, so... What's needed is the variation of that magic incantation that gets passed to hb.dll ...

If you were actually using the CLI, "--rotate" defaults to 3, according to the built-in help. And it does work.

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 8:51 pm
by mduell
Cantar4 wrote:This would not be too much of a problem if [, --rotate=3] was still working
but this is not the case on Mac version 0.10.5 ! What can I do?
Works for me, would need to see the log from the encode you tried to see what you did wrong.

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 9:33 pm
by Cantar4
Woodstock wrote:The problem is that the handbrake GUI doesn't use the command line program anymore
What's needed is the variation of that magic incantation that gets passed to hb.dll .
I you could help us find this magic Cli/Gui connected version dated of the precolumbian ages,
you would save us from the sticky spurious ads of the [Removed]-converter. :)

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 9:39 pm
by Cantar4
[quote=mduell "Works for me, would need to see the log from the encode you tried to see what you did wrong.[/quote]
Would you tell me how to get this log ? I will sent it asap

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 9:42 pm
by rollin_eng
rollin_eng wrote:Could you please post your logs, instructions can be found here:

viewtopic.php?f=6&t=31236

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 10:12 pm
by Cantar4
i will use the pastebin method later,

Re: AutoRotate Video

Posted: Thu Sep 15, 2016 10:29 pm
by s55
[23:58:58] + options: , --rotate=3
Rotate is not a video encoder or advanced option.
The MacGUI is not running the CLI, so you can't pass CLI arguments though the GUI

You either have to use the CLI directly, or use a nightly build that adds rotate as a GUI option.

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 7:11 am
by Cantar4
Rodeo » Apr 29, 2014 : It's on the TO-DO list.
s55 » Apr 17, 2016 : Still on the todo list.
mduell » Sep 15, 2016 : Works for me, would need to see the log from the encode you tried
s55 » Sep 16, 2016 : or use a nightly build that adds rotate as a GUI option.


seems I still have long days sipping coktails...

where can we find this nightly build ?
or, knowing that using an iPhone in this manner will always need the same treatment:
" convert video from 29.97 to 23.98fps, convert audio from 44.1 to 48K, rotate 180 ",
would it be possible to get the command line for the Terminal prompt of a Mac?

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 7:38 am
by rollin_eng
https://handbrake.fr/nightly.php

As far as I know you can save it in a preset in the GUI

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 8:47 am
by Cantar4
I installed Version 20160916022549-e5e1be3-master ,
opened Preset but disn't find any upside-down iPhone in the device list... ;)
I made my own "iPhone rotate" preset.. didn't work

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 9:11 am
by rollin_eng
Cantar4 wrote: I made my own "iPhone rotate" preset.. didn't work
What did you do to create the preset?

Can you post your log.

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 12:43 pm
by Cantar4
Hi rollin_eng,
I first selected a film, set my choices, created a new Preset, launched the conversion, ... which failed again

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 1:31 pm
by Ritsuka
You need to set the rotate filter to what you want…

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 5:15 pm
by Cantar4
I tried all possible presets [, --rotate] [, --rotate=3] but nothing works,
"You can't pass CLI arguments though the GUI" rules.
Rodeo's (Apr 29, 2014: It's on the TO-DO list) and s55's (Apr 17, 2016 : Still on the todo list),
let me think it's more reasonable to provisionally use the [Removed]-converter which automatically deals
with the Phone orientation stored at the start of take.
Thank you all for your interest in this feature request.

Re: AutoRotate Video

Posted: Fri Sep 16, 2016 5:17 pm
by Ritsuka
The rotate filter is in the picture tab, near all the other filters (in the nightly build, of course.)