View Full Version : 1080p MOV trailers to Xvid @ 4mbps
Razorholt
6th February 2007, 07:09
Hi All,
I'd like to turn some 1080p MOV trailers into a 1080p MKV files but at a silly rate of 4 mbps.
Here is my AVS script
*** UPDATED ***
QTinput("C:\Videoencode\sunshine\sunshine-tlra_h1080p.mov", audio=false)
fft3dfilter(plane=0, sigma=0.5)
ChangeFPS(23.98)
ConvertToYV12()
RemoveGrain(mode=1)
RemoveGrain(0,11)
BicubicResize(1920,800,0,0.5)
I'm using VirtualDudMod with the foillowing presets:
*** UPDATED ***
First pass
===================================
Zone Options
|
|--- Quantizer 3
|--- Chroma Optimizer Enabled
|--- BVOP Sensitivity: 0
Profile @ Level
|
|--- Quantization type: v3UL sounds great
|--- Adaptive Quantization
|--- B-VOPs: 2/1.62/0
|--- Packed bitstream
Quality Preset
|
|--- Motion Search: 5
|--- VHQ Mode: 1
|--- Tubo
|--- I-Frame: 100
|
|--- Quantization TAB: 3/5 3/6 3/6
Note: no QPel, no GMC, no VHQ for-b-frames, no chroma ME
*** UPDATED ***
Second pass
===================================
Zone Options
|
|--- Weight: 1
|--- Chroma Optimizer
|--- BVOP Sensitivity: 0
Profile @ Level
|
|--- Quantization type: v3UL sounds great
|--- Adaptive Quantization
|--- Quarter Pixel
|--- B-VOPs: 2/1.62/0
|--- Packed bitstream
Quality Preset
|
|--- Motion Search: 6
|--- VHQ Mode: 4
|--- Use Chroma Motion
|--- I-Frame: 100
|
|--- Quantization TAB: 3/5 3/6 3/6
Encoding Type
|
|--- Curve Compression: H5 / L5
I tried MANY matrices but I'm still happy with the results. It looks ok on TV but it doesn't look great throughout a projector
Which area(s) you think I should improve?
Thanks,
- Dan
foxyshadis
6th February 2007, 08:05
What is displeasing about it, exactly? Can you post screenshots or even short segments that highlight them? (LCDs are also good for seeing artifacts that CRTs don't really show.)
And have you ever tried playing the avs script direct, to ensure that it actually is xvid's fault, and not the trailer's? (If your system can't handle it in realtime, you can try encoding to a lossless file.)
Blue_MiSfit
6th February 2007, 09:30
It also looks like you're not using any b frames at all. Use them!!
4mbps is a bit low for 1080p imho :)
Maybe add some denoising to your script? I think it would help compressibility.
Also, you might want to look into the QTSource plugin for AviSynth, which bypasses the VFAPI bit of your script.
QTinput("1080p.mov", audio=true")
fft3dfilter(plane=3, sigme=2)
fft3dfilter(plane=0, sigma=1)
would be my suggestion of a place to start. Or maybe just one
fft3dfilter(plane=4, sigma=1)
That's one masochistic, slow script :) Render to a lossless avi first (if you can). It will save a lot of time :D
Also try x264, it might look better at 4mbit
~MiSfit
Razorholt
6th February 2007, 18:22
What is displeasing about it, exactly?
Kinda blocky, especially when there are some clouds... I will post a short sample in a few minutes.
If your system can't handle it in realtime, you can try encoding to a lossless file.
But the file will be too large, no?
QTinput("1080p.mov", audio=true")
fft3dfilter(plane=3, sigme=2)
fft3dfilter(plane=0, sigma=1)
would be my suggestion of a place to start. Or maybe just one
fft3dfilter(plane=4, sigma=1)
OK, I will try and encode with your recommendation. Why QTinput is better?
Thank you.
- Dan
Blue_MiSfit
7th February 2007, 10:19
It may or may not be better (or faster) I'm not sure about what colorspace conversions are involved with either method, but they use totally different approaches IIRC.
The lossless file will be gigantic, yes, but it will be perfect, filtered happiness that XviD can sink its claws into without being encumbered by pesky avisynth filters and similar ilk. :)
It may be faster in the long run this way, or maybe not... I'm inclined to think not, especially if you use fft3dgpu instead of fft3dfilter (assuming you have a powerful dx9 video card like a GeForce 7 series with 256+ MB of RAM).
Let us know how it goes! On the OT side, at 975 I'm getting close to the magic 1000 posts... hooray :D
~MiSfit
Razorholt
7th February 2007, 18:37
OK. I think I'm happy with my new script, based of your recommendation:
QTinput("C:\Videoencode\sunshine\sunshine-tlra_h1080p.mov", audio=false)
fft3dfilter(plane=2, sigma=4)
ChangeFPS(23.98)
ConvertToYV12()
RemoveGrain(mode=1)
RemoveGrain(0,11)
BicubicResize(1920,800,0,0.5)
I don't know whether I put the filters in the right order though. Maybe I should use the sharpen function within fft3dfilter instead of setting bicubicResize to 0.5 ... I dunno.
Thanks Blue_MiSfit! OT: I can post 25 more questions to help you reach the golden number ;)
HeadBangeR77
7th February 2007, 19:29
Sigma 4 for U-color plane?
If you want to increase compressibility, without loosing any details aprat from some filmgrain, you could also filter plane 0 with sigma 0.5-0.7.
The settings you've posted at the beginning are all wrong, if you really want to encode at the given resolution at 4 Mbits.
Razorholt
7th February 2007, 20:19
The settings you've posted at the beginning are all wrong, if you really want to encode at the given resolution at 4 Mbits.
Well, I'm listening :D
HeadBangeR77
7th February 2007, 20:31
Well, I'm listening :D
Here you are, pick up what seems best to you:
http://forum.doom9.org/showthread.php?t=119399
;)
B-frames either 2/1.62/0, as in the presets, or 2/1.50/1 as the default - the latter will aid the compression, but may produce some jumps in quality (hopefully not visible). For both passes the same settings.
B-VOPs sensitivity at 0, it will aid the compression, with no visible quality loss. Btw. where did you get those settings from? They are all messed up. :(
As to the matrice - try Soulhunter's V8, Sharktooth's V3 ULR / V3 LR, H.263 (the built-in one) or even Soulhunter's V6.
Curve Compression 5/5 won't do any harm, and can help (I wouldn't choose higher with your HD source).
When you've read the presets and still have questions, I will be there ;)
Btw. it's good to encode short samples, one pass, at constant qantizer and see how different matrices (or settings or both) influence the compression ratio and quality. ;)
cheers,
HDBR77
Razorholt
7th February 2007, 21:49
OK. I have upated my preset. Regarding the matrices, I did ran a test and here are the results:
Qyantizer 3, one pass:
6of9: 184,421 KB
BulletP-HQ: 126,812 KB
Soulhunter V8: 126,822 KB
Shark V3HR: 157,142 KB
Shark V3LR: 130,451 KB
Shark V3ULR: 109,365 KB
Razorholt
7th February 2007, 21:51
@HeadBangeR77: What ya think of my new settings? Shall I go ahead and get my machine busy?
Thanks,
- Dan
HeadBangeR77
7th February 2007, 22:52
@HeadBangeR77: What ya think of my new settings? Shall I go ahead and get my machine busy?
Thanks,
- Dan
Looks better now. :)
Well, it depends on whether it is a long encode or not. Before encoding with two passes I usually pick a larger sample, with both fast and low-motion scenes and try a 2-pass trial encode. But it's waste of time for some people, so you could go on and simply start encoding. ;) But don't sue me afterwards, if anything goes wrong. :D
Btw. I didn't know Sharktooth's V3 ULR was so compressable! :eek:
Probably because I don't use anything below Soulhunter's V6.
BigDid
7th February 2007, 23:08
... Btw. I didn't know Sharktooth's V3 ULR was so compressable! :eek:
Probably because I don't use anything below Soulhunter's V6.
Hi,
It is really but main problem being the kind of sharp effect and some haloing depending on settings and/or filters specially visible on LCD; see Sharktooth own comments: http://forum.doom9.org/showthread.php?p=889258#post889258
So In Autogk I went back to Jawor1cd (standard) for softmatrix.
Did
HeadBangeR77
7th February 2007, 23:19
@ BigDid:
I've just recalled that and wanted to write about it. The trick with sharp image was working but doesn't work anymore. That's all not my league, when it comes to quality, so thanks for pointing that out.
BigDid
7th February 2007, 23:25
...That's all not my league, when it comes to quality, so thanks for pointing that out.
You are welcome.
Wanted to add my favourites Cqm are (more compressible to less compressible):
JAwor1cd
EqmV2 (AGK sharpmatrix)
EQM HR Heini modded if I have bits to spare
... and H263 for anime.
Did
Blue_MiSfit
8th February 2007, 03:17
I would suggest the following:
your current script:
QTinput("C:\Videoencode\sunshine\sunshine-tlra_h1080p.mov", audio=false)
fft3dfilter(plane=2, sigma=4)
ChangeFPS(23.98)
ConvertToYV12()
RemoveGrain(mode=1)
RemoveGrain(0,11)
BicubicResize(1920,800,0,0.5)
Modified Script:
QTinput("C:\Videoencode\sunshine\sunshine-tlra_h1080p.mov", audio=false)
ConvertToYV12()
ChangeFPS(23.98)
fft3dfilter(plane=3, sigma=3)
RemoveGrain(mode=1)
RemoveGrain(0,11)
lanczosResize(1920,800)
That should help a bit. Notice the colorspace conversion first. Not sure why you are using changefps, you shouldn't need to...
For fft3dfilter - I suggest plane=3, because that way it will operate on both chroma planes. plane=4 works on all planes, and plane=0 only works on luma. Sigma=4 is pretty high... but of course, use it if it looks good to you :D
If you're going to sharpen with fft3dfilter, you really shouldn't sharpen the chroma planes IMHO. A second call like fft3dfilter(plane=0, sigma=1, sharpen=.5) will de-noise luma slightly and sharpen it a bit.
I also generally prefer lanczos resize, but bicubic at .5 is also good...
Not sure what the removegrain(0,11) does :)
also, removegrain(mode=1) following fft3dfilter is like dropping an antimatter bomb on a fly, and then hitting it with a toothpick :) It won't do much but eat CPU cycles:devil:
Anyway... just my 2 cents! Good luck, sounds like you've got some fun stuff to work with... <3 HD.
HeadBangeR77
8th February 2007, 03:41
@ Blue_MiSfit:
Three heads are better than two (;)), so let's discuss, 'cause I didn't have enough time to look at the avs precisely. I was concentrated more on the codec's settings, which were a terrible mess imo
1) I would throw away RemoveGrain, as you suggested, since fft3dfilter is more than enough.
2) I don't know the source, but I would (for the sake of compressability, since 4 Mbit/s is an exterme case for the given resolution imo)
- denoise luma slightly (plane=0, sigma=0.7) or a bit more (plane=0, sigma=0.7, sigma2=0.7, sigma3=1.0, sigma4=1.0), sth like that, with the emphasis on middle-low frequencies;
- denoise chroma more, as suggested (plane=3, sigma=2-3)
- use Spline16 instead of sharper Lanczos or Bicubic(b=0, c=0.5); should be more precise, yet a tad softer, what would help to compress more.
...and I've just run out of ideas, since I don't want to destroy the source.
3) If it's a QuickTime trailer, than the fps is strange in some cases: 24.570 fps. So he has to convert the video stream before dealing with audio.
OT : 4) 1080p - OMG! :D Sounds stupid, but I've just marked the input resolution for the first time. LOL. :D
Razorholt
8th February 2007, 08:59
fft3dfilter(plane=0, sigme=0.7)
fft3dfilter(plane=3, sigma=2)
This setting crashed VirtualDub...
So I'm using fft3dfilter(plane=0, sigme=0.7) only
Thanks guys!
foxyshadis
8th February 2007, 12:24
Latest version of fft3dfilter (http://avisynth.org.ru/fizick.html)? It's definitely worth having chroma cleaning, but a crash is bad. =o
Razorholt
8th February 2007, 17:19
:D
Thanks foxyshadis!
Blue_MiSfit
9th February 2007, 07:56
Did that fix it? Not sure what you meant :)
fft3dfilter definitely shouldn't crash.. unless of course you haven't got enough RAM.
Oh yeah, while you're at it, go ahead and add
setmemorymax(512) or something like that to the top of your script. I usually use 1/2 of system RAM.
~MiSfit
Razorholt
9th February 2007, 08:35
Yes, the latest version fixed it.
The encoding speed is not very impressive with the AVS script but the quality has improved, so... For a 2 minute trailer the first pass takes 45 minutes and the second one nearly 50 minutes. I have a AMD 64 processor - 3.4Ghz, with 1 GB RAM.
Also, Jawor's matrix looks better than V3ULR... but I know it is subjective.
Blue_MiSfit
10th February 2007, 02:32
That's why I suggest rendering to a HuffYUV file first. That way you can avoid having to re-run the avisynth script for the second pass.
I'd recommend it, if you have the extra space.
Razorholt
10th February 2007, 03:05
Ok... I have saved the MOV file in an uncompressed AVI format - from 128MB to 3GB... wow. So, I suppose I load the AVI file now, using the AVS script?
Thanks,
- Dan
EDIT: Oops, 6GB not 3GB. I uncompressed with "thousands of colors" instead of "millions of colors" at the first time. Hmmm 3GB per minute... fortunately I have a 500GB external HDD :)
Blue_MiSfit
10th February 2007, 08:10
Well, not uncompressed. HuffYUV, or Lagarith are both good uncompressed codecs that should be about 1/2 the size of raw uncompressed.
Yeah, load them via AviSynth, or just drop the AVI into VirtualDub and setup XviD from there...
Encoding should be a bit faster from these lossless sources in the long run :)
~MiSfit
Razorholt
11th February 2007, 08:24
Yup, definitely faster! :)
Thanks MiSfit,
HeadBangeR77
11th February 2007, 23:48
Yup, definitely faster! :)
Thanks MiSfit,
And, how is it going? 4Mibt/s with that resolution is quite a challange, so Jawor's 1-CD matrix might be the right choice. Have you tried any other low-bitrate highly compressable matrices?
cheers,
HDBR77
Razorholt
12th February 2007, 01:50
Have you tried any other low-bitrate highly compressable matrices?
Well, I like both Jawor's and V3URL - Yes, I'm aware of the "tricks" not working efficiently on LCD screen for the latter, but I still like it. Any other low-birate matrice I should try?
Thanks,
- Dan
Blue_MiSfit
12th February 2007, 08:07
post samples?
6of9 :D
j/k j/k...
Good old h263 works well in almost all situations.
~MiSfit
HeadBangeR77
12th February 2007, 22:34
Plus Fox Home Entertainment & Fox Home Entertainment New :D ;)
I agree that H.263 still does a good job for certain low-bitrate uses, which is the case here. The only other that comes to me mind atm is Soulhunter's V8. As I already wrote somewhere, this is not my league, and even Didee's SixOfNine has some problems with grain retention at Q2. :p
cheers,
HDBR77
PS. They have moved to another server! :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.