Mencoder: Optimal Script with mencoder filters
After encoding the same movie in mencoder without filters (very fast) and with the latest optimal script for DVD (2~3 times slower). I decided to try to reproduce the optimal script using mencoder internal filters. What I did was basically:
1) encode the sample with M.A. script 2) encode with some filter combo 3) Check frame by frame the difference using stackhorizontal. 4) change my mencoder filter chain to make the output more like the Optimal Script Output and go back to step 2. After many tries, I came to a filter chain that gives results close (but still a little worse) than the optimal script. Also note that M.A. filering is not possible with mencoder. This filter chain is intended to low bitrate targets, like near 2 hours CVD. All the tests were done using 2 Pass VBR: vf=detc,yuvcsp,scale=336:336:0:0:60,unsharp=l3x3:0 .6,hqdn3d=3:6:8,unsharp=l3x3:-0.7:c3x3:-1.5,expand=352:480:-1:-1:1 ofps=23.976 fps=23.976 You have to change scale and expand to the correct values. (use fitcd or moviestacker to find out). If you examine the static optimal KVCD script and this filter chain, you'll see that they share the same idea. :D |
Brilliant :mrgreen:
I just encoded one of my samples again with this line, and this is almost as good as the MA script :D Now if I could just get mencoder to read my fake avi created with MakeAVIs :x Edit: But it's slow slow slow :lol: But that's to be expected :cool: -kwag |
Hmm,
That's all very nice. I once thought about that too. But from what do you encode the movie? From VOB? If so how can you make the whole movie? You'll get between 6 to 10 m2vs because that's around the amount of VOB files a DVD has. You join the m2vs in the end? From AVS script only with Mpeg2Source and have MEnc's internal filters do the job? C ya |
@Kwag,
Use only VM's build http://www.jltoca.uaivip.com.br/file...2004-fixed.zip. Otherwise you can't use makeAVIS :wink: Don't know what Vinicius did but it was great :D Cheers |
Quote:
-kwag |
Don't use makeAVIS that comes with latest FFdshow :!:
Use the old ones that came with FFvfw. I had the same problem today. I even had to remove FFdshow... Cheers |
Hi,
I'm talking with guys near to the developers at the official forum to see if they implement native support for avisynth scripts in Mencoder See it here http://article.gmane.org/gmane.comp....yer.cygwin/526 This makeAVIS thing is a real nightmare. It even crashes sometimes... Just imagine thousands of newbies complaining about that :wink: Cheers |
One very special rule to have makeAVIS work:
- choose your source script - choose your destination fake avi - tick the "store script in AVI" This last one is very important :!: Otherwise it won't work at all... Cheers |
Quote:
1) The lazy way: encode straight from DVD, with no need for ripping. Since you have a slow machine, I recommend you get some kind of cache if you intent to do that to avoid problems leaving your drive on for too much time. Anyway, encoding speed is slower when coming straight from DVD. But you have the option! Code:
mencoder -include kvcd.ini -lavcopts vbitrate=873:vpass=1 -dvd-device=F: dvd://TITLE -o encoded.m2v 2) Rip the VOBs using DVDDecrypter, but let it joint automatically: Go to Tools/Settings/IFO Mode and change File Splitting to none. This way DVDDecrypter will produce a big VOB and you just have to do: Code:
mencoder -include kvcd.ini -lavcopts vbitrate=873:vpass=1 VTS_01_01.VOB -o encoded.m2v Nice idea native support for avisynth (as an alternative), but I still think we should use the internal filters since they are 2~3 times faster and multiplatafrom. :D @kwag Use the package with MakeAVIS only, the link is in rds_correa begginers guide. That's the one I am using. The latest FFDShow didn't come with MakeAvis. You can use the AtlhonXP version if you have a AtlhonXP, Duron Morgan, Pentium III 1Ghz+ or Pentium IV. It's about 10% faster. :wink: For a 1:1.85 movie, being encoded at 352x480 using this filters, I get around 30 fps! 8O |
Quote:
Quote:
Thanks, -kwag |
I did a 1h48m encode to test this filtering with a Real-World example. The movie is "The Lawnmover Man", and it's 1:1.85 AR. The target: 352x480 CVD with 128 kbps audio in 1 80 min CD. The bitrate for that would be 873. I also asked for a Max_rate of 2500.
1st Pass: Average 833 kbps. 2nd Pass: Average 832 kbps. Averages smaller than asked generally means that quantisizer couldn't be lowered even more. This seems to be the case here, my average quantisizer in second pass was 2.53 (very close to 2, the minimmum). The maximmum bitrate was 2908. It's over the asked value, but maybe it's just a peak that is using VBV buffer. Or maybe it's a problem, but if this is the case it can possibly be fixed playing with rate control. Max quantisizer was 12.95, so mencoder did try to enforce max bitrate. Aspect in BV: we seen a quantization line with aproximatelly the same shape of the bitrate line. Normal behavior of 2pass VBR. I'll burn and check the quality in my stand-alone, and report back. |
Quote:
<edit> I watched the encode in my 29" TV. There are DCT blocks in low light areas. :( Most of the movie look good, this is the only problem. But this is a encode problem, not a filtering problem. I can think of two ways to improve this: 1) Encoding settings: I remember that Bilu proposed a special setting for low bitrate encodes 2) Add a little noise. This will make loss of compressibility but at least with this movie, there's bitrate to spare. :D |
filmdeint was not droppping frames and making the image jump up and down... I only realized wen I tried detc and saw the difference. So I replaced with detc. This should make the video more compressible and end the sync issues. :wink:
Also this is needed to avoid tons of framerate change messages: ofps=23.976 fps=23.976 <edit>In case anyone needs subs (like me), use this: sid=0 And replace 0 with the subtitle track number. :wink: <edit>Added -1:-1:1 to expand, otherwise subtitles keep overlapping. |
Quote:
Bilu |
Very nice vmesquita!,
I, as rds, had this in the to do list. But didn't decide to because was too lazy to read and understand the manpage, to look for the filters combo. But you, da man,... :lol: You say this is for KDVD encoding. But I don't really think there's a single optimal script for KDVD encoding. Sure your filter combo will be very good (I have to test). But there's also Dialhot suggestion (with fluxsmooth and tempcleaner, or with deen), kwag suggestion (just the MA part with unfilter and tempsmoother),... I tell you since we could (I'll try to also) make several filter chain and see what is better and faster for mencoder. Maybe mencoder benefits from an special combo of filters. And as you said, this was just (just?) the result of your work. With everybody help we can fine adjust it... if possible :wink: |
Quote:
If not, you would be encoding at 29.97fps, loosing a lot of quality. Then run pulldown (or use the internal softpulldown, I believe it's called ) -kwag |
Quote:
softpulldown isn't capable of creating MPEG-2 RFF flags like pulldown.exe It copies a field into the stream and it becomes hard-telecined 29.97fps. Of course IVTC works just the same over hard-telecined :) Bilu |
Ok, so then the correct way is as vmesquita posted, and then running pulldown.exe on the resulting .m2v file. :)
Which is the same process as if the file was encoded with ffmpeg. Well, actually, it is, because mencoder really uses libavcodec, so the result is identical to an ffmpeg encode :!: -kwag |
I'm doing -ofps 29.97 and softpulldown because it's multi-platform.
AFAIK there is nothing like pulldown.exe for Linux :? Bilu |
Quote:
Code:
type D:\vobs\*.vob|D:\mencoder\mencoder -include ... -vf ... -lavcopts ... -o D:\encoded\1pass.m2v - It's working for me. When encoding, mencoder complains in the begining: Code:
Reading from stdin... |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.