View Full Version : 16:9 to 4:3 conversion?
craigpro
4th September 2004, 04:46
Hi all,
I'm trying to convert some DVB-T recordings (MPEG2) and I'm able to successfully XVID them using GK when the video source and desired output is widescreen, with no troubles.
However, all DVB-T transmissions in Australia are 16:9, even if the show being broadcast is from a 4:3 video source. ie: there are black bars at the sides of the 4:3 image to 'pad it out' to a 16:9 image, and they are encoded into the transmission.
What I'm wanting to do is take the 720x576 PAL 16:9 source video and output it as 720x576 PAL 4:3, cropping off the black bars at the sides of the 16:9 image.
So far I've tried the cropping, auto-cropping, changing aspect ratio output etc.etc. with GK to no success - can anyone suggest how I should go about it please?
regards,
Craigpro
scharfis_brain
4th September 2004, 08:30
crop each 96 pixels left & right, so you get 528x576
then, blow 528x576 up to 768x576
so, in avisynth, it could look like following:
mpeg2source("dvb.d2v")
crop(96,0,-96,0)
lanczosresize(768,height)
craigpro
4th September 2004, 14:13
Thanks for that scharfis_brain,
I'm edit my GK settings and give it a try.
I'm a little curious as to the 768 horizontal width, I thought the broadcast hoz. width was 720?
Many thanks once again,
Craigpro
addition:
just trying an encode at the moment, I should see the results in a few hours. I discovered the 'clip' command in DGINdex (I have never played with any of the settings in GK before, and always left things on default) which also seems to set up the clipping as it is needed. Thankyou once again for your help.
second addition:
just got an error message:
"Avisynth Open Failure:
Crop: you cannot use crop to enlarge or 'shift' a clip"
guess the clipping in DGIndex won't do what I want it to do.
craigpro
13th September 2004, 02:22
well I've sort of had it working.
I can clip the sides off and resize, but I cannot stop GK from wanting to do a vertical resize as well. ie: I usually end up with a 720x544 image.
I don't want to convert the vertical resolution (if possible) just remove the side black bars encoded into the 16:9 broadcast image.
I've also tried using VirtualDub by itself to encode/remove the side bars but I kept getting error messages as mentioned previously.
Any help or ideas would be most appreciated. I would like to use GK if possiblem as it's so easy, but if there is a 'better' way to crop the sizes and not resize the video I would be happy.
Thank you,
Craigpro
manono
13th September 2004, 04:52
Hi-
It's really 16:9? That's what DGIndex says it is? In that case, scharfi's right and you should do what he says. You open it as 16:9 PAL in GKnot, do the left/right cropping and save the .avs. If you're getting 544 height, then use the up arrow under Width x Height to raise the resolution until you get 768x576. And even if you have trouble getting the proper resolution, you can always do a Save And Encode->Edit and change the resolution when creating the .avs.
Maybe you're using an older GKnot that doesn't allow the higher resolutions. In that case, upgrade your GKnot.
craigpro
13th September 2004, 10:10
hiya,
Yes, DGIndex says it's 16:9 (PAL 25fps, interlaced) 720x576
I'm using GK v0.32 beta
ok, where I'm getting lost is the GK RESOLUTION tab - my settings:
INPUT RESOLUTION is PAL,
INPUT PIXEL ASPECT RATIO is OTHER (768x576=1.001),
CROP before resize is set to PIXEL, 96 left, 96 right,
OUTPUT RESOLUTION is set to 528x576
I manually edited the *.AVS file to the following:
crop(96,0,-96,0)
lanczosresize(720,height)
well, it's going to take around 90minutes to process (AMD XP 2400+), so let's see how it goes.
Thanks for help Manono and Scharfis_brain, it is appreciated. All this tweaking and rendering is driving me mad.
Craigpro
manono
13th September 2004, 13:51
INPUT PIXEL ASPECT RATIO is OTHER (768x576=1.001)
If it's 16:9, then you set Input Pixel Aspect Ratio to PAL anamorphic (16:9). Scharfi's way will work (crop 96 from both sides to get 528 horizontal res, and then just change 528 to 768 in the .avs), but following the GKnot way may (and maybe not) make it easier to understand what's going on. If you have it set to 16:9, and then crop the 96 from both sides, and then either do the Width x Height thing I mentioned earlier, or just move the slider, then you'll see it comes out to be 768x576 (with the ITU box checked in the Options Tab of GKnot).
lanczosresize(720,height)
You said you wanted to keep the height unchanged, and if the height is 576, then 720 is incorrect. 576 x (4/3) = 768. You're creating a full screen 1.33:1 video by cropping the black bars from the right and left sides, and, again, 576 x 1.33... = 768. So, the one you're making at 720x576 (?) should have people looking slightly tall and skinny or stretched.
craigpro
13th September 2004, 14:41
Thanks Manono,
the 768 width makes sense now (to maintain the 4:3 aspect ratio for a vertical resolution of 576 lines), though I'm concerned if I watch my encodings back on a normal PAL TV (which has a horizontal resolution of 720 'pixels' (including overscan) that my 768 pixel wide XVID will lose details off the sides of the screen? Or will it be scaled down by the DVD player / XBOX Media Centre to fit the effective 720 pixels?
I wonder would it be possible for GK to have an option under the OUTPUT RESOLUTION section to select between PC output (different sized aspect ratio pixels and different gamma levels to a TV) and TV output? Or is that something that is done automatically by the MPEG4 capable DVD players?
I do apologise if these are stupid noob concerns and questions.
Craigpro
SeeMoreDigital
13th September 2004, 16:10
The BBC over here in the UK, often broadcast 4:3 images laid over a 16:9 background via digital. Sometimes the mattes are solid coloured or include coloured patterns!
One thing to take notice of. Usually, when you view these types of images on an 16:9 TV, they will appear to be slightly wider than "true" 4:3. This is because all the over-scan from the 4:3 image is incorporated into the 16:9 frame.
Cheers
manono
13th September 2004, 16:15
You most likely will lose part of the video, but not because of it being 768 instead of 720, but because of the TV's overscan. The picture does get scaled. This part's a little over my head, but my understanding is that computer pixels don't equate to TV resolution, unless you happen to have a fixed pixel display, which you don't have, if it's a normal standard interlaced TV set. But there are others around here that know much more about that subject than I.
In any event, to help compensate for the overscan, you might try something like this:
LanczosResize(752,564)
AddBorders(8,6,8,6)
That'll add 8 pixels of black to both the left and right sides, and 6 pixels of black to the top and bottom, and keep the correct AR (I think). But how much black you add depends partly on how much the overscan is, and depending on the TV, it can vary a lot.
...different sized aspect ratio pixels...
That's what the ITU box is all about in the Options Tab of GKnot. Keep it checked for TV watching.
...and different gamma levels to a TV...
In DGIndex, under Video-->YUV->RGB-->set for either PC or TV scale. In Q07 of the DVD2AVI FAQ (http://forum.doom9.org/showthread.php?s=&threadid=59272), it says:
YUVRGB_Scale: PC or TV scale. PC scale uses the full 0-255 values for Y (luminance), where TV scale uses the reduced - but TV suited 16-235.
Or you can add this line to the end of your .avs script:
ColorYUV(Opt="Coring")
Here's more information on that one:
http://www.avisynth.org/ColorYUV
The only thing noobish about those questions is that you may not realize just how contentious and oft discussed they are around here. I halfway expect to get challenged on some of what I've just written. But I like to learn too, and nothing ventured, nothing gained.
SeeMoreDigital
13th September 2004, 17:17
When generating your XviD encodes you may find specifiing the Display Aspect Ratio (DAR) setting in the XviD encoder useful.
Once set, Mpeg4 DAR should work in much the same way Mpeg2 DAR works (ie: the Mpeg4 stream should AR automatically and you wont realise it's happening). Currently however, you will need to manually install this test version of an XviD direct-show decoder (http://82.2.167.24/Uploaded_Files/Doom9_Forum_files/XviD_DSdec_filter_with_AR_detection.zip) for this to work!
Cheers
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.