Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
69 user(s) are online (52 user(s) are browsing Forums)

Members: 0
Guests: 69

more...

Support us!

Headlines

 
  Register To Post  

MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just can't stay away
Just can't stay away


See User information
We got hardware accelerated video decoding working in MPlayer on AmigaOS4 with the Radeon RX580 GPU.

MPlayer is an older media player that was never designed to work with modern GPU decoding APIs. It was always decoding video on the CPU, which on a PowerPC machine like the AmigaOne X5000 is quite slow for anything above 720p.

The RX580 supports VA-API hardware decoding, which means the GPU can decode H.264 and HEVC video much faster and with far less CPU usage. The challenge was that MPlayer's codebase predates the modern FFmpeg hardware decoding API, so we had to bridge the gap between the two.

We modified MPlayer to create a hardware device context through FFmpeg, which opens a connection to the RX580's video decoder. We then patched the video pipeline so that decoded frames stay on the GPU as VA surfaces instead of being copied back to system memory. Finally we connected those GPU surfaces directly to the VA-API video output so the GPU also handles the color conversion and scaling to the screen.

The result is that 4K H.264 video now plays at around 23% CPU usage on the AmigaOne X5000, where before it would have been completely impossible.

Next up is optimization. There are still some smaller issues to work through, but the biggest hurdle is already behind us.




MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Not too shy to talk
Not too shy to talk


See User information
Cool!!!!

Well done ! Looking forward to see it running.

AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 550 / ATI X1950 / M-Audio 5.1 -> AmigaOS 4.1 FE / Linux / MorphOS
Amiga 1200 -> Recapped / PiStorm CM4 / SD HDD / WifiPi connected to the NET
Vampire V4SE TrioBoot
RPI4 AmiKit XE
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Home away from home
Home away from home


See User information
@Maijestro
Quote:
We got hardware accelerated video decoding working in MPlayer on AmigaOS4 with the Radeon RX580 GPU.
Is the RX580 just the only gfx card it was tested on so far, or is there any reason why it doesn't work on other gfx cards?
Both the RadeonHD.chip (maybe V5 only, not V3) and the RadeonRX.chip drivers should support the VA-API (va.library) for most of their supported gfx cards.

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Quite a regular
Quite a regular


See User information
@Maijestro

That's great! Thank you to all involved in making this!

1989-> A500, A600, A3000, A4000, A1200, CD32, µA1, PegII, A1XE, CDTV, Amy/416D79, A1X5000, Vampire 500 V2+, Vampire 600 V2, Amy-ITX, Denise ITX, Apollo V4SA, A1X5000/40 <-2026
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just popping in
Just popping in


See User information
Excellent!

Thanks for your work!

Will this work on an RX 560 as well?

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just can't stay away
Just can't stay away


See User information
@joerg
Quote:
joerg wrote:@Maijestro
Quote:
We got hardware accelerated video decoding working in MPlayer on AmigaOS4 with the Radeon RX580 GPU.
Is the RX580 just the only gfx card it was tested on so far, or is there any reason why it doesn't work on other gfx cards?
Both the RadeonHD.chip (maybe V5 only, not V3) and the RadeonRX.chip drivers should support the VA-API (va.library) for most of their supported gfx cards.


At the moment, I have only tested it on an RX580, which is why I specified it that way, but it should work just as well on all RX graphics cards. I am not sure about the HD cards. I don't have any other test systems available, so this needs to be tested.

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just can't stay away
Just can't stay away


See User information
@skynet

Quote:
skynet wrote:Excellent!

Thanks for your work!

Will this work on an RX 560 as well?


All RX graphics cards should work. So the RX 560 is definitely supported for Vaapi.

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just popping in
Just popping in


See User information
Sorry, I didn't see that Joerg had asked the question.

Thanks Maijestro!

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Home away from home
Home away from home


See User information
@Maijestro

Congratulation!

Sam440ep Flex 800Mhz 160GB HD + AmigaOS 4.1
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Quite a regular
Quite a regular


See User information
@Maijestro
Nice! Thank you very much!

AmigaOS3: Amiga 1200
AmigaOS4: Micro A1-C, AmigaOne XE, Pegasos II, Sam440ep, Sam440ep-flex, AmigaOne X1000
MorphOS: Efika 5200b, Pegasos I, Pegasos II, Powerbook, Mac Mini, iMac, Powermac Quad
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Not too shy to talk
Not too shy to talk


See User information
Did you statically link ffmpeg or is it the Emotion version?

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just can't stay away
Just can't stay away


See User information
@NinjaCyborg

Quote:
NinjaCyborg wrote:Did you statically link ffmpeg or is it the Emotion version?


It has nothing in common with Emotion or DVPlayer. Emotion/DVPlayer use FFmpeg 4.x, which is now very outdated. In contrast, MPlayer 2026 SVN utilizes FFmpeg 7.1.4.

@all

In the meantime, I have implemented a "fallback" mechanism since not all video formats support VAAPI hardware acceleration (e.g., MPEG). For this, I chose "Comp_Yuv2," which is one of our best native output methods. If a format not supported by VAAPI is called, the fallback takes effect. Also, a quick note: nothing is optimized yet, and there is a lot of debug output, which currently makes it a bit slower.

https://vimeo.com/1193340630?share=copy&fl=sv&fe=ci

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just popping in
Just popping in


See User information
@Maijestro

Excellent work!

Thank you, Maijestro!

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Home away from home
Home away from home


See User information
@Maijestro
Quote:
MPlayer is an older media player that was never designed to work with modern GPU decoding APIs. It was always decoding video on the CPU, which on a PowerPC machine like the AmigaOne X5000 is quite slow for anything above 720p.
...
Quote:
We modified MPlayer to create a hardware device context through FFmpeg, which opens a connection to the RX580's video decoder. We then patched the video pipeline so that decoded frames stay on the GPU as VA surfaces instead of being copied back to system memory. Finally we connected those GPU surfaces directly to the VA-API video output so the GPU also handles the color conversion and scaling to the screen.
Not sure if that's relevant at all, but you could have updated the FFplay AmigaOS 4.x port instead of the MPlayer port. Both are based in large parts on FFmpeg. FFPlay has much less features for sure compered to MPlayer, but it might have been much be easier to port than MPlayer, especially for the VA-API parts.

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Home away from home
Home away from home


See User information
@Maijestro

Comp_yuv2 is fine as first fallback, but if it fail also this fallback again to Comp

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Not too shy to talk
Not too shy to talk


See User information
@Maijestro

Fantastic work! Thank you very much for your efforts!
High hopes!

I was wondering the same thing Joerg asked...

Rather than trying to shoehorn FFmprg into MPlayer, would there
have been a path with FFPlay?

Is it possible a newer version fixes some of the deficiencies of
the one we have now or could the missing things (https, OSD,
ARexx port, etc) been added?

Just food for thought or maybe a later project....

THANKS AGAIN!

PJS

Go to top
Re: MPlayer 2026 SVN/CVS FFMPEG7.1/Vaapi
Just can't stay away
Just can't stay away


See User information
@joerg

Quote:
joerg wrote:@Maijestro
Quote:
MPlayer is an older media player that was never designed to work with modern GPU decoding APIs. It was always decoding video on the CPU, which on a PowerPC machine like the AmigaOne X5000 is quite slow for anything above 720p.
...
Quote:
We modified MPlayer to create a hardware device context through FFmpeg, which opens a connection to the RX580's video decoder. We then patched the video pipeline so that decoded frames stay on the GPU as VA surfaces instead of being copied back to system memory. Finally we connected those GPU surfaces directly to the VA-API video output so the GPU also handles the color conversion and scaling to the screen.
Not sure if that's relevant at all, but you could have updated the FFplay AmigaOS 4.x port instead of the MPlayer port. Both are based in large parts on FFmpeg. FFPlay has much less features for sure compered to MPlayer, but it might have been much be easier to port than MPlayer, especially for the VA-API parts.


FFPLAY/FFMPEG 8.1 has already been fully ported, and I have been working on it for three weeks. Unfortunately, I have failed to get Vaapi running so far. Additionally, FFplay is heavily dependent on SDL2, and our SDL2 cannot handle Vaapi. Therefore, a native output must be implemented here as well. For MPlayer/FFMPEG, many patches and native outputs like CGX, Comp/Compu_yuv2, WPA, and P96_Pipe already exist. For Vaapi in MPlayer, we used the WPA output as a template and added the missing elements, which worked right away. Of course, we now know how it's done and can apply this to FFPLAY/FFMPEG 8.1, but I am still not 100% sure if it will work. There were very large changes between FFMPEG API 7.1 and 8.1 that might make it impossible. For now, I am focusing on what I have with MPlayer and FFMPEG version 7.1. MPlayer/Vaapi is far from finished; the next steps are AHI support and further optimizations. I am also looking at the skin system for a proper user interface. However, the build itself is currently very stable.

MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE / AmigaOne x5000/40 AmigaOs4.1 FE
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project