PDA

View Full Version : Crop/Borders/Resize Help Needed PLEASE


Laughlyn
22nd November 2003, 13:08
Hi.
Like a lot of people, I've had problems displaying my encoded video properly on my TV (due to overscan, I'm told).

I set about looking for information on cropping/resizing/borders/etc, but can't seem to find quite the details I'm looking for. :(

Basically, my problem is this:
I have my source, which is 640x480 (CG Animation). What I want to do is *ADD* borders around all sides of the video, effectively increasing its resolution to 672x504. At that point I would re-encode the file to the necessary VCD or SVCD requirements at the time.

The closest mention I've found is by use of the clipping filters in TMPGEnc, but unless I'm mistaken, those filters are not *adding* a border to the total image, but rather cropping edges off the image, which is not what I want.

I need to be able to retain the entire source aspect, while adding "padding" to the outer edges.

If anyone could PLEASE describe to me the proper way to do this, or at least point me in a direction, I would be very grateful!! This little problem is the only thing standing in the way of my encodes right now....

Kedirekin
22nd November 2003, 13:58
640x480 on a PC normally means an display aspect ratios (DAR) of 4:3. You want to preserve that.

For SVCD, 480x480 (or 480x576 for PAL) will give you a DAR of 4:3. If you find that confusing, it just means that the player scales the 480x480 image to 4:3 aspect on playback.

For VCD, 352x240 (or 352x288 for PAL, IIRC) is the 4:3 resolution.

That gives you resize without taking into account adding borders for overscan.

Now, adding borders for overscan is a little more challenging. Every TV potentially has a different amount of overscan. Many newer HDTVs (LCD and plasma being perfect examples) have no overscan. So there is no one set of borders that will work perfectly for all Televisions.

That said, I'd recommend adding borders on macroblock boundaries to maximize encoder effeciency. That means adding 16 or 32 pixel borders all the way around the picture (after resize). And of course that means resizing smaller so that the end resolution *after* adding borders ends up being 480x480 or 352x240. For example, if you want to add 32 pixel borders to an SVCD, you need to resize to 416x416, then add the borders.

On VCD, adding 16 pixel borders will probably result in visible borders all the way around when watching on TV. What I mean is 16 pixel borders will fill the overscan and then some.

On SVCD, 16 pixel borders will not be visible on many TVs (their overscan is greater than 16 pixels), but on some TVs they will be visible. 32 pixel borders will be visible on most TVs.

There are a variety of ways to add borders to an image. I strongly recommend using AddBorders in an AviSynth script.

Laughlyn
22nd November 2003, 14:32
Thanks for the assist and explanation. :)
I'm now in the process of locating some manner of guide for AVISynth that describes this process.

My encoding attempts thus far have been done solely with TMPGEnc Plus, VCD Easy and VirtualDub for my audio... I've not yet used AVISynth for anything...

Assuming I don't find one first, could you perhaps point me to a guide that would help me with this process, or at least the AVISynth portion of it?

manono
22nd November 2003, 14:39
Hi-

I use FitCD (http://mitglied.lycos.de/fitcd/) for my Cropping/Resizing/AddBorders for SVCD. For NTSC, your example gives me:

LanczosResize(448,448)
AddBorders(16,16,16,16)

Resize first, and then AddBorders. That's for adding 16 pixels all around, which is usually a good choice for TVs without any of the black showing when playing it back. But as Kedireken says,the amount of overscan TVs have will vary. You can run some tests to see if that's good enough for you.

By the way, if you use DVD2SVCD with the AutoFitCD Plugin, this will be taken care of automatically (as well as the AviSynth stuff). It has an AVI2SVCD section to it. And you can also do VCDs.

By the way, Kedirekin, my DLP HDTV (Samsung HLN4365W) has overscan.

Laughlyn
22nd November 2003, 17:03
Again guys, thanks for the tips. :)

The AVISynth/FitCD settings seem to be doing the job video wise...
But as always, if I fix one thing, two more pop up... :|

However, I'm attempting to use these options with DVD2SVCD (using TMPGEnc, not CCE...had problems getting CCE to run properly), as suggested, but am running into a new problem. It seems that DVD2SVCD is wanting to take my 15fps AVI source and convert it 23.976fps...which wouldn't be so bad, I suppose, but DVD2SVCD isn't running/applying the Pulldown to it like it should. :|

My end result is a file in which the video and audio are running about 1/3 faster than they should be. Or at least that's what it looks/sounds like in PowerDVD.

I've not been able to find an option in the DVD2SVCD GUI to set my needed framerate...although I'm sure it must at least be in the INI files somewhere....not that I've been able to find it there, either.

Also tried to figure out how to get AVISynth to work with TMPG without the use of DVD2SVCD, but only succeeded in getting myself more confused.

So, basically, now what I need is either:
A) how to alter the framerate that DVD2SVCD is attempting by default,
or
B) Simple, quick-and-dirty directions on getting AVISynth (with these resize/border options) to collaberate with TMPG.

And then just pray nothing else goes awry.... :|

Laughlyn
22nd November 2003, 17:29
Okay....fumbling through it. lol
Figured out where to adjust the framerate...re-encoding my video stream with TMPG now. Then I guess I've just got to mux it with the audio and hope it works....

killingspree
22nd November 2003, 17:45
you can only create SVCDs at either standard PAL (25 fps) or standard NTSC (23.97/29.97 fps) because they have to be compatible with standalone players. those would most likely not be able to play a SVCD with a different framerate correctly. so when aiming for an SVCD (or of course VCD) you'll have to accept that there are quite a lot of frames added to the video which, although you don't seem to be troubled by it, isn't too good in general, as you'll of course loose a lot of bitrate on duplicated frames and will also get some less smooth playback. anyway, as i said above there's not much you can do about it if you need it to be on SVCD!

steVe

Kedirekin
22nd November 2003, 22:36
Too bad you can't just apply RFF/TFF to double the playback framerate (like pulldown, but 2:1 rather then 5:4). That would really use bitrate efficiently, though I don't know if such a thing would be SVCD compliant.

Incidentally, I don't believe 23.976 is a valid VCD framerate. I don't believe pulldown is valid on VCD, so NTSC VCD *has* to be encoded at 29.97 fps.

In any case, it's probably easier and smoother to duplicate each frame, increasing the framerate to 30 fps, then use AssumeFPS to force it to 29.97. Not sure if you'd need to adjust the audio - depends how long your clips are.

You could do some complicated manipulation to increase it to 24 fps, use AssumeFPS to force it to 23.976, then apply pulldown after encoding, but the inconsistent frame duplication combined with pulldown would probably result in slightly stuttery playback (perhaps barely noticable, but there none-the-less).

@manono
Interesting that your DLP has overscan. I suppose, since it's projection/reflection based, they have to use an optical screen to prevent stray light leakage around the edges of the picture. I'm fairly sure the underlying light processor chip has no overscan (unless it's some non-standard resolution like 996x742 - I'm not sure how they make those things).

I wonder if LCD based projectors (projection/transmission based) have overscan. I suppose they probably do. They probably have the same problem with light leaking around the edges of the LCD.

Laughlyn
22nd November 2003, 23:10
Well, in regards to the framerate... I did manage my way around that problem (actually, the problem was the AssumeFPS line itself....removed it, and continued my encoding normally, and everything is peachy)

TMPG has no problems taking my 15fps source and spitting out a clean, gorgeous 29.97fps MPEG-2 file. The interesting thing I've noticed though is this...

All of my varied attempts to extract and encode the audio and video separately, then mux them afterwards, have all failed miserably...something I feel has to do with the audio (as the m2v files *appear* to play normally prior ro muxing). This includes attempts before all this resizing and bordering.

However, if load the AVS script for the video into TMPG, *AND* let encode the audio from the source as well...it works just fine. :| Wish I knew what the heck I've been doing wrong with the muxing, as I'd like to move from SVCD to DVD-compliant with AC3 and/or DTS before long...and that's something I doubt I can do without figuring out the muxing probs....

Oh, and as far as the resizing issues that started this thread.... Everything seems to be working great now. :) I'll be dragging a couple discs to a friend's house later tonight to try it out on a few different standalones and tvs....

Thanks for all the help. :)