WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: What is the optimal Mplayer setting to play movie to use all power only to play  (Read 11863 times)

Offline alex52

  • Newbie
  • *
  • Posts: 6
What is the optimal Mplayer setting to play movie to use all pc power only to play a movie?

The questions below are not for quality, but only for a possibility to play as higher as possible resolution movies on a slow PC without converting that takes 4-6 times longer than movie itself.

I use tinycore and only OSS and Mplayer-nodeps to play movies in the framebuffer on a slow pc.
To use fbdev you need to set fbdev size at tinycore booting (I believe it is called as hardware scaling)
 
I'd like to optimize slow PC performance, and to find the biggest movie size than can be played at the slow PC. I have read mplayer manuals, but still now I'm not sure about several things.

I.   What it the difference in performance between setting screen size at booting, and rescaling (I believe it is called as software scaling such as: -scale w=x:h=x, -zoom, -presize) in the MPlayer in the next situation?

1. There is 1024x768 display and 800x600 movie. What will be working faster:
a). To set 800x600 fbdev at booting, and to play a movie with full screen width without rescaling in the mplayer?
b). To set original display size 1024x768 as fbdev, and to rescale movie size to screen width of 800 in the mplayer?

2. There is 800x600 display and 1024x768 movie. What will be working faster:
a). To set 1024x768 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 800x600 as fbdev, and rescale movie size in the mplayer?

3. There is 1024x768 display and 1280x1024 movie. What will be working faster:
a). To set  1280x1024 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 1024x768 as fbdev, and rescale movie to full screen width in the mplayer?


II.   Is there differences in mplayer performance in rescaling from a smaller movie frame width to biggest screen width, or from bigger movie width to smaller screen width?


III.   Something tells me that hardware scaling (setting fbdev width at booting) should work faster. But there are no preset fbdev width at tinycore booting for most popular movies sizes, such as 720x576 DVD, or other movies standards, as it can be set the mplayer:

<presize>
                      Scale to preset sizes.
                         qntsc:   352x240 (NTSC quarter screen)
                         qpal:    352x288 (PAL quarter screen)
                         ntsc:    720x480 (standard NTSC)
                         pal:     720x576 (standard PAL, used in DVD)
                         sntsc:   640x480 (square pixel NTSC)
                         spal:    768x576 (square pixel PAL)

Is there an opportunity to set fbdev size (width) at booting to any desirable width to enjoy movies in full-screen mode?
If no, how to set desirable fbdev size in the mplayer?


IV.   And the ultimate question.
What is the optimal mplayer setting to play movie to use all PC power only to play a movie?

"%mplay%" -vo fbdev -framedrop
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=0:fast:skiploopfilter=all -cache 8192 -audiofile-cache 1024
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=1:fast:skiploopfilter=all -cache 8192 -audiofile-cache 1024   
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=0:fast:skiploopfilter=all:skipframe=nonkey
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=1:fast:skiploopfilter=all:skipframe=nonkey          
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=0:fast:skiploopfilter=all -ni -nobps -forceidx -mc 0 -nocache -vf eq,pp=lb/hb/vb
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=1:fast:skiploopfilter=all -ni -nobps -forceidx -mc 0 -nocache -vf eq,pp=lb/hb/vb -vfm ffmpeg
"%mplay%" -vo fbdev -framedrop -lavdopts lowres=2:fast:skiploopfilter=all -ni -nobps -forceidx -mc 0 -nocache -vf eq,pp=lb/hb/vb -vfm ffmpeg


I'll appreciate any information about this subject.

Best, Alex
« Last Edit: April 04, 2011, 05:45:52 AM by alex52 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
As long as you have a properly supported graphics card, XV will use a lot less cpu than fbdev. The overhead of Xorg running in the background is much less than the amount you save by using XV.

XV is hardware scaling & color conversion, fbdev is software.
The only barriers that can stop you are the ones you create yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
2. There is 800x600 display and 1024x768 movie. What will be working faster:
a). To set 1024x768 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 800x600 as fbdev, and rescale movie size in the mplayer?

3. There is 1024x768 display and 1280x1024 movie. What will be working faster:
a). To set  1280x1024 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 1024x768 as fbdev, and rescale movie to full screen width in the mplayer?

2.a). and 3.a). do not appear to be realistic, use 'vga=ask'.

Interesting subject with countless parameters as you already seem to have found out  ;)

The answers to your questions might depend on specific parameters of your hardware, and to a lesser degree on the parameters of the file to be played.

Some other parameters you might want to experiment with:

Set framebuffer to a mode with 15 or 16 bpp
Increase 'cache=' value.
Try different '-vo' drivers, e.g. fbdev2 and cvidix (depending on hardware).

YMMV
« Last Edit: April 04, 2011, 09:48:39 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline alex52

  • Newbie
  • *
  • Posts: 6
Thank you for quick replay's.
Quote
As long as you have a properly supported graphics card, XV will use a lot less cpu than fbdev. The overhead of Xorg running in the background is much less than the amount you save by using XV.

XV is hardware scaling & color conversion, fbdev is software.
*.avi and all other movie frames have played normally up to DVD 720x576  in the Windows XP with C3 CPU 996 MHz, L1+L2 cache 128 KB, RAM 256. Results the same on the 2 different PC with 8 and 32 MB video cards.

Bigger frames had stopped to run properly (you can see 3 the same parts of the frame on the screen in the slowing mode).

I tried to play bigger than DVD 720x576 movies with Xorg, XV,  cvidix and other drivers in tinycore, but the did not play properly.

Only with -vo fbdev I was able to see  movies up to 1024x768 frame size (except *.mkv that stopped to play at some less frames).

Quote
2. There is 800x600 display and 1024x768 movie. What will be working faster:
a). To set 1024x768 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 800x600 as fbdev, and rescale movie size in the mplayer?

3. There is 1024x768 display and 1280x1024 movie. What will be working faster:
a). To set  1280x1024 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 1024x768 as fbdev, and rescale movie to full screen width in the mplayer?
Quote
2.a). and 3.a). do not appear to be realistic, use 'vga=ask'.

Interesting subject with countless parameters as you already seem to have found out  ;)

The answers to your questions might depend on specific parameters of your hardware, and to a lesser degree on the parameters of the file to be played.

Some other parameters you might want to experiment with:

Set framebuffer to a mode with 15 or 16 bpp
Increase 'cache=' value.
Try different '-vo' drivers, e.g. fbdev2 and cvidix (depending on hardware).

YMMV
Why it's not realistic, if I tried to do all these.
Quote
Set framebuffer to a mode with 15 or 16 bpp
I'm not familiar with this option. I'll try.
Of course, I used different 'cache=' value without any success.

fbdev2 also does not run in my tinycore_3.5.1.iso with only Mplayer-nodeps.tcz and OSS.tcz

Is there any option to drop frames, not to reduce they as "-lavdopts lowres=1" does, e.g., to drop each second or third frame?
This should reduce CPU loading but not effect movie picture.
-framedrop drops frames accidentally, not on the regular order.
 

I've read that fbdev is the less consuming CPU method. This is playing without rescaling, i.e. picture on the screen is the direct copy of the movie frame. All other drivers used rescaling, that should consume a lot of CPU.

Indeed, in the fbdev you can start screen from the point 0,0 and simply put movie frame the point after point without any recalculating. If the frame is smaller than your screen then you'll see all frame inside the screen. If the movie frame is bigger than the screen, you'll see only part of the frame.

Again, there is no calculating the the fbdev mode. Why it's more CPU consuming than XV or others drivers?

Of course,  I used "vga ask" in the kernel string. And one of my question was How to get other fbdev screen width than offered by this option?

All other drivers, except fbdev, need scaling such as: -scale w=x:h=x, -zoom, -presize that should consume a lot of power for recalculating.

Again, I believe that playing without frames recalculation, especially, with regular frames dropping, shout be less CPU consuming, that allows to see  properly (of course, not in the HD mode) bigger movie frames.
Am I wrong?  How to reach these 2 conditions?

I'll appreciate any opinion and suggestions about this topic

Best, Alex
« Last Edit: April 04, 2011, 01:08:23 PM by alex52 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Quote
I tried to play bigger than DVD 720x576 movies with Xorg, XV,  cvidix and other drivers in tinycore, but the did not play properly.

Which graphics cards? Did they have XV working (check Xorg.0.log), did lower-res movies play fine?

Quote
Again, there is no calculating the the fbdev mode. Why it's more CPU consuming than XV or others drivers?

Color conversion still has to be done. Framebuffers are usually RGB, movies YUV.
The only barriers that can stop you are the ones you create yourself.

Offline alex52

  • Newbie
  • *
  • Posts: 6
Quote
I tried to play bigger than DVD 720x576 movies with Xorg, XV,  cvidix and other drivers in tinycore, but the did not play properly.

Which graphics cards? Did they have XV working (check Xorg.0.log), did lower-res movies play fine?
Quote
Again, there is no calculating the the fbdev mode. Why it's more CPU consuming than XV or others drivers?
Color conversion still has to be done. Framebuffers are usually RGB, movies YUV.
I'm in the temporally visit from the USA to my former country Ukraine. I do not work here, and help friends with computers.  Although,  I'm not specialist in computers, I used to test and optimize many PC's. Especially, I have a hobby to optimize something old.

So, I tried described above on several slow PC's. 
 
Here, I describe experience with Video cards integrated  in  motherboards.
Display Adapter is:
Trident Video Accelerator Blade 3D/ProMedia with shared memory 8 or 32 MB.

Yes, at the described above CPU, lower-res movies up to DVD 720x576 play in the same "normal" way as in the WindowsXP (VLC, mplayer, GOM),  as in the Linux with  Xorg, XV,  cvidix and other drivers. I used to play movies in tinycore_3.5.1.iso,   slitaz-3.0.iso   KNOPPIX_V6.4.3CD-2010-12-20-EN.iso,   GEEXBOX-2.

Additionally, at several PC's, with the same CPU, video memory  was in the range of 8-64 MB with the same results. Therefore, I believe, that main reason to stop playing well is lack of CPU power to recalculate frames. So, I'm looking for a way to reduce CPU load as low as possible.

From this point of view, tinycore+mplayer is a good choice, and I'm looking for ultimate options  to low  CPU usage.

In all cases, up to DVD 720x576 is OK.  At higher resolution all these drivers in Linux and Windows players  do not play properly.
Only -vo fbdev allow to play higher-res movies up to 1024x768

My goal to find out the higher opportunity for such type of slow PC's.


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Quote
2. There is 800x600 display and 1024x768 movie. What will be working faster:
a). To set 1024x768 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 800x600 as fbdev, and rescale movie size in the mplayer?

3. There is 1024x768 display and 1280x1024 movie. What will be working faster:
a). To set  1280x1024 fbdev at booting, and to play a movie without rescaling in the mplayer?
b). To set original display size 1024x768 as fbdev, and rescale movie to full screen width in the mplayer?
Quote
2.a). and 3.a). do not appear to be realistic, use 'vga=ask'.

Interesting subject with countless parameters as you already seem to have found out  ;)

The answers to your questions might depend on specific parameters of your hardware, and to a lesser degree on the parameters of the file to be played.

Some other parameters you might want to experiment with:

Set framebuffer to a mode with 15 or 16 bpp
Increase 'cache=' value.
Try different '-vo' drivers, e.g. fbdev2 and cvidix (depending on hardware).

YMMV
Why it's not realistic, if I tried to do all these.

Try how exactly?

Quote
Quote
Set framebuffer to a mode with 15 or 16 bpp
I'm not familiar with this option. I'll try.

bpp is one of the 3 basic parameters for setting fb mode (or X mode, for that matter)

Quote
fbdev2 also does not run in my tinycore_3.5.1.iso with only Mplayer-nodeps.tcz and OSS.tcz

It does here, but I wouldn't know the exact difference between fbdev vs. fbdev2.

Quote
Is there any option to drop frames, not to reduce they as "-lavdopts lowres=1" does, e.g., to drop each second or third frame?
This should reduce CPU loading but not effect movie picture.

I have seen similar with DOS apps...

Quote
Of course,  I used "vga ask" in the kernel string. And one of my question was How to get other fbdev screen width than offered by this option?

What makes you think that would be possible?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
So, I'm looking for a way to reduce CPU load as low as possible.

A radical and very efficient approach to achieve such a goal would be to seperate the decoding and playing into different passes, so decoding wouldn't have to happen in realtime while playing. In such a manner I had managed to achieve a tolerable frame rate for video playback with DOS apps with 20Mhz CPU, 4 MB RAM, 256Kb GFX.
However, that comes at a price of high storage space requirements.

Quote
Only -vo fbdev allow to play higher-res movies up to 1024x768

aalib & libcaca might also, but they are not compiled into Mplayer-nodeps.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline alex52

  • Newbie
  • *
  • Posts: 6

Quote
alex52 | Why it's not realistic, if I tried to do all these.
Quote
tinypoodle | Try how exactly?
Sorry, indeed, there are no 1280x1024 choices in tinycore vga=ask, and only 3.a). in my original question is not realistic.
I only have tried once to play such movies on a slow PC, and automatically "rescale" this data in my question.

I set kernel flags as follow:
kernel /boot/bzImage vga=ask tce=hda3 home=hda3/tce opt=hda3/tce showapps
initrd /boot/tinycore.gz

1. With 800x600 display and 1024x768movie.avi
a). At booting set 316 for 1024x768x16 and
#>mplayer -vo fbdev -framedrop /f/1024x768movie.avi

b). At booting set 313 for 800x600x16 and
#>mplayer -vo fbdev -framedrop -zoom -xy 800 /f/1024x768movie.avi

2. With 1024x768 display and 800x600movie.avi
a). At booting set 313 for 800x600x16 and
#>mplayer -vo fbdev -framedrop /f/800x600movie.avi

b). At booting set 316 for 1024x768x16 and
#>mplayer -vo fbdev -framedrop -zoom -xy 1024 /f/800x600movie.avi

In all cases all movie frames play in the full screen width. And I asked what choice will be better from the point of view to reduce CPU load?

At the upper limit for CPU, I tried to play bigger movie frames than 1024x768 screen was set at booting, and with option -zoom -xy 1024 movie slowed down, but without this option movie performed a little bit better, but with only part (from the beginning ) of the frame was visible on the screen.

This again turned me to the opinion, that playing without frames rescaling consumes less CPU that should provide playing bigger frames.
Quote
Color conversion still has to be done. Framebuffers are usually RGB, movies YUV.
May be (only myself may be), Color conversion uses less CPU than frame rescaling, as Only with -vo fbdev I was able to see  movies up to 1024x768 frame size (except *.mkv that stopped to play at some less frames).

-lavdopts options, as mentioned above, have not improved movies performance or even did not work at all.
 
How to play DVD 720x576 in full screen without rescaling in mplayer? One of my question was How to get other fbdev screen width than offered by this option?
Quote
What makes you think that would be possible?
I do not know. I asked is it possible? As I want to play DVD 720x576 in full screen without rescaling with option -zoom -xy 720
In this case, as I believe (may be I'm wrong???), CPU should do much more work.
Quote
Set framebuffer to a mode with 15 or 16 bpp
bpp is one of the 3 basic parameters for setting fb mode (or X mode, for that matter)
I looked through mplayer help, but have not found any information how to set this option.
Would you kindly give an information how to do this and what it is about?

fbdev2 also does not run in my tinycore_3.5.1.iso with only Mplayer-nodeps.tcz and OSS.tcz
Quote
It does here, but I wouldn't know the exact difference between fbdev vs. fbdev2.
Yes, there is fbdev2 in -vo help, but when I use -vo fbdev2, mplayer uses only fbdev
Quote
Is there any option to drop frames, not to reduce they as "-lavdopts lowres=1" does, e.g., to drop each second or third frame?
This should reduce CPU loading but not effect movie picture.
I have seen similar with DOS apps...
So, I'm looking for a way to reduce CPU load as low as possible.

A radical and very efficient approach to achieve such a goal would be to separate the decoding and playing into different passes, so decoding wouldn't have to happen in realtime while playing. In such a manner I had managed to achieve a tolerable frame rate for video playback with DOS apps with 20Mhz CPU, 4 MB RAM, 256Kb GFX.
However, that comes at a price of high storage space requirements.
Quote
Only -vo fbdev allow to play higher-res movies up to 1024x768
aalib & libcaca might also, but they are not compiled into Mplayer-nodeps.

It's' very interesting experience.  High storage space requirements is not a problem today. In our case it's more important to force CPU to play as bigger as possible movie frames.

Would you kindly provide information how to do this or where to look for this?


Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Quote
Set framebuffer to a mode with 15 or 16 bpp
bpp is one of the 3 basic parameters for setting fb mode (or X mode, for that matter)
I looked through mplayer help, but have not found any information how to set this option.
Would you kindly give an information how to do this and what it is about?

'vga=ask' as kernel parameter and then type 'scan' at kernel's prompt would give you all possible modelines supported by a specific graphics card.
For Xvesa you would use 'Xvesa -listmodes'

Quote
Quote
So, I'm looking for a way to reduce CPU load as low as possible.

A radical and very efficient approach to achieve such a goal would be to separate the decoding and playing into different passes, so decoding wouldn't have to happen in realtime while playing. In such a manner I had managed to achieve a tolerable frame rate for video playback with DOS apps with 20Mhz CPU, 4 MB RAM, 256Kb GFX.
However, that comes at a price of high storage space requirements.
Quote
Only -vo fbdev allow to play higher-res movies up to 1024x768
aalib & libcaca might also, but they are not compiled into Mplayer-nodeps.

It's' very interesting experience.  High storage space requirements is not a problem today. In our case it's more important to force CPU to play as bigger as possible movie frames.

Would you kindly provide information how to do this or where to look for this?

I have never looked into this under Linux, but out of my head transcode could be helpful, or maybe also ffmpeg and similar.
Also I am not sure if mplayer would support 'raw' as input, but you could transcode to any format which then would use little resources to be decoded.

If you want mplayer with aalib or libcaca support you would have to compile it, though you could first check all other mplayer versions besides from Mplayer-nodeps for compiled in -vo options.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline alex52

  • Newbie
  • *
  • Posts: 6
Quote
tinypoodle | Also I am not sure if mplayer would support 'raw' as input, but you could transcode to any format which then would use little resources to be decoded.
Sorry, may be, I've not got your suggestion at first. You suggest, at first, transfer movie to other (raw) format, next to play it. To my mind, it's the same as to use mencode to transfer movie, and next to play it.
Correct me please, if I'm wrong.

I used mencode to reduce frame size to suitable one for slow PC, but it take in 3-5 time longer than to play movie.  

I said that I'm a visitor here, and use (when I optimize they) one after another friend's slow PC. I do not know where you are, but here, in the Ukraine, we go to the world net through local one, and inside this local net we have ~5000 users who exchange information with speed up to ~10 MBytes\sec inside local net, compare to up to 0.4 MBytes\sec from Internet.
At this moment, I can choose and quickly download from ~2,000 Terabytes from other users. Of course, it's mainly movies.

Some high-res movies were transferred by slow PC to DVD frame size, but it takes all night for transferring 1.5 hours movie.

Therefore, it is not my intention. I have my personal opportunity to watch BluRay movie at my Laptop which I move with me everywhere. I care about my friend's slow PC.

I'd like to understand situation with slow PC and to found out their opportunities.

As sometimes saying in the US - "We have what we have", but we should get maximum from what we have.

E.g., I took PC with P133 MHz, 32MB RAM, 1.8GB HDD, installed very stripped WinXP (/Windows ~150 MB) and only Word2003. Instead of going to trash, this PC is now working as a typewriter at some my friend.

Although, my profession is physics,  I had some experience with Linux,  my old post was visited by Views: 45,679:
http://knoppix.net/forum/threads/16606-Optimal-man-...t-NTFS-write-etc

At present, not to be lazy, I've found out 3 different way how to quickly  install Windows 7 from an image on HDD, without CD\DVD and USB. Although such opportunity was declined by Microsoft, and in all forums I've visited.  My post in Russian is here:
http://rutracker.org/forum/viewtopic.php?p=43416720#43416720

My next step to improve performance, I'd like to compile kernel and  mplayer for each PC I deal with,  including, may be, with aalib or libcaca support, if it'll be useful.

But my initial questions is still in the air.

What is the ultimate option for mplayer to use as much as possible CPU power to play high-res movies?

Is there any opportunity to set screen to watch DVD movie with full screen width without forcing CPU to rescale frames?

I'll appreciate any further suggestion on this topic.

Best, Alex
« Last Edit: April 05, 2011, 01:29:01 PM by alex52 »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Quote
tinypoodle | Also I am not sure if mplayer would support 'raw' as input, but you could transcode to any format which then would use little resources to be decoded.
Sorry, may be, I've not got your suggestion at first. You suggest, at first, transfer movie to other (raw) format, next to play it. To my mind, it's the same as to use mencode to transfer movie, and next to play it.
Correct me please, if I'm wrong.

I used mencode to reduce frame size to suitable one for slow PC, but it take in 3-5 time longer than to play movie.  

If by "transfer" you mean "transcode" then yes, that is exactly what I mean.
This is the literal and very exact answer to your question:
Code: [Select]
to use all [CPU] power only to play
while avoiding concurrent CPU intensive decoding - if the goal is to play movies with a CPU which is simply too slow otherwise.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline alex52

  • Newbie
  • *
  • Posts: 6
Quote
If by "transfer" you mean "transcode" then yes, that is exactly what I mean.
This is the literal and very exact answer to your question
Sorry, I'm not familiar with terminology. I simply run mencode which was  come with mplayer for Windows to convert 1280x1024  movie, and in 8 hours had got the same movie with 640x512 frame size.

Thank you very much for information. It gave me some thought to think and to test. When it'll be results I'll inform here.

Best, Alex


« Last Edit: April 06, 2011, 06:21:42 PM by alex52 »