Giter Club home page Giter Club logo

Comments (37)

oomek avatar oomek commented on June 18, 2024

I've seen the sourceforge link, but the include directory is empty.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

I will upload new packages and push headers tomorrow

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

1 day later.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Out of curiosity. Does your player also use OMX_UseEGLImage() or just renders natively on RPI?

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

I use mmal and eglimage. I have studied omx and how to get max rendering performance. A generic solution is providing custom buffer header. But not sure what is it on rpi, maybe vcsm. Another is eglimage.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

I was experimenting with openmax api on the Raspberry Pi for the last month, but I'm still struggling with achieving satisfying results. The goal is to draw the video on the sfml texture that would allow me to make transforms like rotate/pinch/skew. For now I just have it drawing on the opengl texture, but I get tearing. When I added double buffering I get uneven framerates. Would you share a little insight on this matter?

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

This is supposed to be a replacement for the current implementation that uses mmal decoder and sws_scale, and then updating sfml image with a pixel buffer which has terrible performance caused by copying the frames 3 times between CPU-GPU memory.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

For now I just have it drawing on the opengl texture, but I get tearing.

How do you draw the frames?

I use an egl extension to convert decoded frame to eglimage(you can find it in official examples), then use eglimage as a texture. cpu load < 15% for 1080p videos, a litter higher than omxplayer, but better than others.

btw, how do you create an eglimage for omx?

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

This is a fork of another media player I'm trying to adapt to work with Attract Mode on the Raspberry Pi
https://github.com/oomek/rpi-mediaplayer

I use OMX_UseEGLImage on a set of gl textures and alternate between them. Then I draw using opengl. Later I'm planning to integrate it with sfml so I take texture.getNativeHandle() and decode with OMX.

Unfortunately there is tearing when I draw directly with single buffer on the texture and double/triple buffering would be an overkill for the RPI. Attract Mode is a frontend that can play multiple videos at the same time, so memory management is crucial.

Thi is the reason I'm looking for alternatives. Attract Mode uses mmal currently, but I haven't found any way to bind the mmal output to sfml texture with zero copy.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

When writing mmal decoder, I find playback is not smooth if input/output port buffer number and size is not good. Maybe omx is the same.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

You mean the i/o buffer of the video_decode or egl_render module?

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

I've tried querrying this:

OMX_PARAM_U32TYPE extraBuffers;
OMX_INIT_STRUCTURE(extraBuffers);
extraBuffers.nPortIndex = 130;
OMX_GetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexParamBrcmExtraBuffers, &extraBuffers);
printf("OMX_IndexParamBrcmExtraBuffers: %u\n", extraBuffers.nU32);

But it's already 16. Even if I set this to 256 it has no effect on stuttering. I'm out of ideas.
Sorry for mistake. I've corrected the struct type and the property name from nSize to nU32.
This value was 2, I've set it to 8, but it still stutters.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

what about port buffers? not extra buffers.

new sdk is uploaded.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

nBufferCountActual on the port 131 ( video_decoder output ) is 0
nBufferCountActual on the port 130 ( video_decoder input ) is 20

What value would you advise to set it to?

I've checked the new sdk for the Raspberry Pi , but the headers are still missing.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Default values may not work well without special code path.
https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp#L519

headers are in include dir. which one did you download? latest is https://sourceforge.net/projects/mdk-sdk/files/mdk-sdk-rpi.tar.xz/download

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

I must have downloaded the wrong file. The headers are there, thanks.
I've tried the mdkplay with my test videos, and I observe severe stuttering with 30fps files. Strangely 60fps files up to 720p play smoothly

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024
export MDK_LOG=1
./mdkplay -c:v MMAL videofile

then you will see log, can you paste the log here?

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Oh wait. it's just the console log. I did not refresh the page.
https://pastebin.com/6HwuwM2M

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

https://pastebin.com/GmkVmDw3

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Btw, The log is showing regardless of the MDK_LOG value

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Can you upload your video clip?

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

test480p30.zip
Play the first few seconds repeatedly as the stuttering is most visible in the beginning.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

squares.zip
Here are some better examples.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Too slow to download from github. You can upload to https://0x0.st

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

https://0x0.st/zPxs.zip

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Because the frame rate is to small. You can try other players on desktop, the same result.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Other players work fine, omxplayer also have no issues playing it without stuttering.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Works fine on my pi 3b+. What's your device?

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Hold on, I might have sent you a corrupted file.
https://0x0.st/zPxB.zip
Those I've tested in mpc-hc, vlc and omxplayer and the playback of 480p30 is smooth

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

3b+

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

What is your firmware version ? uname -a

Linux retropie 4.19.30-v7+ #1209 SMP Tue Mar 26 13:14:20 GMT 2019 armv7l GNU/Linux

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Linux raspberrypi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Are you certain that the video with 30fps I sent you do not stutter? This is weird. Are the ffmpeg libs in your player statically linked or shared?

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

Stutters like omxplayer. The same result on my mac using mpv or ffplay.
FFmpeg is statically linked. I plan to add an option to choose ffmpeg shared libs at runtime.

from mdk-sdk.

oomek avatar oomek commented on June 18, 2024

Just to make sure, you have tested the second link i posted https://0x0.st/zPxB.zip ? The 30fps inside do not stutter for me on any player, except mdk.

from mdk-sdk.

wang-bin avatar wang-bin commented on June 18, 2024

I downloaded wrong file. I see the stutter

from mdk-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.