Comments (12)
Ok, I've tried the https://github.com/wang-bin/mdk-examples/blob/master/SFML/sfmlplay.cpp example and it's not leaking, which means that the RenderTexture::create() cannot be called repeatedly, on each media reload.
So I'm wondering if there is a way of rendering a frame, but without drawing it on the screen, but just binding the texture buffer so I can draw it using OpenGL as I need to do some 3D transforms to the quad. It would be great to have updateTexture() and bindTexture() functions so I have full freedom when I want to update and how I want to draw it. I know it's kind off OpenGL specific, but I'm curious of your thoughts.
from mdk-sdk.
Additional reason of being able of not calling renderVideo()
on each frame is that 30fps videos are stuttering like without my trick with timer we were talking about in my previous issue.
from mdk-sdk.
sfml does not release previous fbo in RenderTexture::create(). You can try to destroy the old RenderTexture and create a new one when size changed.
From your screenshot, memory increased to 3GB in 16s. Does it leaks when playing a single video?
So I'm wondering if there is a way of rendering a frame, but without drawing it on the screen, but just binding the texture buffer so I can draw it using OpenGL as I need to do some 3D transforms to the quad
RenderTexture is what you want. renderVideo() can draw video to any framebuffer. If draw on screen, it's the default fbo, otherwise it's the fbo currently active.
Additional reason of being able of not calling renderVideo() on each frame is that 30fps videos are stuttering like without my trick with timer we were talking about in my previous issue.
Can you update your mdktest example using custom update event?
from mdk-sdk.
From your screenshot, memory increased to 3GB in 16s. Does it leaks when playing a single video?
It only leaks when I recreate the RenderTexture with texture.create()
I need to recreate it for each video reload because all the movies in the library have various resolutions and the switching between them is very frequent. The leak is unavoidable according to what they say on the SFML forum.
Can you update your mdktest example using custom update event?
I'm not sure what I supposed to do in the callback. When I get rid of the rendering in the main loop and move it to the callback:
player.setRenderCallback([=](void*){
texture->setActive(true);
player.renderVideo();
texture->display();
texture->setActive(false);
});
I get a black screen and a lockup.
from mdk-sdk.
I think I've managed to get rid of the memory leak by creating a dedicated sf::Context for the player. I've updated the test example from the first post. It's still leaking but very little comparing to the previous version, and I'm not sure if it only affects FFmpeg, MMAL seems fine, but maybe because half of my test videos is in yuv444
and showing a black screen.
from mdk-sdk.
I'm still getting this error though even after adding the context:
get Context 0xb42660/0xa2c610 has no local data for key 0xa80fe8, create 1(0xf98690)
get Context 0xb42660/0xa2c610 has no local data for key 0xbd5af8, create 1(0xfb0650)
Any clues? I run SFML in KMS environment.
from mdk-sdk.
I'm still getting this error though even after adding the context:
get Context 0xb42660/0xa2c610 has no local data for key 0xa80fe8, create 1(0xf98690) get Context 0xb42660/0xa2c610 has no local data for key 0xbd5af8, create 1(0xfb0650)
Any clues? I run SFML in KMS environment.
It's not an error. maybe i forgot to remove these logs
from mdk-sdk.
I think I've managed to get rid of the memory leak by creating a dedicated sf::Context for the player. I've updated the test example from the first post. It's still leaking but very little comparing to the previous version, and I'm not sure if it only affects FFmpeg, MMAL seems fine, but maybe because half of my test videos is in
yuv444
and showing a black screen.
only yuv444 videos are black?
from mdk-sdk.
Yes. But actually I did not have any videos encoded with other color spaces apart from yuv420 and yuv444. I may try to reencode and check. I suspect that only yuv420 is hw accelerated on PI so a fallback to ffmpeg for anything other than yuv420 would be neccessary.
from mdk-sdk.
。use v4l2m2m instead
from mdk-sdk.
Isn't v4l2 for encoding camera streams?
from mdk-sdk.
video decoding and encoding are supported on many arm devices. see the latest release note for more details
from mdk-sdk.
Related Issues (20)
- 由于找不到mdk.dll,无法继续执行代码 HOT 6
- 额外字幕的添加 HOT 4
- 在安卓上mdk::SetGlobalOption("JavaVM", QJniEnvironment::javaVM())是否是必须的? HOT 11
- linux arm64 执行./aplay 报错提示找不到 libpulse.so HOT 3
- 只有集显的window平台 setDecoders解码参数要怎么填好? HOT 1
- [feature request] Need a mdk::Player::getDecoder function HOT 11
- Thumbnail generation HOT 2
- 开启最快速度解码后音频严重滞后 HOT 6
- setLoop(-1); 有些电脑不生效 HOT 4
- android使用sync控制视频进度的时候,会不断间隔黑屏 HOT 6
- 国产aarch64架构的cpu和国产系统的, 怎么使用mdk-sdk? HOT 4
- 如何正确使用Vulkan作为渲染API HOT 18
- 是否提供播放进度变化positionchanged信号 HOT 1
- Crash on Debian 12 HOT 12
- avdevice://dshow:video=screen-capture-recorder 无画面 HOT 2
- sync控制视频进度的时候,音画不同步 HOT 7
- 单独渲染YUV数据,ID3D11Texture2D,LPDIRECT3DSURFACE9 HOT 4
- 如何设置AVFormatContext.video_codec_id = AV_CODEC_ID_MJPEG HOT 31
- Dead lock on mp4 playing HOT 3
- Question. I have a device that receives an rtsp stream and plays it through your library. Is it possible to stream this video to another device HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdk-sdk.