Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve video performances #11

Open
Ceylo opened this issue May 12, 2011 · 9 comments
Open

Improve video performances #11

Ceylo opened this issue May 12, 2011 · 9 comments

Comments

@Ceylo
Copy link
Member

Ceylo commented May 12, 2011

No description provided.

@Ceylo
Copy link
Member Author

Ceylo commented Jun 5, 2011

sfeMovie now works better with multithreaded implementation. It can play 2048x872 movies without getting late at any time on Mac OS X. Going to test on Windows.

@Ceylo
Copy link
Member Author

Ceylo commented Jun 12, 2011

Results on Windows with this definition still highly depends on the backgrounds tasks. The movie playback won't be even if something is running in the background (which is often the case with Windows doing miscellaneous things).

@Ceylo
Copy link
Member Author

Ceylo commented May 5, 2012

With the multithreaded implementation of FFmpeg, this issue is more or less no more an issue, except on very high resolution movies on 'weak' computers.

@feliwir
Copy link
Contributor

feliwir commented Jun 26, 2014

using the hardware acceleration that is offered via libva/dxva (already part of libav) might increase perfomance furthermore

@Ceylo
Copy link
Member Author

Ceylo commented Jun 26, 2014

Unfortunately, the hardware acceleration (in terms of speed, not CPU consumption) won't speed up things on most computers unless the decoded frames do not have to go back through the RAM. That means video would need to be decoded by the GPU for example, and directly used by OpenGL.

Such change is not a small task.

Moreover at the moment the bottleneck (at least on my computer) is rather texture upload from RAM to VRAM rather than decoding, so simply enabling hardware decoding would not help.

Did you post because of playback issues or because of CPU consumption?

@feliwir
Copy link
Contributor

feliwir commented Jun 26, 2014

No, i am just getting familiar with library right now (i used to program libav before) and might do some changes on my fork of this project (which you can merge if you want).
Regarding the Hardware acceleration:
As far as i know libva returns va_surface (sits in VRAM) which can be converted to a glTexture, so there wouldn't be any unneccessary copying. Of course that would involve some OS specific code, which is never nice to deal with

@Ceylo
Copy link
Member Author

Ceylo commented Jun 26, 2014

Yup, I'll have a look depending on what you change :)

As for hwaccel: I have nothing against OS specific code as long as it does not pollute the portable part of sfeMovie. But more importantly, what would be the architecture changes required to integrate this hwaccel in the current decode+display workflow?

@feliwir
Copy link
Contributor

feliwir commented Jun 26, 2014

Well it would most likely only work on unix systems, because M$ only supports hardware acceleration via dxva which is obviously part of the DirectX Framework. Converting a D3D_Surface to a glTexture isn't possible without copying it back to the cpu (except for NVIDA GPU's which supprot OpenGL/DirectX Interop).
You can take a look at the following example, so you get an idea of what it takes to implement that:
http://stackoverflow.com/questions/23289157/how-to-use-hardware-acceleration-with-ffmpeg

It might not by the highest priority to implement that feature, but hardware decoding will remove a lot of the cpu usage, so sfeMovie gets a lot more viable in games etc. that are already cpu intense by themselves

@bluekirby0
Copy link

This is of particular interest on mobile devices that have poor processing power but have specialized hardware for video decoding. I don't know about iOS but Android should support VA API at least (which makes it an attractive option for Android + Linux support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants