Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stream raw image data stored in memory buffer using LibVLC over network in Visual Studio C++?

As my target was :

  1. Stream video from IP camera using LibVLC
  2. Process the video using OpenCV
  3. Then re-stream the processed video/image over network using LibVLC so that other connected clients can see the processed video/image in real time(No storing of video/image to disk first).

I have successfully accomplished first two tasks, but now i want to stream the processed video/image over network from the memory buffer as source, memory buffer is a iplimage variable, it could Mat variable. So, if somebody know how to stream such a raw data using libvlc then please help out, or point me to the right direction or sample code or link. Would be thankful..!

like image 788
shujaat Avatar asked Nov 24 '25 12:11

shujaat


1 Answers

Try imem, then you can use memory input as the stream source. By implementing the get-release callbacks of the module, you can point where your buffer is and set the values for decode-presentation timestamps. Here are the prototypes for get and release:

    int imemGetCallback(void *userdata, const char* cookie, int64_t *dts, int64_t *pts, unsigned *flags, size_t *bufferSize, void **buffer);
    int imemReleaseCallback(void *data, const char *cookie, size_t bufferSize, void *buffer);
like image 146
flekz Avatar answered Nov 27 '25 00:11

flekz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!