First time here? Check out the FAQ!

Ask Your Question
0

Push cv::Mat to RTSP stream

asked Jan 23 '14

MRDaniel gravatar image

updated Jan 25 '14

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

Preview: (hide)

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 (Jan 23 '14)edit

2 answers

Sort by » oldest newest most voted
1

answered Jan 23 '14

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.

Preview: (hide)

Comments

Good that you have found a solution. Hooray!

StevenPuttemans gravatar imageStevenPuttemans (Jan 24 '14)edit
0

answered Jan 25 '14

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?

Preview: (hide)

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 (Jan 25 '14)edit

Question Tools

Stats

Asked: Jan 23 '14

Seen: 2,870 times

Last updated: Jan 25 '14