PDA

View Full Version : h.264 decode on slow CPUs



Seyyapc
02-19-2007, 04:14 AM
Having have to downgrade my system from AMD Thunderbird 1.4@1.7GHz to a Duron 900Mhz@1Ghz, I didn't know at the moment that one of my hobbbies (watch anime series) will be stopped :( my specs 1Ghz, 256MB, Geforce4MX 64MB.

Literaly my system specs don't stop me for the most usual, surf the web, listen music, some docs withn abiword, but watching anime (usually matroska files) with the codec h.264 take all cpu. At the best case I can watch video files (specially avi) :roll: with the cpu going to 35-55% without problems...

Later with bigger resolution videos and of course with h.264 the experience was horrible, mplayer my prefered media player (used xine, vlc..) can not help even with hard frame dropping or cache, audio out of sync, slow video, pauses on the video, and for last mplayer show me an informative text saying ... "your CPU is to slow..." with certain tips to make my experiencia more normal.

Searching, reading, tips, mplayer-hq,users comments, I prove knowing what it do the tips that mplayer always mentioned (obviusly for mplayer). The result? Hurra!! 8)
nano ~/.mplayer/config
# Write your default config options here!
vo=xv
ao=alsa
softvol=1
vf=screenshot
lavdopts=fast=1:skiploopfilter=all I've and know all options except the last 'lavdopts' wich make the big difference.

Before wathing a matroska video file decode with h.264 my cpu go top 100%, now the same video file my cpu go between 76-84% :D what more can I ask?

After 2 hours watching the chapters of my anime, I decided to post this experiencie to help other users with similar problems.

----
*Other interesting option was lavdopts=lowres=1, but like the cpu going at 50% or less, the quality drops too. I suppose on systems more slower than mine the option for lowres is really important.

*slow systems: The standard today for computer machine go something like 2ghz, 1Gb ram. I don't try to disrespect, likewise my system is slow for standard...and works too well :oops: :twisted:

*The options explication here (http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html)...
fast (MPEG-2, MPEG-4, and H.264 only)
Enable optimizations which do not comply to the specification and might potentially cause problems, like simpler dequantization, simpler motion compensation, assuming use of the default quantization matrix, assuming YUV 4:2:0 and skipping a few checks to detect damaged bitstreams.

lowres=<number>[,<w>]
Decode at lower resolutions. Low resolution decoding is not supported by all codecs, and it will often result in ugly artifacts. This is not a bug, but a side effect of not decoding at full resolution.
0: disabled
1: 1/2 resolution
2: 1/4 resolution
3: 1/8 resolution

skiploopfilter=<skipvalue>
Skips the loop filter (AKA deblocking) during H.264 decoding. Since the filtered frame is supposed to be used as reference for decoding dependent frames this has a worse effect on quality than not doing deblocking on e.g. MPEG-2 video. But at least for high bitrate HDTV this provides a big speedup with no visible quality loss.
<skipvalue> can be either one of the following:
none: Never skip.
default: Skip useless processing steps (e.g. 0 size packets in AVI).
nonref: Skip frames that are not referenced (i.e. not used for decoding other frames, the error cannot "buildup").
bidir: Skip B-Frames.
nonkey: Skip all frames except keyframes.
all: Skip all frames.