View Full Version : How to improve the quality in this case?
e-Pawel
25th April 2007, 10:33
Hy,
recently I tried to backup "Gladiator". That's how my script looks:
LoadPlugin("DGDecode.dll")
video = MPEG2Source("Gladiator.d2v")
audio = DirectShowSource("Gladiator.ac3")
AudioDub(video, audio)
Lanczos4Resize(720,404)
Crop(0,52,-0,-48)
Deblock()
I used these settings in Xvid:
Bitrate ~940 kbit/s, 2-pass enc., Adaptive Quantization, QPel, Ultra High motion search precision, Chroma motion and VHQ for b-frames (the other options were left as default)
And that's the result:
http://img187.imageshack.us/img187/7854/gladiator1cn7.th.jpg (http://img187.imageshack.us/my.php?image=gladiator1cn7.jpg)
http://img225.imageshack.us/img225/2226/gladiator2of9.th.jpg (http://img225.imageshack.us/my.php?image=gladiator2of9.jpg)
The first picture isn't very smooth and there are some artifacts around the gladiator's bodies. And in the second picture you can see some ulgy artifacts too - around Russel Crowe's head. Maybe you can't see it very well on a steady frame, but when it's moving it's visible quite intensive.
My question: do you have some ideas how to improve the quality? I want to let the picture look smoother and reduce the artifacts. But when I set a stronger deblocker it just looks like it's painted with oil paint (but doesn't improve the quality).
Bye for now, Pawel
ToS_Maverick
25th April 2007, 11:19
what matrix did you use? you didn't mention one, so i assume you used h263.
you could try this:
- try x264
- do a comp-check
- lower the resolution
- have a look at the xvid-presets thread
have fun with encoding ;)
e-Pawel
25th April 2007, 11:43
what matrix did you use? you didn't mention one, so i assume you used h263.
you could try this:
- try x264
- do a comp-check
- lower the resolution
- have a look at the xvid-presets thread
have fun with encoding ;)
Yes, I used the default h264 matrix (it's recommended for 1-cd-backups -> bitrate 800-1000 kbps)
1. I already have tried to encode it with x264. The quality is much better, but obviously x264 also has its difficulties with encoding this footage. (anyway I want to use MPEG4 ASP) So I'm looking for something to make the footage easier to encode.
2. What is a comp-check?
3. Curiously lowering the resolution doesn't help a lot (ok it helps a bit, but I expected more). Another question: even with 720 x 304 it doesn't look really sharp. I found another movie (608 x 320) and inspite of the less amount of pixels it looks sharper. Is it possible, that my MPEG2-decoder produces bad picture quality?
Pawel
P.S. Is it OK when I get (with those settings but a resolution of 640 x 272) about 35 fps in the first pass, and in the second pass about 22 fps (A64 3200+, GFX 5500 256 MB video memory)?
henryho_hk
25th April 2007, 13:58
1) If it is a FILM footage, try force film in DGIndex.
2) Deblock before crop or resize (dgdecode can deblock in progressive and interlaced mode; pick the right one).
3) If it is an interlaced footage, deinterlace it with proper field order, again, before crop or resize
4) crop and/or resize (you can do them at the same time)
5) optionally, apply some denoising
6) optionally, apply some sharpening (your target bitrate is too low for this).
7) A MUST :- read the XviD Preset thread.
Blue_MiSfit
25th April 2007, 20:16
It's a tough source.
Definitely resize to 640xwhatever.
Definitely enable force film in DGIndex if you didn't already.
Also, I would suggest a CQM like Jawor's 1cd, or maybe Sharktooth's EQM-V3LR or ULR.
De-noising will probably help a lot. It will slow you down but it will help.
Here's a sample (my usual starting place)
fft3dfilter(plane=3, sigma=2) #Denoise chroma
fft3dfilter(plane=0, sigma=.8, sharpen=.4) #Denoise and sharpen luma
Adjust the sigma values - higher for more denoising. The luma will produce more visible results. Adjust the sharpen value, lower for less ringing, and higher for more detail.
You can also try DeGrainMedian, or MVDegrain.
Put VHQ to 4, and increase B-frames to 3, maybe change the ratio to 2, and the offset to 0.
And of course, increase the bitrate :) What is your size constraint?
Also, at the end of the second pass, how does your quantizer distribution look like (from the xvid stats graph)? Post a screnshot of that :)
Also, post screenshots in PNG. JPEGs are compressed again, which is esentially pointless. Post a sample piece of the original VOBs (10-20 seconds or so) in high motion, and maybe a sample of your encoded result so far as well.
~MiSfit
movmasty
29th April 2007, 21:20
Hy,
recently I tried to backup "Gladiator". That's how my script looks:
LoadPlugin("DGDecode.dll")
video = MPEG2Source("Gladiator.d2v")
audio = DirectShowSource("Gladiator.ac3")
AudioDub(video, audio)
Lanczos4Resize(720,404)
Crop(0,52,-0,-48)
Deblock()
I used these settings in Xvid:
Bitrate ~940 kbit/s, 2-pass enc., Adaptive Quantization, QPel, Ultra High motion search precision, Chroma motion and VHQ for b-frames (the other options were left as default)
And that's the result:
http://img187.imageshack.us/img187/7854/gladiator1cn7.th.jpg (http://img187.imageshack.us/my.php?image=gladiator1cn7.jpg)
http://img225.imageshack.us/img225/2226/gladiator2of9.th.jpg (http://img225.imageshack.us/my.php?image=gladiator2of9.jpg)
The first picture isn't very smooth and there are some artifacts around the gladiator's bodies. And in the second picture you can see some ulgy artifacts too - around Russel Crowe's head. Maybe you can't see it very well on a steady frame, but when it's moving it's visible quite intensive.
My question: do you have some ideas how to improve the quality? I want to let the picture look smoother and reduce the artifacts. But when I set a stronger deblocker it just looks like it's painted with oil paint (but doesn't improve the quality).
Bye for now, Pawel
Resizing is wrong, should be 720x396, then try to crop 58 and 50 --->288
you could also crop 16 px at sides, 704x288
But this res, and for a movie like gladiator, is too much for 940kb
but since it is well over 1G, why you say '1 CD'?
you'd need 1200 kb at least, and use neutral bicubic instead of lanczoz, and with mpeg matrix,
Lanczos has the effect to not reducing file size with res, also if you resize at 640.
Furthermore the association of Lanczos and H263 is a nonsense.
Then deblocking is to do before resize, that alters all the blocks placement, and to improve quality at a certain rate set VHQ to 4 or 3.
But maybe you dont need it with a good mpeg2 source.
e-Pawel
30th April 2007, 11:28
Thanks for all your replies!
Definitely enable force film in DGIndex if you didn't already.
But when I enable that option, DGIndex shows:
"It's almost always wrong to Force Film on an MPEG1 stream, or a stream with a frame rate other than 29.970. Your stream is MPEG2 and has a frame rate of 25.000. Do you want to do it anyway?" After that my footage has only 20 fps.
Also, I would suggest a CQM like Jawor's 1cd, or maybe Sharktooth's EQM-V3LR or ULR.
Where to download these matrices and what is their advantage?
De-noising will probably help a lot. It will slow you down but it will help.
Here's a sample (my usual starting place)
fft3dfilter(plane=3, sigma=2) #Denoise chroma
fft3dfilter(plane=0, sigma=.8, sharpen=.4) #Denoise and sharpen luma
Adjust the sigma values - higher for more denoising. The luma will produce more visible results. Adjust the sharpen value, lower for less ringing, and higher for more detail.
You can also try DeGrainMedian, or MVDegrain.
It extremly slows down the encoding - I get only 3-5 fps (instead of 17-30 fps).
And of course, increase the bitrate :) What is your size constraint?
First, I wanted to squeeze the entire movie to 1 cd. But then I realized that the bitrate I would have to set is ~580 kbps incl. audio (or 1160 kbps incl. audio when compressing to 2 cds). Now I bought a DL-DVD and decided to make a 1:1 backup - but I still just want to know how other people achive such a great quality at bitrates of about 950 kbps. That's why I'm still toying around with this footage :)
Also, at the end of the second pass, how does your quantizer distribution look like (from the xvid stats graph)? Post a screnshot of that :)
http://img260.imageshack.us/img260/3188/xvidgladiatorrc8.th.jpg (http://img260.imageshack.us/my.php?image=xvidgladiatorrc8.jpg)
(BicubicResize, 640x272)
Also, post screenshots in PNG. JPEGs are compressed again, which is esentially pointless. Post a sample piece of the original VOBs (10-20 seconds or so) in high motion, and maybe a sample of your encoded result so far as well.
I set the highest JPEG quality level when saving the picture so it shouldn't have affected the result. How to extract a piece of the VOB file?
And how to perform that comp-check? I downloaded this application (Enc 1.03) but it still shows: "[Error] Predicted size = 0 Ct 5% (Extended) 950 KBit/Sec XviD (xvid) C:\Dokumente und Einstellungen\Rodzinka\Eigene Dateien\Pawel\gladiator.avs C:\Programme\VirtualDubMod\VirtualDubMod.exe (FR)"
Bye, Pawel
Soulhunter
30th April 2007, 13:33
It extremly slows down the encoding - I get only 3-5 fps (instead of 17-30 fps).
If you want something faster try DCTFun4b (http://mf.creations.nl/avs/filters/dctfun4b.dll) to gain some compression...
DCTFun4b(LumaThresholdFloat,ChromaThresholdFloat)
Also, use a low bitrate CQM or x264 instead of XviD for such low bitrates!
Bye
movmasty
30th April 2007, 13:57
First, I wanted to squeeze the entire movie to 1 cd. But then I realized that the bitrate I would have to set is ~580 kbps incl. audio (or 1160 kbps incl. audio when compressing to 2 cds). Now I bought a DL-DVD and decided to make a 1:1 backup - but I still just want to know how other people achive such a great quality at bitrates of about 950 kbps. That's why I'm still toying around with this footage :)
http://img260.imageshack.us/img260/3188/xvidgladiatorrc8.th.jpg (http://img260.imageshack.us/my.php?image=xvidgladiatorrc8.jpg)
(BicubicResize, 640x272)
That is a VERY low quality compression, dont understand, gladiator at 640x272 should not give a so low quality with 940kb
It is true that first frames gets compressed more so better that you capture after frame 5000
I used these settings in Xvid:
Bitrate ~940 kbit/s, 2-pass enc., Adaptive Quantization, QPel, Ultra High motion search precision, Chroma motion and VHQ for b-frames (the other options were left as default)
You MUST do something wrong, try to save a clip uncompressed or motion jpg, then try to encode directly in vdub, without avisynt.
try to switch to normal recompress, fast doesnt work with all sources
e-Pawel
30th April 2007, 14:05
That is a VERY low quality compression, dont understand, gladiator at 640x272 should not give a so low quality with 940kb
It is true that first frames gets compressed more so better that you capture after frame 5000
You MUST do something wrong, try to save a clip uncompressed or motion jpg, then try to encode directly in vdub, without avisynt.
try to switch to normal recompress, fast doesnt work with all sources
For my testing purposes I take only an extract that is about 2000 frames long (but I must admit that there's a lot of motion in that extract - maybe that's the reason for the bad quality).
I would like you to try to make it better, but I need to know how to extract a short chapter (as Blue_MiSfit mentioned).
movmasty
30th April 2007, 14:52
With smart ripper, just save a cell, or with range in avisynt
then if your clip is all fast motion and not average, give it 1200kb for an average movie of 940.
Blue_MiSfit
30th April 2007, 20:09
No, if you want to trim a clip from the source, you can use DGIndex to load up a VOB, set an in and out point with the [ and ] buttons, and do a file -> save and demux to get a small M2V. Post this somewhere.
JPEGs at any quality are still lossy and can introduce artifacts that are not in the source. PNGs are the way to go. For sure.
You MUST do something wrong, try to save a clip uncompressed or motion jpg, then try to encode directly in vdub, without avisynt.
try to switch to normal recompress, fast doesnt work with all sources
Not true. If it's a DVD, then it has YV12 color, and unless you do some silly colorspace conversion in AviSynth then Virtualdub and Xvid will want YV12. Fast recompress assures this.
It extremly slows down the encoding - I get only 3-5 fps (instead of 17-30 fps).
Yep. That's how denoisers work :) Quality and speed are generally inversely proportional. if you have a good video card (pixel shaders 2.0) then you can use fft3dgpu instead of fft3dfilter for a big speed boost. There are also other filters that you can use. At a bare minimum, RemoveGrain(mode=1) should be used. It's a faster UnDot() which will kill stray pixels.
Now I bought a DL-DVD and decided to make a 1:1 backup - but I still just want to know how other people achive such a great quality at bitrates of about 950 kbps. That's why I'm still toying around with this footage
A DL shouldn't be necessary :) A standard DVD+/-R should be more than enough to keep full resolution (half of one even). Gladiator is a very tough source, no doubt about it.
Using a high compression matrix like Jawor's 1cd will avoid blocking by slightly softening the picture, and introducing a bit of ringing. h263 is very soft, and MPEG is pretty sharp.. I find Sharktooth's EQM series to be very pleasing to my eyes.
But when I enable that option, DGIndex shows:
"It's almost always wrong to Force Film on an MPEG1 stream, or a stream with a frame rate other than 29.970. Your stream is MPEG2 and has a frame rate of 25.000. Do you want to do it anyway?" After that my footage has only 20 fps.
Looks like you have a PAL source. I didn't realize this :) I've never worked with a PAL DVD, so I'm not sure how to recover the original 23.976.. Surely someone else can tell you.
And yes, the stats image you provided shows a pretty nasty quantizer distribution. The name of the game should be more b-frames (3 max), max out VHQ, denoise, and use a soft resize filter with a custom quant matrix.
Good luck, keep us informed.
I would really suggest giving x264 a try. It's damned good.
~MiSfit
e-Pawel
6th May 2007, 14:53
OK, here you are!
An extract from the original VOB file (divided up into 3 rar archives):
http://www.speedyshare.com/159500369.html - part 1
http://www.speedyshare.com/176796890.html - part 2
http://www.speedyshare.com/279551408.html - part 3
My xvid encode:
http://www.speedyshare.com/302766398.html
xvid stats:
http://img69.imageshack.us/img69/7940/xvidpv2.th.jpg (http://img69.imageshack.us/my.php?image=xvidpv2.jpg)
My x264 encode:
http://www.speedyshare.com/748361927.html
x264 stats file:
www.e-pawel.de/gladiator.avs.txt
Have fun ;) Hope you will make it better than I did :)
e-Pawel
1st June 2007, 15:55
No one wants to make a try?
What's about you, Blue_MiSfit ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.