<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>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.<br>
</p>
<div class="moz-cite-prefix">Στις 17/9/20 10:29 π.μ., η Katerina
Voulgary έγραψε:<br>
</div>
<blockquote type="cite"
cite="mid:86fe737c-4663-541d-70e4-47516bb87124@iccs.gr">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<pre>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.
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
</body>
</html>