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

Decoding documentation needed #8

Closed
SpencerKaiser opened this issue Sep 19, 2018 · 10 comments
Closed

Decoding documentation needed #8

SpencerKaiser opened this issue Sep 19, 2018 · 10 comments

Comments

@SpencerKaiser
Copy link

SpencerKaiser commented Sep 19, 2018

The DJIWidget is a delightful DJI library includes VideoPreviewer for video decoding

Where is the documentation for this feature? I need to use the video feed from DJIVideoFeedListener's delegate method func videoFeed(_ videoFeed: DJIVideoFeed, didUpdateVideoData rawData: Data) and convert it into something I can use with VNImageRequestHandler, but I don't see any docs on how to use the decoder to turn the raw data into something meaningful.

EDIT: Stack Overflow question I created for more support

@SpencerKaiser SpencerKaiser changed the title Decompression documentation needed Decoding documentation needed Sep 19, 2018
@lijia6745
Copy link

The steps :

  1. Call DJIVideoPreviewer’s push:length: method Input the rawData.Inside DJIVideoPrviewer, If you have used VideoPreviewerSDKAdapter please skip this. H.264 parsing and decoding steps are performed.
  2. Conforms the VideoFrameProcessor protocol and call DJIVideoPrviewer.registFrameProcessor register the VideoFrameProcessor protocol object.
  3. VideoFrameProcessor protocol’s videoProcessFrame: method will output the VideoFrameYUV data.
  4. Get the CVPixelBuffer data. VideoFrameYUV struct has a cv_pixelbuffer_fastupload field, this data is actually CVPixelBuffer when the hardware decoding is turned on.
    if use software decoding, then you need to create a CVPixelBuffer data and copy the data from the VideoFrameYUV's luma chromaB chromaR field.

@SpencerKaiser
Copy link
Author

@lijia6745 thanks for the response! It looks like my VideoFrameProcessor methods are never being called... any idea why that might be? And about the software decoding, how would I know which (hardware/software) is enabled??

@talobin
Copy link
Contributor

talobin commented Sep 20, 2018

Please continue the discussion on StackOverflow. @SpencerKaiser

@talobin talobin closed this as completed Sep 21, 2018
@SpencerKaiser
Copy link
Author

@talobin why was this issue closed? Other than the README, this SDK has no documentation... I would expect this issue to be closed once documentation has been added to support at least the component I described above

@sansha
Copy link

sansha commented Sep 26, 2018

I have similar problems where the delegate method func videoProcessFrame(_ frame: UnsafeMutablePointer<VideoFrameYUV>!) is never called even though I've registered the delegate:

DJIVideoPreviewer.instance()?.enableHardwareDecode = true
DJIVideoPreviewer.instance().registFrameProcessor(self)

@nguyenminhkhmt
Copy link

nguyenminhkhmt commented Sep 26, 2018

I have similar problems, but when I set enableHardwareDecode = true, cv_pixelbuffer_fastupload always return nil.

@SpencerKaiser
Copy link
Author

@sansha @nguyenminhkhmt I'm going to open a new issue for that, this issue was primarily just for documentation around the whole process. What the three of us are seeing is definitely a bug.

@SpencerKaiser
Copy link
Author

@sansha @nguyenminhkhmt here's the new issue, feel free to add additional comments there. Hopefully they'll actually respond via GitHub.

@sansha
Copy link

sansha commented Sep 26, 2018

Alright! Could you please post a link to that new issue here?
Edit: you're faster!

@dji-dev
Copy link
Contributor

dji-dev commented Sep 28, 2018

Hi @SpencerKaiser @sansha @nguyenminhkhmt , we just update the iOS SDK Github Sample to demonstrate how to use VideoFrameProcessor, please check if it helps.

dji-sdk/Mobile-SDK-iOS@8137760

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

No branches or pull requests

6 participants