View Full Version : Convert 4:3 to 16:9
Cunhambebe
30th September 2006, 17:36
Hi there. I have a 20 second MPEG2 clip here - 4:3 (PAR 0,9091) - that I would like to convert to 16:9 (PAR 1,2121). Is that possible?
I would like to know if I can do this in AviSynth. Resizing the source using Lanczos would not work since the image would be stretched. I would simply like to crop the source instead.
So, I made a test here and used VDMod to find correct figures for this; I thought (0,60,0,-60) would do it all right. Unfortuntely, loading the result on my timeline (using Vegas, widescreen), made me conclude that the PAR had not changed so the source didn't match the properties of my project which is 16:9 (1,2121). Is there anyway to change the current PAR from 0,9091 to 1,2121? Is this correct what I'm doing?
Since I have Vegas here, I know I might load the original MPEG2 source in the timeline, configuring the properties for the project and using Huffyuv to reencode the file for future editing (RGB output). But I would like to do it in AviSynth (always trying to flee from color conversions).
One more thing.. Should I use ColorMatrix if the source is MPEG2 and the output is MPEG2? Thanks in advance.
LogicDeLuxe
30th September 2006, 20:17
The PAR does not change by applying a crop. You have to scale the image as well. You probably want to scale it to 480 lines after the cropping, asuming you are dealing with NTSC video.
foxyshadis
30th September 2006, 21:29
MPEG-2 defines stream clipping areas, doesn't it? Or Mpeg program streams, not sure. That would mean no re-encoding necessary, if it worked. Or do most players ignore that flag?
Cunhambebe
1st October 2006, 12:53
Thanks to you both who have replied.
The PAR does not change by applying a crop.
-Thanks, I know that.
You have to scale the image as well. You probably want to scale it to 480 lines after the cropping, asuming you are dealing with NTSC video.
-Yes, but how can I do it? Using Lanczos4 after cropping, as far as I know, does not work. When I open the final AVI (compressed using Huffyuv) in the timeline using Sony Vegas, for a 16:9 Widescreen project, some areas don't match the display (there are black bars on both sides).
foxushadis: thanks for your remarks... and question :D
LogicDeLuxe
1st October 2006, 15:07
You have to tell the MPEG2 encoder that you are dealing with a 16:9 clip.
Lanczos4 or any other scaler can be used for the resizing.
Cunhambebe
3rd October 2006, 03:35
Thanks for your help. I'm gonna try it again and reply as soon as I have the results here :)
Cunhambebe
6th October 2006, 03:23
OK, first of all, let me explain that I have changed the title of this topic, since I guess it wasn't too clear. The process with the video is not working, at least the way it should. In fact I'm trying to go from 4:3 to 16:9; that means, I wanna match that output aspect ratio. The source is 4:3, I have cropped and resized it with Lanczos4... Here's the script:
LoadPlugin("C:\unzipped\dgmpgdec148\DGDecode.dll")
LoadPlugin("C:\avs_filters\ColorMatrix\Release\colormatrix.dll")
LoadPlugin("C:\avs_filters\TomsMoComp\TomsMoComp_Avisynth\Debug\TomsMoComp.dll")
MPEG2Source("C:\birds.d2v")
ColorMatrix(mode="Rec.601->Rec.709")
TomsMoComp(1,5,1)
ConvertToRGB()
Crop(0,50,0,-50)
Lanczos4Resize(720,394)
Well, loading the result in Vegas (AVI compressed with Huffyuv), for a project configured as 16:9, show thin lines on the top and at the bottom of the scren, but only using a PAR of 1,000. Changing the PAR in Vegas to 1,2121 (changing the pixel aspect of the video) will narrow the visible area. Changing to 0,9091, will make black bars appears on both sides of the screen. Waht I need is a way to crop the image to make it match the visible area of 16:9 keeping the same PAR (0,9091).
So, waht I'd like to know is how I can simply match the output aspect ratio? Is that a filter for that besides Lanczos4? Lanczos resize the whole image from 4:3 to 16:9 which deforms the image. I would like to make it clear that I'm trying to encode from MPEG2 to AVI using Huffyuv, so I'd like to know also if I need Color Matrix this time (I guess so, isn't it?!)
Thanks in advance
*****************
Edit:
I've just found correct values for cropping: 480 - 120 = 360; 120 / 2 = 60
Crop (0,60,0,-60).... This time the image matches the project at 16:9 :)
Cunhambebe
7th October 2006, 13:58
Can anyone please help me witht the ColorMatrix filter? If I have to use it when I go from MPEG2 to AVI uncompressed using Huffyuv? Thanks in advance.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.