[MPlayer-users] Optimize video output from tv card

Michael auslands-kv at gmx.de
Wed Aug 26 11:44:27 CEST 2009


Reimar Döffinger wrote:

> Look at the "Cpu(s):" line in top, the 3rd line. It splits overall CPU
> usage up.
> The one you were looking at is all of those summed up as far as they can
> be associated to MPlayer - which might include whatever e.g. the USB
> driver is doing on MPlayer's behalf.
86.4%us,  3.4%sy,  0.0%ni,  0.0%id,  0.0%wa, 10.2%hi,  0.0%si,  0.0%st

Does that help? 

>> > What values does the MPlayer command line show for CPU usage?
>> > 
>> 
>> I only have ??% there, e.g.
>> V:   0.0 170/170 ??% ??% ??,?% 0 0
> 
> That shouldn't stay at 0.0 at least...

Well, it does as long as I am using tv:// as input, regardless whether it is 
the webcam or the tv card. When I am playing video streams from local files, 
the numbers show real values.

>> Unfortunately, I am pretty much fixed on a small embedded hardware system
>> (GeodeLX), which seems to only support fbdev and directfb. (directfb,
>> however, uses more CPU).
> 
> Those aren't particularly optimized unfortunately.

Pity, with this hardware there isn't any alternative, I guess?

> 
>> I have to admit, that I nearly know nothing about video processing at
>> all. I guess, that the external video capturing card/TV card/webcam
>> encodes the video somehow, e.g. MJPEG or other type of streams?
>> Furthermore I guess it needs to use some type of colorspace, which might
>> need a conversion?
> 
> No, they both don't encode by default, and the TV card doesn't even
> offer encoding, at least not via the v4l API.
> Also the CPU usage for decoding
> 
>> The resolution and the framerate, however, is the same between the webcam
>> and the TV card (604x480, 25fps). So, I thought, if displaying the webcam
>> takes app. 50% of CPU usage, while displaying the TV card take 100%,
>> mplayer seems to be doing more stuff ("internal processing") on the video
>> data it gets from the TV card than from the webcam.
> 
> Well, you have specified 25 fps, but that doesn't mean that either of
> them actually delivers 25 fps.
> 

Well, if I don't specify the fps, mplayer states that it gets 25fps. If I 
specify 15 fps, CPU usage goes down significantly (to app. 50%).

Taken together:
TV card:
-fps 25 (or no -fps):
86.4%us,  3.4%sy,  0.0%ni,  0.0%id,  0.0%wa, 10.2%hi,  0.0%si,  0.0%st
-fps 15:
39.7%us,  0.0%sy,  0.0%ni, 57.6%id,  0.0%wa,  2.6%hi,  0.0%si,  0.0%st

Webcam:
-fps 25 (or no -fps):
31.6%us,  0.0%sy,  0.0%ni, 65.6%id,  0.0%wa,  2.9%hi,  0.0%si,  0.0%st
-fps 15:
14.2%us,  0.2%sy,  0.0%ni, 84.8%id,  0.0%wa,  0.8%hi,  0.0%si,  0.0%st

So, the question is where does the difference come from? Both display on the 
same screen (fbdev) and have the same size.

> Both devices use the same colourspace and it's a simple yuv->rgb
> transformation. It is hard to imagine it should show any relevant CPU
> usage.

Hmm, this makes it even more obscure, where the difference comes from. If it 
is the USB transfer, why does the CPU usage appear in "user", not in 
"system" or in "wait"? And why does the CPU usage go down, when specifying 
"-fps 15"? I guess the USB transfers are still the same, aren't they?

> Maybe you should first try on "proper" hardware.
> Also if your kernel is as ancient as MPlayer I'd suggest trying a newer
> version, too, TV drivers often are in an unusable state and suddenly
> start working rather well (my USB thing has been working barely with
> 2.6.20, not working at all with 2.6.24 and is now working fairly well
> with 2.6.29 - well, or something like that I never remember the exact
> details).

The kernel is 2.6.30.4. As far as I know the tv card (which is a Dazzle 
DVC100) is only supported starting from this kernel.

Concerning "proper" hardware: You mean, graphics card, right? Unfortunately, 
I don't have an option there. But I am fine with the ~50% CPU usage of the 
webcam. Would be nice if the tv card would be there, too, instead of 100%.

The system shall not do very much, just play video from the tv card and 
display some scrolling text below. So if the mplayer uses 50-70% of 
available CPU time it should be fine for me...

Thanks for the help

Michael



More information about the MPlayer-users mailing list