-
Notifications
You must be signed in to change notification settings - Fork 405
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
ExoPlayer Custom Renderer #1422
Comments
Hi @dhruvsingla273,
I think this should help you to achieve your goal. |
Hi @droid-girl , I tried making a custom Renderers Factory from MediaCodecVideoRenderer, but the ByteBuffer I got was empty as I got to know that Media Codec runs in Surface mode and hence it is not storing anything in buffers to improve codec performance. I could try to set MediaCodec to byteBuffer mode to get the byteBuffer but I read it is very slow. (Also can you tell how to set this mode change for MediaCodec in ExoPlayer) Could you suggest a different approach? |
I have one more question. I know it might be confusing, please ask any clarification on the question you may need. |
Hi @droid-girl |
Hi @dhruvsingla273 ,
Here is just a high level overview of what needs to be done |
Thanks for the response Meanwhile Do you have idea how can we do this? |
@tonihei could you help with the last question? |
That's not possible at the moment because there is no mode in which you can render existing decoded frames from ByteBuffers. ExoPlayer supports image playback, as a series of Bitmaps, but this sounds very inefficient as you have to move the fully decoded buffers around. I think it's usually preferable to do all processing on the GPU? I think that's the approach @droid-girl explained above. |
Hi @droid-girl, using the effect method I was able to get the bitmap at each frame, Any idea why? |
It is hard to say without looking at the code and debugging it. |
So, i was experimenting with the .setVideoEffect And then the player crashes/stops at sometimes after 10/4/5 sec of playback The code:
This is the error log I get: |
Lets say it took 2 sec to process 10 frames, Can you help with this |
Current ExoPlayer not support ByteBuffer mode, but it's possible to patch |
@halx99 I already tried this approach, I am able to get a image there (have to set the surface to null to make it run in ByteBuffer mode) Do you have any solution for this? |
You can render the bytebuffer(NV12 pixel data) to GLSurface with custom fragment shader, refer to: https://github.com/axmolengine/axmol/blob/dev/core/renderer/shaders/videoTextureNV12.frag Edit: in some old device the decoded bytebuffer would be I420 pixel data, refer axmolengine/axmol#2050 |
Okay will try that, Does anyone knows in which format the buffer is stored when the encoding is mkv |
I guess bytebuffer mode always NV12, refer https://github.com/axmolengine/axmol/wiki/Media-Player |
@halx99 I tried to get the buffer at the processOutputBuffer function in MediaCodecVideoRenderer But after the player tries to display the frame as there is no surface it is unable to render, |
We are planning to merge a TFLite sample to platform-samples. Take a look for more details on the integration here |
Thanks |
Thanks. Please update if you have any questions. |
Hey @dhruvsingla273. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Since there haven't been any recent updates here, I am going to close this issue. @dhruvsingla273 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
Hi All,
I am trying to create a player in which I want to do processing on frames of the video.
So, I need to get each frame of the video, do some processing on it, and have to then render it to the Screen.
I searched but couldn't find a compelling method that can be fast enough to render.
Can someone guide me for this how to make the custom renderer.
The text was updated successfully, but these errors were encountered: