gst-launch pipeline to gstreamer elements, I can't fix the caps

Katerina Voulgary katerina.voulgary at iccs.gr
Thu Sep 17 11:07:29 UTC 2020


Problem solved. I had left a "frame = cv2.cvtColor(frame, 
cv2.COLOR_GRAY2BGR)" in the python code that converted the frame to a 3 
channel grayscale and the buffer had wrong size.

Στις 17/9/20 10:29 π.μ., η Katerina Voulgary έγραψε:
> Hello, I have the following pipeline in python/opencv that streamed correctly:
>
>   writer = cv2.VideoWriter("appsrc caps=video/x-raw,format=GRAY8,pixel-aspect-ratio=1,width=80,height=60,framerate=9/1 \
>    ! queue ! videoconvert ! queue ! videoscale ! capsfilter caps=video/x-raw,format=I420,width=640,height=480,framerate=9/1 \
>    ! queue ! omxh264enc bitrate=160000 control-rate=2 profile=1 preset-level=0 ! capsfilter caps=video/x-h264,stream-format=byte-stream \
>    ! queue ! rtph264pay pt=96 config-interval=-1 ! udpsink host=192.168.111.228 port=5600 sync=false async=false",cv2.CAP_GSTREAMER,fourcc,9.0,(80,60))
>
>    while True:
>      frame = capture(...) #this is from pylepton capture, returns numpy array
>      frame = cv2.cvtColor(frame, cv2.COLOR_GRAY2BGR)
>      writer.write(frame)
>
> with listener as: udpsrc port=xxx ! application/x-rtp,encoding-name=H264,payload=96 ! queue ! rtph264depay ! decodebin ! videoconvert ! videoscale ! xvimagesink
>
>
> Now I use gstreamer elements and output is warped like if the caps are wrong. Gstreamer is launched from within gst-build,both listener and transmitter.
> I have tried several ways and didn't get anywhere: GST_DEBUG filtered on caps/videoconverter/appsrc,identity element and filesink along the pipeline.
> It is probably something simple that I don't see,perhaps there is something that cv2.VideoWriter handles internally and that I missed in the elements?
>
> I attach the test code, if someone wants to take a look or suggest a debug method I thank them very much.
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200917/f8c45fd8/attachment.htm>


More information about the gstreamer-devel mailing list