Log in

View Full Version : How to encode 480x576i to XviD 4:3 w/o resizing and losing sharpness?


MovieBoy
8th July 2007, 06:53
Hi!

I have interlaced video 480x576. Can I make a progressive XviD 4:3 without changing resolution? The result gets too blurry (even at high bitrates > 1000 kbps) if i convert it to 640x480 or 448x336. The source has good quality, of course.
Or probably is it not the resizing but the quantization? I always get that blurry/unsharp encodes.

Settings I use in GKnot:

Resize filter: Lanczos (sharp)
Field operations: Kernel Deinterlace
Quantization type: H.263

Thanks in advance for your help! Would be glad to know the way how to make my encodes crisp sharp.

Blue_MiSfit
8th July 2007, 10:11
Well, if you're after sharpness, avoid using plain h263 quantization. Try MPEG, or if you're adventurous, one of the many CQMs. EQM-V3 is a favorite series of mine, as is didee's SixOfNine (at very high bitrates)

Also try different deinterlacing methods. TDeint, MVBob, YADIF, LeakKernelDeint etc are all good deinterlacers.

You can also try adding some sharpening with something like LimitedSharpenFaster or SeeSaw.

I always try to work in fft3dgpu / fft3dfilter (usually at low settings), as these filters seem to give a bit of free magic to most of my encodes. The way I see it, if I tune this filter correctly, I get more compressibilty, so that more bits can be spent on details. Within limits of course.. It can create banding or perhaps reveal banding in the source that's normally concealed by noise. The sharpen parameter is also handy (on luma), and can help when not using a dedicated sharpener.

Remember of course that changing CQMs, adding sharpening etc can all affect the compressibility, so you may need more bitrate than you're accustomed to..

~MiSfit

Teegedeck
8th July 2007, 10:26
I agree with Blue_MiSfit. :)

Also: In order to completely avoid resizing you could define an aspect ratio. The easiest way would be to use the MKV container - mkvmerge lets you input the desired output size directly (like 720x576).

duebel13
26th July 2008, 18:16
Sorry for bringing up this old thread again.

I've been using a combination of GKnot, avs2avi, and VDubMod now for some time and also prefer to keep the pixel resolution and aspect ratio of the source stream.

When to use this:

- You're encoding for TV viewing on an analog screen
- Your DVD player (SAP) supports aspect ratio setting in AVI's

When not to use this:

- You're encoding for viewing on digital output devices (PC)
- Your DVD player (SAP) does not supports aspect ratio settings in AVI's
- You don't like other pixel aspect ratio than 1:1 square pixels

You can do it like this:

1) GKnot / DGIndex: Demux the file (F5 / ESC / F4)

Write down the following information:

- image size (e.g. 720 x 576)
- display aspect ratio (4:3 / 16:9)
- PAL / NTSC
- progressive / interlaced TFF / interlaced BFF

If the movie is interlaced open the source in ReStream and verify the following information:

- Top Field First / Bottom Field First

2) Open the d2v file in GKnot (not AutoGK) and take a look at the preview. Are there any black bars?

Now go directly to the Resolution tab (you can ignore all the other tabs). Make sure the following options are checked:

- Input Resolution: other (showing original size)
- Input Pixel Aspect Ratio: 1:1 (!)
- Output Resolution: Set: H-Modul = 8, V-Modul = 8
- Crop (before resize!): disable (there are no black bars), otherwise do Smart Crop and adjust upper and lower value so that Aspect Error = 0; make sure not to crop left and right (set manually to 0 if changed by Smart Crop)

- Switch to preview, click [Save & Encode],

- check deinterlace option as you prefer
- only click [save] when you are actually resizing (from DVD to SVCD, for example)
- otherwise click [edit] and comment out the Line with LancosResize(), then save the avs to disk

3) Open the encoder of your choice (I'm happy with avs2avidemo, but you may use VDub or any other encoder which can take an AVS Script for input) and load the AVS file.

4) Configure the XviD encoder to your liking (I just switched to 1-pass encoding with Q=3 or Q=4, but that's personal taste), click on the [more] button right beside Profile @ Level.

On the Aspect Ratio tab, select "Custom" Pixel Aspect Ratio with one of the following X/Y values:

128/78 (SVCD PAL 4:3)
155/78 (SVCD PAL 16:9)
108/79 (SVCD NTSC 4:3)
157/79 (SVCD NTSC 16:9)

My personal taste is to not deinterlace and to do an interlaced encoding (remember we are encoding for quality TV output). Make sure to check (x) Interlaced Encoding and (x) Top field first - you did verify that with ReStream, right?

5) Run the Encoder

6) Open the avi in VirtualDubMod, add the audio stream, then click on Save as

- Check [x] Save AVI in old 1.0 (VfW 1.1e) format (Compatibility Mode)
- Select Video mode: Direct stream copy

Save ... done.

The result is an AVI video with the exact SAR, PAR and DAR as the source - just what you asked for :-)

Open the file in GSpot to verify this, it will show you file is already in SVCD format.

Open the file in your favourite player to see if the aspect ratio is correct (note: VLC does it right, Media Player Classic seems to ignore the PAR).

In case you used the wrong X/Y values simply use Moitah's MPEGModifier to fix the avi header value - no need to reencode. BTW, this is the reason why you selected old AVI 1.0 mode - you did that, right?

Please note that you can use more than one audio stream, add subtitles and so on - no need to switch to mkv which most SAP do not support.

Regards