You are not logged in.

#1 2007-10-31 22:17:36

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Encoding speed

Hi there, Arch (x86_64) has been my home for a while now. Satisfied as I am, I regularly try out other distro's. I've just tried out Xubuntu 7.10 & was quite surprised when ripping a DVD with mencoder, it was almost 3x faster than Arch.

Any idea how this could be so much quicker? I've made custom builds of mplayer, lame & xvidcore for Arch, resulting in absolutely no improvement. It'd be nice to get this performance where I'm more comfortable, after all, Arch kicks 455 at everything else.


Screenshots showing issued command, time, psnr, size, etc:

http://xs.to/xs.php?h=xs220&d=07443&f=arch.jpg
http://xs.to/xs.php?h=xs220&d=07443&f=xubuntu.jpg

wink

Offline

#2 2007-11-01 01:17:48

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding speed

I'm not sure exactly what the problem is here, but what happens if you encode a video that's already on the hard drive?

Offline

#3 2007-11-01 07:23:28

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

Thanks for your reply. There's no problem. I'm mainly wondering what could make Xubuntu faster at encoding, and whether it'd be possible to see this gain in Arch.

Regarding a video from my hard drive, here's the time results from re-encoding the same chapter:

Xubuntu:

real    2m6.345s
user    2m5.456s
sys     0m0.512s

Arch:

real    5m28.306s
user    5m27.275s
sys     0m0.443s

hmm

Last edited by ahaslam (2007-11-01 07:26:19)

Offline

#4 2007-11-01 10:28:57

retsaw
Member
From: London, UK
Registered: 2005-03-22
Posts: 132

Re: Encoding speed

Are you using the same version of mplayer on Arch and Xubuntu?  Do you get the same encoding speed difference when encoding to different codecs?

I'm thinking that maybe there is a bug in the Arch version of mplayer that isn't present in the Xubuntu version, that is causing the difference you are seeing.

Offline

#5 2007-11-01 12:09:34

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding speed

Is 'enc' in your screen shots a script. If so, are there two copies of the same Mencoder line in the Arch screen shot for comparison?

Last edited by skottish (2007-11-01 12:11:12)

Offline

#6 2007-11-01 17:59:42

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

retsaw wrote:

Are you using the same version of mplayer on Arch and Xubuntu?  Do you get the same encoding speed difference when encoding to different codecs?.

Both Arch & ubuntu use the same version of mplayer (0.9rc1), though Ubuntu splits mencoder into a separate package:

http://packages.ubuntu.com/gutsy/graphics/mplayer
http://packages.ubuntu.com/gutsy/graphics/mencoder

I hadn't tried other codecs, so here's the command & time results using lavc:

Mencoder options:

time mencoder dvd://1 -chapter 2-2 \
-oac mp3lame -lameopts abr:br=128 \
-ovc lavc -lavcopts vbitrate=2880:mbd=2:trell:v4mv \
-vop scale -zoom -xy 720 -o wotw_5.avi

Arch:

real    2m42.298s
user    2m37.750s
sys     0m0.837s

Xubuntu:

real    2m48.272s
user    2m43.518s
sys     0m0.612s

That's more like it.  I guess something's not quite right with xvid. As xvid works (only slowly in comparison to Xubuntu), what can I/we do to improve it?

PS, skottish, 'enc' is just where I've kept my mencoder options for these tests, I know the only difference was the file name, it's just habit. I only included it in the screenshot so you could see the issued command & that they were the same. The list's now got quite a bit larger, with a little variation: http://pastebin.archlinux.org/17045

wink

Offline

#7 2007-11-01 21:15:16

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding speed

ahaslam wrote:

PS, skottish, 'enc' is just where I've kept my mencoder options for these tests, I know the only difference was the file name, it's just habit.

Cool. Thanks for your patients with my questions. I was simply hoping to narrow down the possibilities. As you probably already know, Mencoder shouldn't be significantly different on the same machine because it uses runtime CPU detection.

By the way, are you in need of Xvid or does it just work for you? I ask because I find x264 to be way faster and way higher quality at the same bitrate than Xvid. The version in extra is far behind the current development though. I can post PredatorFreak's subversion PKGBUILD if you want.

Offline

#8 2007-11-01 23:25:24

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

x254 looks interesting, though I wonder whether it'd play on a divx dvd player? I've been playing with lavc, it's on par with xvid once you find nice quantizer settings & blows it out of the water by enabling multi-threading wink

Even though there's alternate codecs, how can we improve xvid? There's obviously something wrong with our package.

PS. I noticed that Ubuntu use xvidcore 1.1.2, as we use the current 1.1.3 release. If I get some time tomorrow I'll make a package with 1.1.2 & see if there's been a regression.

Last edited by ahaslam (2007-11-01 23:33:09)

Offline

#9 2007-11-02 00:21:08

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding speed

ahaslam wrote:

x254 looks interesting, though I wonder whether it'd play on a divx dvd player? I've been playing with lavc, it's on par with xvid once you find nice quantizer settings & blows it out of the water by enabling multi-threading wink

Even though there's alternate codecs, how can we improve xvid? There's obviously something wrong with our package.

PS. I noticed that Ubuntu use xvidcore 1.1.2, as we use the current 1.1.3 release. If I get some time tomorrow I'll make a package with 1.1.2 & see if there's been a regression.

x264 won't help you if you need DivX compatibility. While, like DivX and Xvid, it will produce ISO compliant files, but it will be a different MPEG4 profile than what you're looking for.

Last edited by skottish (2007-11-02 00:21:48)

Offline

#10 2007-11-02 07:21:16

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

I found the cause when building 1.1.2. Nasm should be replaced with Yasm in 'makedepends'.

With this simple change, Arch now beets Xubuntu when encoding with the xvid codec. Here's the time result using the same mencoder options as in my 1st post:

real    2m16.585s
user    2m16.174s
sys     0m0.363s

Here's my 1.1.2 PKGBUILD: http://pastebin.archlinux.org/17081

I will file a bug report when I get back from work wink

Offline

#11 2007-11-02 17:34:32

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

A task was already submitted, I just added a comment: http://bugs.archlinux.org/task/7834

I hope it's taken seriously, I'm sure I can't be the only speed-freak here wink

Offline

#12 2007-11-03 18:29:02

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding speed

ahaslam,

First off, I think it's awesome that you solved the problem. That one was tricky to track to down.

Second, this thread reintroduced me to Xvid. I mentioned above that x264 was way faster. I'm wrong. I'm showing about a 200 to 300% encoding time difference between the two. In fact, Xvid is at least 200% faster on one core than x264 on both cores of my machine! The quality is just as good for the same bitrate. Astonishing!

I've been locked into x264 for cross-platform compatibility (Quicktime). But why? Quicktime is not a very good player, and setting up a non-Linux box for DivX is pretty painless. I think that I'll play here for a while.

Thanks.

Offline

#13 2007-11-04 12:49:37

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

That's nice to here.

I've been playing with Xvid a little too & I'm now using 1.2 (cvs) as it enables the use of extra threads. If anyone's interested, here's a PKGBUILD: http://pastebin.archlinux.org/17222 (maybe AUR worthy?).

The extra threads are enabled with the xvidencopts 'threads=0-n'.

time mencoder dvd://1 -chapter 2-2 \
-oac mp3lame -lameopts abr:br=128 \
-ovc xvid -xvidencopts fixed_quant=2:threads=2 \
-vop scale -zoom -xy 720 -o wotw_x2.avi

real    1m59.866s
user    2m6.205s
sys     0m7.596s

Not a huge improvement, but it all adds up over an entire dvd.

wink

Offline

#14 2008-10-12 10:05:20

ahaslam
Member
Registered: 2007-05-11
Posts: 119

Re: Encoding speed

Nasm 2.xx has fixed the issue, xvidcore just needs rebuilding against it.

Repository package:

time mencoder dh4.mov -oac mp3lame -lameopts preset=extreme -ovc xvid \
-xvidencopts fixed_quant=2:vhq=4:psnr -vf scale=1280:-11 -o repo_hd.avi

Video stream: 5734.553 kbit/s  (716819 B/s)  size: 99059028 bytes  138.193 secs  3314 frames

xvid:     Min PSNR Y:39.38, Cb:43.62, Cr:42.58, All:40.30 in frame 741
xvid: Average PSNR Y:46.31, Cb:48.37, Cr:48.78, All:46.94 for 3309 frames
xvid:     Max PSNR Y:99.99, Cb:71.47, Cr:71.47, All:76.24 in frame 119

real    15m38.594s
user    15m36.829s
sys    0m0.890s

Built with nasm 2.03.01-1:

time mencoder dh4.mov -oac mp3lame -lameopts preset=extreme -ovc xvid \
-xvidencopts fixed_quant=2:vhq=4:psnr -vf scale=1280:-11 -o nasm_hd.avi

Video stream: 5732.474 kbit/s  (716559 B/s)  size: 99023117 bytes  138.193 secs  3314 frames

xvid:     Min PSNR Y:39.38, Cb:43.60, Cr:42.59, All:40.30 in frame 741
xvid: Average PSNR Y:46.31, Cb:48.38, Cr:48.78, All:46.94 for 3309 frames
xvid:     Max PSNR Y:99.99, Cb:71.47, Cr:71.47, All:76.24 in frame 119

real    5m4.526s
user    5m3.760s
sys    0m0.503s

Built with yasm-0.7.1-1:

time mencoder dh4.mov -oac mp3lame -lameopts preset=extreme -ovc xvid \
-xvidencopts fixed_quant=2:vhq=4:psnr -vf scale=1280:-11 -o yasm_hd.avi

Video stream: 5732.474 kbit/s  (716559 B/s)  size: 99023117 bytes  138.193 secs  3314 frames

xvid:     Min PSNR Y:39.38, Cb:43.60, Cr:42.59, All:40.30 in frame 741
xvid: Average PSNR Y:46.31, Cb:48.38, Cr:48.78, All:46.94 for 3309 frames
xvid:     Max PSNR Y:99.99, Cb:71.47, Cr:71.47, All:76.24 in frame 119

real    5m7.367s
user    5m4.207s
sys    0m0.577s

Last edited by ahaslam (2008-10-12 10:10:36)

Offline

Board footer

Powered by FluxBB