View Full Version : Mencoder encode seems slow
jdlk
8th March 2007, 17:31
I'm experimenting with Mencoder. Quality is good, but my encodes (using the command line below) seem very slow - less than 4fps on the second pass, about 9fps on the 1st. When I tried VHQ4, 2nd pass dropped to less than 2fps!
Am I just hoping for too much? Are the speeds appropriate? My machine's reasonable (Sempron 2800+, 1GB RAM). Any advice appreciated.
Without going too close to "what is best" territory, if I do want to speed up encodes, are there options below which could be adjusted to give noteable speed increases without too much impact on quality?
In case it's relevant, quant_intra_matrix and quant_inter_matrix load EQM V3LR. Original file is MPEG2 720x576 PAL, not resizing in encode..
PASS1
-ovc xvid
-xvidencopts
quant_type=mpeg:quant_intra_matrix=intra1.txt:quant_inter_matrix=inter1.txt
pass=1 turbo=1 min_iquant=3 min_pquant=3 min_bquant=3 overflow_control_strength=10
overflow_improvement=10 max_overflow_degradation=10 max_bframes=1
vhq=1 par=pal169 -oac mp3lame -lameopts vbr=0 br=128
-passlogfile "%%~dpi%%~ni".log -o NUL
PASS2
-ovc xvid -passlogfile "%%~dpi%%~ni".log
-xvidencopts
quant_type=mpeg:quant_intra_matrix=intra1.txt:quant_inter_matrix=inter1.txt
pass=2 min_iquant=3 min_pquant=3 min_bquant=3
bitrate=1500:me_quality=6 overflow_control_strength=10
max_overflow_improvement=10 max_overflow_degradation=10
vhq=1 max_bframes=1 par=pal169
-oac mp3lame -lameopts vbr=0 br=128 -o "%%~dpi%%~ni".avi
HeadBangeR77
9th March 2007, 02:24
You're about as slow as I am with my upsizing scripts, packed with various filters (including Deblock_QED, fft3dfilter denoising + de-halo etc.), so I guess sth is wrong either with your OS in general, codec's installation or perhaps Mencoder itself (?)
Btw. me_quality=6 in the 2nd pass, and what's your motion estimation precision in the first pass? I can't see it in the command line.
cheers,
HDBR77
PS. Athlon XP-M @ 11x220, 2x512MB TCCD
jdlk
9th March 2007, 04:16
HDBR77,
Thanks for a very helpful reply. I was using the latest build of Mencoder downloaded from the MPlayer site.
I had a dig around on my hard disk and came across an alternative Mencoder build that came with the MediaCoder GUI, which I was trialling.
The MediaCoder Mencoder build was (a) half the size (about 4.5MB v 9MB) and (b) is giving encoding speeds of 25fps (1st pass) and about 15fps (2nd pass).
Why would this be? I can understand minor differences between builds, but this suggests the official build might be broken. Or that the MediaCoder build might not be functioning properly. Or maybe it's my machine. Who knows?
I haven't had a chance to compare quality yet, but the MediaCoder build does seem to have picked up all my Xvid options including the custom matrix.
Is there a list anywhere on this site of "recommended builds", i.e. builds that have proven to be reliable?
Edit: I downloaded the Athlon-specific Mencoder build from Celtic Druid's page, and that's giving me similar high encode speeds to the MediaCoder build.
HeadBangeR77
9th March 2007, 13:10
Thanks for a very helpful reply.
You're welcome. I felt entitled to answer you, since we've got similar hardware (yours being a bit slower, but I could calculate the performance difference more or less). ;)
I was using the latest build of Mencoder downloaded from the MPlayer site.
I had a dig around on my hard disk and came across an alternative Mencoder build that came with the MediaCoder GUI, which I was trialling.
The MediaCoder Mencoder build was (a) half the size (about 4.5MB v 9MB) and (b) is giving encoding speeds of 25fps (1st pass) and about 15fps (2nd pass).
Your current encoding speeds seem very decent concerning your hardware and the full MPEG-2 resolution you encode at. They're just few FPS behind mine, if I don't do any filtering.
As to speeding the things up: MSP=6 and VHQ1 for the 2nd pass are good quality settings, but I wouldn't go below them (yet I'm a quality freak). Do you use VHQ on B-frames? (recommended from the quality pov)? What are the settings for B-frame ratio and offset? I can't see those in you CL...
I have never used MenCoder, so I can't help you with different builds, sorry. Btw. what build of XviD do you use?
cheers,
HDBR77
jdlk
9th March 2007, 15:34
Do you use VHQ on B-frames? (recommended from the quality pov)? What are the settings for B-frame ratio and offset? I can't see those in you CL...
cheers,
HDBR77
Now you've lost me...I have no idea what settings to use for these options. I'm a novice at this, really, and most of my settings are based on posts I've read on this site, without really understanding the process. I have no idea what a B-Frame is, I just know I need to limit them to "1" so that the files play on my standalone! (at least that's what I think I know. Today. It may all be different tomorrow.)
One thing I haven't managed to find is a beginner's guide to the theory behind encoding (that would explain in simple terms, for example, what a B-Frame is)...
The build of Mencoder I'm using uses Xvid 1.1.
DarkZell666
9th March 2007, 17:20
Would you mind trying those builds here for comparison ?
http://ffdshow.faireal.net/mirror/mplayer/
I see the official mplayer build has been updated recently though, so it shouldn't cause any problems.
I'm not quite sure about your encoding speeds, I'll have to try myself, since I never encode DVD-res material "as-is". I always downsize to below 640*y. Since HeadBanger's speeds are on par with yours, there are chances those speeds are "normal".
Note: I've recently encoded some 640x352 stuff at around 11fps on an Mobile Sempron 2800+ (on second pass), with settings close enough to yours. The source was some 1024x576 videos, and I used hqdn3d on it (the integrated mencoder implementation).
640*352 resolution is 225280 pixels
720*576 resolution is 414720 pixels, which is 1.84096 times more pixels (nearly twice).
11fps/1.84 => 5.97fps ... which is quite a bit faster than you in fact ;)
Try the builds I mentionned (provided by celtic-druid for our encoding pleasure ;)), and post back the results ^^
Edit: this article (http://itsjustonesandzeros.blogspot.com/2007/01/what-is-packed-bitstream.html) mentionned by LoRd_MuldeR in the avidemux thread explains pretty well what I/P/B frames are, but is focused on the "packed-bitstream" concept.
jdlk
9th March 2007, 19:01
darkzell666,
Thanks for the response. As I mentioned in my edit of my post above, I did eventually try celtic druid's build, and that gave me very healthy speeds (25fps 1st pass/16fps 2nd pass).
Still can't explain why the official Mencoder build ran so slowly. Just one of those things, I guess. Thanks for the link to the article.
I always downsize to below 640*y.
I'm trying to develop an encoding system I'm happy with before I start on the task of archiving a large backlog of (PAL 720:576) TV recordings.
I guess one of the things I have to study is whether it makes sense to downsize. I realise that's down to my own subjective test, but I've formed the impression that most people on this forum don't downsize until they need to (to hit a size). Is that a reasonable interpretation?
DarkZell666
10th March 2007, 08:27
I'm trying to develop an encoding system I'm happy with before I start on the task of archiving a large backlog of (PAL 720:576) TV recordings.
I guess one of the things I have to study is whether it makes sense to downsize. I realise that's down to my own subjective test, but I've formed the impression that most people on this forum don't downsize until they need to (to hit a size). Is that a reasonable interpretation?
This is usually what it comes down to indeed. There are those that have a limit to their HDD space (or who want to stick so many movies on a DVD), and those who don't ;)
Nice to hear you finally solved your speed problems, 4fps did seem slow (it's slower than what I usually get with x264 lol). Celtic-druid's builds are indeed reliable, but I'm surprised that the official build has this sort of problems. It probably doesn't have MMX enabled to be that slow ...
HeadBangeR77
10th March 2007, 12:41
Now you've lost me...I have no idea what settings to use for these options. I'm a novice at this, really, and most of my settings are based on posts I've read on this site, without really understanding the process. I have no idea what a B-Frame is, I just know I need to limit them to "1" so that the files play on my standalone! (at least that's what I think I know. Today. It may all be different tomorrow.)
It's true we've got whole lot of guides here, yet some very basic things and sometimes some very advanced matters are missing. So the only thing you can do is to use "search". However sometimes it would throw like couple hundreds results on you, and it's hard to find the exact information then.
Very quick, without going into details (some of them I probably don't know :D):
* I-frame, also called key-frame, doesn't use any information from other frames, so it stores all the data necessary to be displayed. Some would probably kill me for the comparison, but it's like a single image, or a screenshot (:D). If you could just take this one frame from your encode, you would get sth' like a JPEG image. From the mentioned reasons it's of the highest quality and of the largest size. It's usually used when a certain scene changes in a film /clip /video, so the image information has to be encoded from scratch.
* P-frame is much smaller, because it uses information from the previous frame, so only the difference is encoded. Thanks to that we've got some significant compression gain, and the quality remains almost the same as in the case of an I-frame. In older codecs and in old revisions of the currently used codecs only I-frames and P-frames were used.
* B-frame (bidirectionally predicted frame) uses information from the previous and the next frame (P-frames) and stores the difference. Hence it's very small in its size (usually 1/3 of a P-frame), the quality is usually only slightly worse than with other frame types, and the gain in compression is large. Advanced Video Coding (AVC) uses whole lot of B-frames in a row to aid the compression, and they can be used as image information reference for other B-frames.
Uffff .... :p
As to codec's setting see the presets thread. Some things form there might be useful for you, however you must keep in mind you can only use one B-frame from SAP compatibility reasons. And plz use VHQ on B-frames in the 2nd pass, if you know the command line. Use trellis. It increases quality a lot. If you have enough time for your encodings you can also increase the VHQ value to 2 or 3.
Hope the above was more or less clear. ;) Sorry, I don't have time for more explanations now.
cheers,
HDBR77
PS. Have a look here (it's old, yet it's got some good explanations):
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-xvid.html
The second link in google when I typed in: "VHQ, XviD". :p (I've just learnt a few more things by reading this ;)).
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.