Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Increased CPU usage (Reduced video playback performance) #9

Closed
sumguy opened this issue Oct 16, 2011 · 3 comments
Closed

Increased CPU usage (Reduced video playback performance) #9

sumguy opened this issue Oct 16, 2011 · 3 comments

Comments

@sumguy
Copy link

sumguy commented Oct 16, 2011

(same as bug #367 on the old tracker)

rev 15 test 1 has the same large increase in CPU usage that was introduced in rev 14 test 3.

A quick test shows, for example, HD videos in avi and wmv formats taking roughly 30% more cpu than rev 14 test 2 (and earlier versions). Playing the same video in VLC takes roughly the same CPU as rev 14 test 2.

Settings for "optimise by degrading quality" or "drop frames" (or not) don't seem to have any effect on the difference between the versions.

So far I've not been able to upgrade past rev 14 test 2, as I'm unable to smoothly play many full-HD videos on my 2.4ghz core2 duo machine...

@Bilalh
Copy link
Contributor

Bilalh commented Oct 16, 2011

I sometimes have the same problem. It only seem to happen with 1080p h264 encoded video. If run the video with MPlayer from the command line using the same flags it does not have any problem.

@sttz
Copy link
Owner

sttz commented Oct 17, 2011

What system version and CPU are you running MPE on?

I did a quick benchmark and found the rev15-test1 binary to be slightly faster in decoding than the rev14-test2 binary:

rev14-test2:

adrian$ MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended-mt.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h264_1080p.mkv
[...]
BENCHMARKs: VC:  43.136s VO:   0.013s A:   0.000s Sys:   1.836s =   44.986s
BENCHMARK%: VC: 95.8890% VO:  0.0290% A:  0.0000% Sys:  4.0820% = 100.0000%

rev15-test1:

MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h264_1080p.mkv
[...]
BENCHMARKs: VC:  41.963s VO:   0.020s A:   0.000s Sys:   1.872s =   43.855s
BENCHMARK%: VC: 95.6860% VO:  0.0462% A:  0.0000% Sys:  4.2678% = 100.0000%

Can you run those benchmarks too? That will tell us if the binary is the issue or if it's somewhere in the video output.

Between rev14-test2 and test3 MPlayer removed the deprecated yuy2 filter and replaced it with the format=yuy2 flag. This could have to do something with your performance issue. Could you try disabling MPEUseYUY2VideoFilter to see if that changes anything? You can either change it in MPlayer OSX Extended.app/Contents/Resources/Preferences.plist under Defaults or add the key to your hu.mplayerhq.mplayerosx.extended.plist preferences file.

@Bilalh
Copy link
Contributor

Bilalh commented Oct 25, 2011

Benchmarks

rev14Test2

MPlayer\ OSX\ Extendedrev14test2.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended-mt.mpBinaries/Contents/MacOS/mplayer  -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
BENCHMARKs: VC:   3.100s VO:   9.297s A:   0.000s Sys:   0.127s =   12.523s
BENCHMARK%: VC: 24.7499% VO: 74.2347% A:  0.0000% Sys:  1.0154% = 100.0000%

rev14

MPlayer\ OSX\ Extendedrev14.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended-mt.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
BENCHMARKs: VC:   3.043s VO:   7.955s A:   0.000s Sys:   0.132s =   11.129s
BENCHMARK%: VC: 27.3389% VO: 71.4772% A:  0.0000% Sys:  1.1838% = 100.0000%

rev15Test1

MPlayer\ OSX\ Extendedrev15test1.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
BENCHMARKs: VC:   1.664s VO:  15.173s A:   0.000s Sys:   0.135s =   16.972s
BENCHMARK%: VC:  9.8046% VO: 89.4010% A:  0.0000% Sys:  0.7944% = 100.0000%

your git HEAD:

your git HEAD

MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
BENCHMARKs: VC:   2.122s VO:  23.595s A:   0.000s Sys:   0.191s =   25.907s
BENCHMARK%: VC:  8.1891% VO: 91.0744% A:  0.0000% Sys:  0.7365% = 100.0000%

Specs

MacBookPro3,1
Intel Core 2 Duo 2.4 GHz
4 GB RAM
GeForce 8600M GT 256MB
Mac OS X 10.6.8

Details

I run these test after deleting hu.mplayerhq.mplayerosx.extended.plist

Also when using the GUI for (rev15test/ your git HEAD) the video stutters/framedrops? for a long time. Using same command line arguments to MPlayer as the gui does, the video does not have the this problem.

./mplayer /Users/bilalh/h246_1080_ssa.mkv -cache 51200 -lavdopts threads=2  -font "Myriad Pro:style=Semibold" -ass -ass-font-scale 1.000 -embeddedfonts -ass-color FFFFFF26 -ass-border-color 00000032 -subfont-osd-scale 4.500 -framedrop -volume 25.00 -vf-add screenshot -slave -identify -noar

When playing the file in rev14's GUI and rev14's MPlayer from the command line the picture is corrupted so rev15 is still better.

I get the same result from some other files I tested.

I made a small test file (24MB ~45s) that shows these problems. http://dl.dropbox.com/u/6818584/h246_1080_ssa.mkv

I set MPEUseYUY2VideoFilter to false in the plist and tested the file in rev15test1 and rev14 but it not seem to make much difference, the command line version did not have this problem.

I also tried the latest MPlayer2 binary for 10.6, where the problem is more noticeable.

Complete MPlayer output

rev14test2

MPlayer\ OSX\ Extendedrev14test2.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended-mt.mpBinaries/Contents/MacOS/mplayer  -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
MPlayer SVN-r31057-4.2.1 (C) 2000-2010 MPlayer Team

Playing h246_1080_ssa.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC) "AVC (1080p)", -vid 0
[mkv] Track ID 2: audio (A_FLAC) "FLAC (2 Ch)", -aid 0, -alang jpn
[mkv] Track ID 3: subtitles (S_TEXT/ASS) "ASS (Yesy)", -sid 0, -slang eng
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  1920x1080  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
[ass] auto-open
Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x1010700c0]using unscaled yuv420p -> rgb24 special converter
VO: [null] 1920x1080 => 1920x1080 Planar YV12 


BENCHMARKs: VC:   3.100s VO:   9.297s A:   0.000s Sys:   0.127s =   12.523s
BENCHMARK%: VC: 24.7499% VO: 74.2347% A:  0.0000% Sys:  1.0154% = 100.0000%

Exiting... (End of file)

rev14

MPlayer\ OSX\ Extendedrev14.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/mpextended-mt.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
MPlayer SVN-r32769-4.2.1 (C) 2000-2010 MPlayer Team

Playing h246_1080_ssa.mkv.
libavformat file format detected.
[matroska,webm @ 0x10180ee00] max_analyze_duration reached
[matroska,webm @ 0x10180ee00] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: video (h264), -vid 0, AVC (1080p)
[lavf] stream 1: audio (flac), -aid 0, -alang jpn, FLAC (2 Ch)
[lavf] stream 2: subtitle (ass), -sid 0, -slang eng, ASS (Yesy)
VIDEO:  [462H]  1920x1080  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 title: Puella Magi Madoka Magica - 01 (1920x1080 Hi10P BD FLAC)
Opening video filter: [ass auto=1]
[ass] auto-open
Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x1007060e0]using unscaled yuv420p -> rgb24 special converter
VO: [null] 1920x1080 => 1920x1080 Planar YV12 


BENCHMARKs: VC:   3.164s VO:   8.106s A:   0.000s Sys:   0.141s =   11.412s
BENCHMARK%: VC: 27.7292% VO: 71.0356% A:  0.0000% Sys:  1.2352% = 100.0000%

Exiting... (End of file)

rev15test1

MPlayer\ OSX\ Extendedrev15test1.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
MPlayer SVN-r34178-4.2.1 (C) 2000-2011 MPlayer Team

Playing h246_1080_ssa.mkv.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0, AVC (1080p)
[lavf] stream 1: audio (flac), -aid 0, -alang jpn, FLAC (2 Ch)
[lavf] stream 2: subtitle (ass), -sid 0, -slang eng, ASS (Yesy)
VIDEO:  [H264]  1920x1080  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 title: Puella Magi Madoka Magica - 01 (1920x1080 Hi10P BD FLAC)
Load subtitles in ./
Opening video filter: [ass auto=1]
[ass] auto-open
Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x1008e6420]using unscaled yuv420p10le -> yuv420p special converter
VO: [null] 1920x1080 => 1920x1080 Planar YV12 


BENCHMARKs: VC:   1.664s VO:  15.173s A:   0.000s Sys:   0.135s =   16.972s
BENCHMARK%: VC:  9.8046% VO: 89.4010% A:  0.0000% Sys:  0.7944% = 100.0000%

Exiting... (End of file)

your git HEAD

MPlayer\ OSX\ Extended.app/Contents/Resources/Binaries/mpextended.mpBinaries/Contents/MacOS/mplayer -benchmark -nosound -vo null -frames 10000 -lavdopts threads=8 h246_1080_ssa.mkv
MPlayer SVN-r34178-4.2.1 (C) 2000-2011 MPlayer Team

Playing h246_1080_ssa.mkv.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0, AVC (1080p)
[lavf] stream 1: audio (flac), -aid 0, -alang jpn, FLAC (2 Ch)
[lavf] stream 2: subtitle (ass), -sid 0, -slang eng, ASS (Yesy)
VIDEO:  [H264]  1920x1080  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
Clip info:
 title: Puella Magi Madoka Magica - 01 (1920x1080 Hi10P BD FLAC)
Load subtitles in ./
Opening video filter: [ass auto=1]
[ass] auto-open
Opening video filter: [screenshot]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x1008e6420]using unscaled yuv420p10le -> yuv420p special converter
VO: [null] 1920x1080 => 1920x1080 Planar YV12 


BENCHMARKs: VC:   1.745s VO:  15.729s A:   0.000s Sys:   0.142s =   17.616s
BENCHMARK%: VC:  9.9062% VO: 89.2854% A:  0.0000% Sys:  0.8085% = 100.0000%

Exiting... (End of file)

@sttz sttz closed this as completed Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants