Hello,
i try to stream video.mp4 file from opencv-python by using Gstream pipeline. but when i run the pipeline in terminal it 's work successful. my problem is when i try to read a video file by Opencv + pipeline:
-My configuration is: jetson Xavier, jetpack 4.4, Opencv-python V4.5. gst-launch-1.0.
This pipeline is work :
gst-launch-1.0 filesrc location=video.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! omxh264dec ! nvoverlaysink -e
But when i run this follow program i have in result any stream but just message âempty frameâ:
import cv2
def _gst_cap_pipeline():
return âfilesrc location=video.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! omxh264dec ! appsink sync=falseâ
source = cv2.VideoCapture(_gst_cap_pipeline(), cv2.CAP_GSTREAMER)
while True:
ret, frame = source.read()
if not ret:
print(âempty frameâ)
break
cv2.imshow(âsendâ, frame)
if cv2.waitKey(1)&0xFF == ord(âqâ):
break
Please, anyone can help me to solve the problem !! .