# Get camera Frame from libmodal pipe client

Source: https://forum.modalai.com/topic/833/get-camera-frame-from-libmodal-pipe-client
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: mpa
Posted: 2022-04-01 14:17:49 UTC by Philemon Benner
Replies: 4 · Views: 1930

## Philemon Benner · 2022-04-01 14:17:49 UTC

Hey,
i'm currently working on getting frames from libmodal pipe. I've looked up the examples of modal pipe, also had a look at voxl-streamer but didn't understood too much. Regarding too the struct of the ```
pipe_client_set_camera_helper_cb``` in ```modal_pipe_client.h (l.322-355)```, is there any way to get the actual frame from that? I'm unfortunately not familiar with buffers and how they work. In voxl streamer the context is being used but in the header file only channel, metadata, and the frame beginning pointer? are being mentioned. Is the context the actual frame?

## Reply by Steve Turner · 2022-04-01 15:36:49 UTC

Check out https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-streamer/-/blob/master/src/main.c#L87 for an example of how to handle the callback.

## Reply by Philemon Benner · 2022-04-01 15:59:14 UTC (in reply to Steve Turner)

@Darkhive that's what i've mentioned above in the post. I don't have a clear understanding of how voxl-streamer camera_cb works and i don't want to use gstreamer to get the actual frame.

## Reply by Philemon Benner · 2022-04-01 16:04:26 UTC

Would something like that work?
```
char* buffer[meta.size_bytes];
memcpy(buffer, frame, meta.size_bytes);
```

## Reply by Steve Turner · 2022-04-01 16:20:16 UTC

https://gitlab.com/voxl-public/voxl-sdk/services/voxl-portal/-/blob/master/src/video_manager.cpp#L77

Is an example of allocating a buffer and copying the frame into it. There are some other good examples in that file as well for processing frames and converting them to various formats within the callback. Hope that helps!
