Log in

View Full Version : A help in resizing without breaking the aspect ratio


SoulSmasher
24th April 2005, 17:52
hi, i want to convert my divx mvie to mpeg2...
but i have a little problem..
the movie is 640x256..
when i open the avs (or avi) in tmpgens dvd source creator for creating pal 16/9 mpeg2, the aspect ratio breaks down...
i want to put simple black lines to top and bottom to keep the aspect ratio, cause i dont wanna crop the movie from left and right...
how can i do this?
is theree a filter for this?
if anyone knows please help me...
thanx...
(i use tmpgenc dvd source creator for creating mpeg2 and it opens the avs files...)

E-Male
24th April 2005, 18:02
what is your target resolution?

define "breaks down"!

SoulSmasher
24th April 2005, 18:07
i am not @ home now but i need 2 add 47 lines to top and bottom.
it may be 625*256 or 640*256 i dont remember now
how can i do that?

sorry for my bad english..
aspect ratio doesnt become 4/3 or 16/9. it becomes weird. like i pulled the movie from top and bottom.

E-Male
24th April 2005, 18:27
with 16/9 you mean anamorphic?
anamorphic video is streched (long faces and so on)
that's intentional and should be corrected by the player if authored correctly

even if you stay with 4/3 you have to change the picture AR
because divx and mpeg2 have different pixel ARs

tmpgenc tools should do all that automatically in most cases, so don't worry

SoulSmasher
24th April 2005, 18:31
no tmpgenc tols are useless..
when i click prewiew encoded, i see that video is pulled from top and bottom, the aspect ratio isnt correct...
and cropping top and bottom makes them worse.
thnik like i do 640*025 movie to 16/9 video. do u understand???
i need a script that adds lines to top and bottom...

tsp
24th April 2005, 19:48
What about looking in the manual that came with avisynth? (http://www.avisynth.org/AddBorders)


AddBorders(0,47,0,47)
#or if it's total 47 lines
AddBorders(0,23,0,24)

E-Male
24th April 2005, 22:53
>>...do u understand???...
-I don't like that tone

>>when i click prewiew encoded, i see that video is pulled from top and bottom, the aspect ratio isnt correct...
-have you actually encoded a part of it and tried in a player?
also, do you know what anamorphic means??

SoulSmasher
25th April 2005, 13:47
http://warriorhellscream.spymac.net/my_problem.png
http://warriorhellscream.spymac.net/my_problem2.png

if u check here, u can understand me better.....

SoulSmasher
25th April 2005, 13:59
yepp i tried... it isnt correct...

Didée
25th April 2005, 14:12
I assume 6) (http://forum.doom9.org/forum-rules.htm).

In case the task is educationally purposed, you should use FitCD.

SoulSmasher
25th April 2005, 14:15
i dont want to break any rules of forum. it's educational for me, in case, i couldnt find any picture that explains my problem...
i dont think that the picture on the link is illegal but if that is, ill immediately delete the link.....

SoulSmasher
25th April 2005, 14:17
Originally posted by E-Male
>>...do u understand???...
-I don't like that tone

i dont want to be rule, if this is rule in ur country, or 4 u, sorry about that, E-Male.......

Wilbert
25th April 2005, 14:52
It's ruDe :)

Anyway, tsp explained you how to do the resizing in AviSynth. Open the script in TMPGEnc:

Settings:
Advanced -> 1:1
Video -> Aspect ratio 16:9 display
GOP structure -> max 15 (18 for NTSC)

if this is greyed out (standard on 4:3), you should do the following: Load -> Extra folder -> unlock.mcf (that template unlocks all settings). Go back to Settings: Video -> 16:9, and Encode mode -> progressive.

no tmpgenc tols are useless..
when i click prewiew encoded, i see that video is pulled from top and bottom, the aspect ratio isnt correct...
and cropping top and bottom makes them worse.
thnik like i do 640*025 movie to 16/9 video. do u understand???
i need a script that adds lines to top and bottom...
Ok, it's also possible to do the resizing and adding borders in TMPGEnc itself. But, I always forget how to do it properly:

(load the unlock template again ...)
Settings:
Advanced -> 1:1, and Center (custom size) -> select the size of your input clip (640x256 or whatever)
Video -> Aspect ratio 16:9 display, and Encode mode -> progressive.
GOP structure -> max 15 (18 for NTSC)

I don't recall how TMPGEnc resizing works though :) Perhaps other people can help and correct.

trevlac
25th April 2005, 15:05
@SoulSmasher

I am not 100% clear ... but here goes.

1st. You seem to say that you do not want to re-encode. Converting from mpeg4 to mpeg2 is certainlly a re-encode. Not sure what you want here.


On aspect ratios ....

1) Change the source by padding to get the AR you want
2) Resize this to your TV active picture frame size
3) Pad some more so you meet the dvd standard


1) Start with 640/256. You want 16/9 ratio. 640/16*9 = 360 .. 640/360


DirectShowSource("c:\myVid.avi")
AddBorders(0,52,0,52)



2) PAL is 702x576. Presumably you have progressive source, so a resize will not mess up the scan lines. You want to fill the PAL TV frame.

DirectShowSource("c:\myVid.avi")
AddBorders(0,52,0,52)
LanczosResize(702, 576)



3) For a DVD 720x576 would be most standard. The xtra 18 are not overscan and don't even come out of a dvd player analog out.

DirectShowSource("c:\myVid.avi")
AddBorders(0,52,0,52)
LanczosResize(702, 576)
AddBorders(0,9,0,9)


-----------------------------
Some notes ....
- TV 16/9 will not look correct on a PC unless the pc resizes it
- I assume your encoder just sets the 16/9 flags and is not doing it's own resize
- You could probably get there with less steps ... but i wanted to be clear

SoulSmasher
30th April 2005, 15:53
@trevlac and others
10x for the tip for the solution for pal, also i need to do this to a divx (or xvid i dont remember im not @ home)that is 23,976 fps and i need to re-encode it to ntsc 29,97 fps..
i use cce now it's so better than tmpgenc...
how can i do this (fps conversation)
does the script for avisynth i wrote below works fine???

ChangeFPS(29.97)
does this work,
or is there a other techinque that gives better solutions,
or is DGPulldown useful
or if theres a better solution, how can i do it???
10x for the tips, everyone....

Richard Berg
3rd May 2005, 22:03
Moving to Usage...

manono
4th May 2005, 10:49
ChangeFPS(29.97)

No

or is DGPulldown useful

Yes.

Encode at 23.976fps, and then run DGPulldown afterwards using the default 23.976->29.97 setting.

SoulSmasher
4th May 2005, 14:26
10x for the tips everyone! i now do my encoding corectly witout anamorphic errors and desynchorisation...