0

Hi I want to create the following pipe in python.

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink

I have tried the following

 pipeline = gst.Pipeline("test-pipeline")
 source =  "udp://@127.0.0.1:5000" 
 rtph264pay= gst.element_factory_make("rtph264pay", "rtph264pay") 
 x264enc= gst.element_factory_make("x264enc", "x264enc")
 pipeline.add(source,rtph264pay,x264enc)  
 cap = cv2.VideoCapture(pipeline);        
 cap.set(cv2.cv.CV_CAP_PROP_FOURCC, cv2.cv.CV_FOURCC('H', '2', '6', '4'));        
 cap.set(3,640)
 cap.set(4,340)

What am I doing wrong ?

I read the following questions : Question 1

Community
  • 1
  • 1
Akash Deshpande
  • 2,583
  • 10
  • 41
  • 82

1 Answers1

0

It seems this question is similar. And are you sure VideoCapture function supports direct gst PIPE? I only used videoN device (loop-back or direct).

Community
  • 1
  • 1
DeDenker
  • 397
  • 3
  • 14