Good day.
For my project I am using jetson xavier.
My goal it to create python script that read frame from the connected camera (Boson) and push image to the gstreamer pipeline through the network
When I tried to use opencv I received following error:
import cv2
“Illegal Instruction (Core Dump)”
I downgraded opencv and numpy according to this guide
https://forums.developer.nvidia.com/t/opencv-import-fails-with-illegal-instruction-core-dump/168060
opencv-python==4.5.3.56
numpy==1.19.4
And cv2 and flirpy python libraries started work
Then I tried to create VideoWriter with gstreamer pipeline
import cv2
…
gst_str_rtp = “appsrc ! decodebin ! x264enc ! rtph264pay ! udpsink host=10.0.0.19 port=5000”
out = cv2.VideoWriter(gst_str_rtp, 0, 10.0, (640, 480), True)
if not out.isOpened():
* print(“Failed to open output”)*
- exit()*
After I am starting this script - I received Failed to open output
Maybe this is because of the dimensions or else, so I tried to simplify the code
import cv2
im = cv2.read(“/home/rakia/Desktop/vimtestpy/1.jpg”)
gst_out = "appsrc ! video/x-raw, format=BGR ! queue ! videoconvert ! video/x-raw,format=BGRx ! nvvidconv ! nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=/home/rakia/Desktop/vimtestpy/test.mkv "
out = cv2.VideoWriter(gst_out, cv2.CAP_GSTREAMER, 0, float(10), (int(332), int(332)))
if not out.isOpened():
print(“Failed to open output”)
- exit()*
while True:
- out.write(im);*
print(“successfully exit”)
out.release()
if name == ‘main’:
- read_cam()*
The output is the same
Failed to open output
And the most important
I tested first version of code few month ago and it worked. What changed? What am I doing wrong?
Thank you