View Full Version : prerotating video for palm
homermaster
17th March 2005, 16:51
I have a program called MMPlayer that will allow me to watch movies on my Palm. The player has the ability to rotate the video to watch it in a 480x320 landscape mode. The problem is that there are bandwidth issues with the Palm when the movie is encoded with video widths of 480 while rotating the video with the application. The solution that they offer on their forums is to prerotate the video 90 degrees to the right durring encoding so that rotating with the application isn't necessary. I can do this using virtualdubmod by adding the rotate filter and reencoding the output video from AutoGK. I am learning but am not that savy with using virtualdubmod and am not able to always produce the rusults that I am looking for plus the time required to encode twice. So .... I was thinking if it was possible to add rotation to the advanced options or the AutoGK Assistant so everything could be done at once. If this is possible I know a lot of people that own Palms and PocketPCs that would love you guys forever .... I'm already there but it would be nice to see this tool added.
jggimi
17th March 2005, 17:18
Hello, and welcome to the forum.
You can do this with Gordian Knot, by editing the .avs script (using the Edit button) and adding a TurnLeft() or a TurnRight() to the script. If you've not used GK before, see Doom9's Guides (http://www.doom9.org/divx-encoding.htm).
homermaster
18th March 2005, 22:18
Thanks for the tip jggimi .... I am able to rotate the video by adding the turnright() to the end of the *_movie.avs generated by AutoGK and dragging it into VirtualDubMod. I can also get the same file size I specified in AutoGK if I let run at least to the beginning of the second pass so it tells the Xvid codec what settings to apply. Both of these were my main concerns and they have been resolved so thank you.
However, I still have to spend the extra time required to encode the movie almost twice (which isn't a big deal to me .... just glad I can do it) and I'm not sure it would be all that easy for others to reproduce what I did which is why I am posting on the forum.
AutoGK is so much more user friendly than Gordian Knot especially for people new to encoding that I would request again if it is possible to add rotation somewhere into the GUI. I would love to help in this reguard any way possible.
Again thanks for the help.
homermaster
9th April 2005, 23:49
Well... it's been a while since my last reply. I'm not sure if this is an option that will be added in to AutoGK or not... I'm still hoping so. However, I have been playing around with things a little and have discovered a simpler way to make this happen. It requires that there are two passes made for the video processing, which will definately happen if you are making the video small enough for a Palm or PocketPC. It does require you to pay attention to the encoding process though.
The first thing is to set up AutoGK like any normal encoding and start it. It will go through a number of steps that you can keep track of through the log window in AutoGK. When you see the line "Running First Pass" a file will be created in the agk_tmp folder called *_movie.avs. You will need to open this file with Notepad and at the end of it add the line turnright() command. Here is an example...
LoadPlugin("C:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\autocrop.dll")
movie = mpeg2source("C:\Documents and Settings\Aaron\Desktop\agk_tmp\Napoleon Dynamite.d2v")
cropclip = autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=0,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
fixed_aspect = 1.18518518518519
c_width = width(cropclip)
c_height = round(height(cropclip) / fixed_aspect)
input_par = float(c_width)/float(c_height)
input_par = input_par > 1.4 ? input_par : (4.0/3.0)
out_width = 480
out_height = round(float(out_width) / input_par)
hmod = out_height - (floor(out_height / 16 ) * 16)
out_height = (hmod > 4) ? (out_height + (16 - hmod)) : (out_height - hmod)
new_aspect = (float(out_width) / float(out_height)) / fixed_aspect
autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=new_aspect,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
BicubicResize(out_width,out_height,0,0.5)
turnright()
This MUST be added before the second pass is started. If you have done this correctly your encoded video from AutoGK will be rotated 90 degrees to the right. YEA!!
homermaster
10th April 2005, 16:14
I have been working on finding a way that will be simpler for everyone to accomplish this. Here is what I have come up with. Start your encoding process like normal. If you are making the movie small enough for the Palm or PocketPC it should require a two pass video encoding. This is essential for this process to work. Allow the encoding process to continue to the point where the first pass has started. You will know this from the line "[4/9/2005 6:20:28 PM] Running first pass." in the log window. When this has started there will be a *_movie.avs file created in the agk_tmp folder where you wanted to save the final movie. Open this file with Notepad and add the line turnright() to the end of it. THIS MUST BE DONE BEFORE THE SECOND PASS HAS STARTED or it will not work. Hope this helps.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.