-
Notifications
You must be signed in to change notification settings - Fork 80
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
Q: yuv decoding and preview - mutually exclusive? #53
Comments
To answer my own question: Yes it is. |
I think so yea |
I have the same issue. Any workaround? I guess that if there is a way to manually render the decoded data (ByteBuffer) back into the Texture View it would do the job. |
This is what I did |
If anyone is struggling with this, what I did to see the video fee in screen and decoding frames at the same time is to convert the result byte buffer from decoding into a BitMap, then call to render the BitMap into a ImageView. Something like this:
Taken from stackoverflow |
That is surely possible but not the most performant solution. |
|
Hello @0xm1nam0 ! But as mentioned above if you enable YUV decoding, it doesn't render it anymore to surface texture. How is therefore above snippet relevant? |
@neilyoung Could you share more details on this? I need to convert raw data to YUV data while keeping the preview working. I think the only option here is to do this manually rather than rely on DJI SDK. If you could share some code or references to convert raw bytes from DJI SDK to YUV buffer then it would be really helpful. |
What do you mean by "raw data"? |
Byte are received from VideoDataListener |
So then it is H.264. You can use the DJI SDK to decode and convert it to YUV. For display (due to the mutual exclusion mentioned above) you might consider to use GLE20 code and a GLSurfaceView. Sorry, can't share code. |
When you say use DJI SDK to convert the code do you mean using DJICodecManager.YuvDataCallback? Is it possible to the conversion manually rather that using DJI SDK method? I want to keep using FPVWidget to show drone feed. |
This is not conversion, this is H.264 decoding. You can do this by using Android MediaCodec API https://developer.android.com/reference/android/media/MediaCodec Never did that |
Not a bug, just a question: I played a bit with the DJIVideoStreamDecoding example. I noticed, that whenever yuv decoding is switched on
neither of the views (texture, surface) is updated anymore.
This observation is backed up by this series of traces after the switch above:
Does that mean I can't video preview and yuv decode at the same time? Then I'm wondering, how I could flight if I just want to obtain the video for post processing purposes.
The text was updated successfully, but these errors were encountered: