Ask Your Question
0

Push cv::Mat to RTSP stream

asked 2014-01-22 20:44:58 -0500

MRDaniel gravatar image

updated 2014-01-25 06:28:57 -0500

berak gravatar image

Hello,

Is there a solution to pushing a webcam image after filtering to an RTSP stream so others could connect to it?

Camera --> Capture >> cv::Mat --> FindContours --> DrawContours --> Serve as RTSP to any connected clients.

Regards,

Daniel

edit retag flag offensive close merge delete

Comments

Please use google ... just look for a C++ RSTP creation library and transform your OpenCV data to the correct input format. Some suggestions can be found here ...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-23 04:29:55 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-01-23 14:15:21 -0500

MRDaniel gravatar image

Excellent. My Google-fu seems to be off. The 'creation library' term make all of the different.

http://weeklybuild.com/2013/01/creating-an-rtsp-stream-with-gstreamer/

I have been using Google and have investigated Rtsp and Rtmp.

edit flag offensive delete link more

Comments

Good that you have found a solution. Hooray!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-24 02:09:05 -0500 )edit
0

answered 2014-01-25 06:22:55 -0500

MRDaniel gravatar image

This is the sample jpeg sent to the RTSP.

Would this simply be uchar* image = cv::Mat.ptr<uchar>(0);

char JpegScanDataCh1A[KJpegCh1ScanDataLen] = { 0xf8, 0xbe, 0x8a, 0x28, 0xaf, 0xe5, 0x33, 0xfd, 0xfc, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x0a, 0x28, 0xa2, 0x80, 0x3f, 0xff, 0xd9
};

Any other ideas?

edit flag offensive delete link more

Comments

1

that's a jpeg in memory, not pixels. look at imdecode

(and you'll probably need it the other wy round: imencode your Mat before streaming it out, no ? )

berak gravatar imageberak ( 2014-01-25 06:31:16 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2014-01-22 20:44:58 -0500

Seen: 1,451 times

Last updated: Jan 25 '14