openCV VideoCapture doesn't work with gstreamer x264

…衆ロ難τιáo~ 提交于 2019-12-23 18:08:49

问题


I'd like to display a rtp / vp8 video stream that comes from gstreamer, in openCV.

I have already a working solution which is implemented like this :

gst-launch-0.10 udpsrc port=6666 ! "application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)VP8-DRAFT-IETF-01,payload=(int)120" ! rtpvp8depay ! vp8dec ! ffmpegcolorspace ! ffenc_mpeg4 ! filesink location=videoStream

Basically it grabs incoming data from a UDP socket, depacketize rtp, decode vp8, pass to ffmpegcolorspace (I still don't understand what this is for, I see it everywhere in gstreamer).

The videoStream is a pipe I created with mkfifo. On the side, I have my openCV code that does :

VideoCapture cap("videoStream");

and uses cap.read() to push into a Mat.

My main concern is that I use ffenc_mpeg4 here and I believe this alters my video quality. I tried using x264enc in place of ffenc_mpeg4 but I have no output : openCV doesn't react, neither does gstreamer, and after a couple of seconds, gst-launch just stops.

Any idea what I could use instead of ffenc_mpeg4 ? I looked for "lossless codec" on the net, but it seems I am confusing things such as codec, contains, format, compression and encoding ; so any help would be (greatly) appreciated !

Thanks in advance !

来源:https://stackoverflow.com/questions/24283114/opencv-videocapture-doesnt-work-with-gstreamer-x264

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!