komh / mplayer-os2

Issue tracker for MPlayer for OS/2
1 stars 1 forks source link

MPlayer 1.4-9.1.0 - H265 encoded videos play at half speed and are single threaded #11

Open dspiatkowski opened 2 years ago

dspiatkowski commented 2 years ago

mpalyer isn't able to play the H265 video normally.

What I mean by that is that the playback is about 1/2 speed while the audio moves at regular pace (very quickly they are out-of-sync). The video that does render appears to be a single threaded process, my CPU monitor shows a single core at 100%, which would switch to another core, etc, etc.

In comparison a regular H264 1080HQ playback normally uses about 15-20% spread on the 6 cores, and it's definitely multi-threaded.

NOTE: this happens using the fix-release of the EXE for issue #10 (SVN-r38083-9.1.0), but to rule that out I also re-tested with the regular 1.4-9.1.0 one and that shows the same behaviour.

Here is the CLI output from mplayer:

[code] ... libavformat version 58.65.101 (internal) libavformat file format detected. [mov,mp4,m4a,3gp,3g2,mj2 @ 0x307b00]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol [lavf] stream 0: video (hevc), -vid 0 [lavf] stream 1: audio (aac), -aid 0, -alang und VIDEO: [HEVC] 1920x1080 24bpp 30.000 fps 6312.0 kbps (770.5 kbyte/s)

Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family libavcodec version 58.118.100 (internal) Selected video codec: [ffhevc] vfm: ffmpeg (FFmpeg HEVC / H.265)

Clip info: major_brand: mp42 minor_version: 512 compatible_brands: mp42iso2mp41 creation_time: 2021-12-12T20:44:33.000000Z encoder: HandBrake 1.4.2 2021100300 Load subtitles in V:\PHOTO\DARIUSZ\TEMP\

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders [aac @ 0x2913a0]Multiple frames in a packet. AUDIO: 48000 Hz, 2 ch, floatle, 155.6 kbit/5.07% (ratio: 19455->384000) Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))

AO: [kai] 48000Hz 2ch s16le (2 bytes per sample) Starting playback... [aac @ 0x2913a0]channel element 0.0 is not allocated Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. VO: [kva] 1920x1080 => 1920x1080 Planar YV12 Fontconfig error: Cannot load default config file Selected font is fixed-width. Selected font is fixed-width. A: 7.9 V: 7.9 A-V: -0.000 ct: -0.021 0/ 0 84% 9% 0.2% 77 0 50% ... [/code]

Thanks!

komh commented 2 years ago

Any test clips possible ?

dspiatkowski commented 2 years ago

Sure, please take a look here => https://test-videos.co.uk, where you can pull up the same video transcoded into various formats.

Specifically, you can use this one to illustrate the problem => https://test-videos.co.uk/vids/bigbuckbunny/mp4/h265/1080/Big_Buck_Bunny_1080_10s_30MB.mp4

komh commented 2 years ago

I've tested and concluded that CPU is too slow to decde HEVC videos. OS/2 does not support HW decoding of HEVC video. After all, OS/2 MPlayer should decode HEVC video with CPU only, that is, with software only. In this case, very high CPU power is required.

For a multi-thread problem, MPlayer itself is a single-threaded program. But libraries used by MPlayer can use multi-thread. However, I don't think that multi-thread support for HEVC was disabled.

Consequently, without HW acceleration support or very high CPU power for HEVC decoding, this problem cannot be solved.

komh/vlc-os2#22 is same.

dspiatkowski commented 2 years ago

Hi Komh!

I noticed you closed this issue, but I have some information to add that I hope will change your conclusion.

In my case, I am running this on an AMD Phenom II X6 (1100T), 6 core, running at 3.8GHz. To rule out the cpu/hardware limitation I went ahead and installed the RPM version of ffmpeg, along with the ffplay utility.

Playin this very same stream ffplay has absolutely NO issues, and while playing 5 of the 6 core are at 60-65% utilization, while the remaining core however around 20-25%.

Therefore, it is my conclusion that this does not appear to be a hardware limiation. Different software renders this clip quite alright.

Here is the information that's available in the CLI window while ffplay renders the MP4:

== START === Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h265/1080/Big_Buck_Bunny_1080_10s_30MB.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 title : Big Buck Bunny, Sunflower version artist : Blender Foundation 2008, Janus Bager Kristensen 2013 composer : Sacha Goedegebure encoder : Lavf58.10.100 comment : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net genre : Animation Duration: 00:00:10.00, start: 0.000000, bitrate: 25169 kb/s Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25163 kb/s, 30 fps, 30 tbr, 15360 tbn, 30 tbc (default) Metadata: handler_name : VideoHandler == STOP ==

Thanks!

dspiatkowski commented 2 years ago

One more thing, here is the ffplay build information:

ffplay version 4.2.2 Copyright (c) 2003-2019 the FFmpeg developers built with gcc 9 (GCC) configuration: --prefix='/@unixroot/usr' --bindir='/@unixroot/usr/bin' --datadir='/@unixroot/usr/share/ffmpeg' --docdir='/@unixroot/usr/share/doc/ffmpeg' --incdir='/@unixroot/usr/include/ffmpeg' --libdir='/@unixroot/usr/lib' --mandir='/@unixroot/usr/share/man' --arch=pentium4 --optflags='-O2 -g -march=pentium4' --extra-ldflags='-Zhigh-mem ' --extra-cflags=' -fno-common' --disable-avx2 --disable-avx512 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gnutls --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --disable-decoder=opus --disable-encoder=opus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libxvid --enable-avfilter --enable-avresample --enable-postproc --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir='/@unixroot/usr/lib' --cpu=pentium4 --enable-runtime-cpudetect libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100

komh commented 2 years ago

Try mplayer -msglevel vo=9 your_movie_file_name 2>&1 | tee mplayer-log.txt.

Then, attach mplayer-log.txt, please.

dspiatkowski commented 2 years ago

mplayer-log.txt

Thanks!

komh commented 2 years ago

Sorry for the late reply.

How about trying -vo kva:dive or -vo kva:vman ?