I Video-Streaming jetson TX1 abgeschlossen und mein PCWie kombiniere ich opencv und gstreamer?
jetzt opencvcode der Videoverarbeitung
so, ich will opencv Code anzupassen in jetson gstreamer
Next-Code ist PC-jetson TX1 Streaming Ich habe und opencv Code
//jetson code//
CLIENT_IP=10.100.0.70
gst-launch-1.0 nvcamerasrc fpsRange="30 30" intent=3 ! nvvidconv flip-method=6 \
! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! \
omxh264enc control-rate=2 bitrate=4000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! \
h264parse ! rtph264pay mtu=1400 ! udpsink host=$CLIENT_IP port=5000 sync=false async=false
// PC code//
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! queue ! avdec_h264 ! xvimagesink sync=false async=false -e
opencv code
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
int main()
{
cv::Mat img,img_gray;
cv::VideoCapture input(0);
for(;;)
{
if (!input.read(img))
break;
cv::cvtColor(img, img_gray, CV_RGB2GRAY);
cv::imshow("img", img);
cv::imshow("gray", img_gray);
char c = cv::waitKey(30);
if (c == 27)
break;
}
}