get frame and conver to image from a raw bytes array on iOS/macOS

asked 2019-12-01 05:54:31 -0600

Hi there,

So I have been working on a iOS app project in Swift to display camera output of a drone. The drone will send the h264 raw data/bytes via UDP to my local machine 0.0.0.0:11111.

My problem is, I'm too new to opencv2 APIs. I tried someting like

cv::VideoCapture cap = cv::VideoCapture("udp://0.0.0.0:11111");
bool opened = cap.isOpened();

however it's saying it's not implemented on macos/iOS. So far, I could get the byte array in Swift data structure, and should not be hard to conver to C types.

however I'm kind of new to C++, especially figuring out what APIs to use.

my goal would be being able to use opencv2 to display the camera output, my idea is looking for APIs to generate h264 content. Can somebody help on this? Like is there any tutorials for reading raw h264 encoded raw frame bytes?

e.g. in my guess, my code could looks like

Frame * frame = cv::generateFrame(rawH264Bytes)
opencv2.display(frame)
edit retag flag offensive close merge delete