imdecode incoming stream
Hello,
I am recieving a stream from rtmpdump of type char*. So, it's an RTMP stream.
I have converted pushed each of the 3518 char items into a std::vector<uchar>
cv::Mat img = cv::imdecode(bufVec,0);
cv::Mat img = cv::imdecode(cv::Mat(bufVec),0);
cv::Mat img = cv::imdecode(bufVec,1);
cv::Mat img = cv::imdecode(cv::Mat(bufVec),1);
All of these attempts do not yield an image. The cv::Mat img has 0 rows and 0 cols. The rtmpdump example code writes this data to a file object.
If i read the uchar array to the console, it has a lot of meta data etc.
This is what i get if i push the data to the console.
Any clues on how to approach this? How do i get each frame?
no way cracking RTMP packets with imdecode, imho.
@berak flash players seem to manage it ok. It must be possible! :) I don't mind coding this, but a few pointers to get me thinking along the right lines would help a great deal here. Don't tell me it can't be done. Tell me why it _currently_ can't be done, and perhaps there is a way around it.
sure it can be done, just not by simply thowing it at imdecode.
aren't there libs for this ?
can't you plugin into ffmpeg, gstreamer or such ?
i totally forgot to ask the obvious:
did you try VideoCapture("whatever://my.stream.url") ?
I've tried that but the rtsp support for my media server isn't great. I can try gstreamer, thank you @berak.
@berak, for future reference, here is the RTSP attempt https://groups.google.com/forum/#!topic/c-rtmp-server/jw-ZEmjXQ68