Guidance on running this gstreamer pipeline on Jetson Orin Nano

Hello there,
I am trying to run this below pipeline , This GStreamer pipeline is designed to read an H.264-encoded video file, decode it using NVIDIA hardware acceleration, limit the frame rate to 10 FPS, resize and convert the video to BGR format, and finally deliver frames to an OpenCV application via appsink :

gst_pipeline=(
f"filesrc location={path} ! "
f"qtdemux ! "
f"h264parse ! "
f"nvv4l2decoder ! "
f"videorate drop-only=true max-rate=10 ! "
f"video/x-raw framerate=10/1 ! "
f"nvvidconv ! "
f"video/x-raw,width=956,height=540,format=BGRx ! "
f"videoconvert ! "
f"video/x-raw,format=BGR ! "
f"appsink drop=1 sync=false !"

But it is giving the below error :

[ WARN:0@0.687] global cap_gstreamer.cpp:2839 handleMessage OpenCV | Gstreamer warning: Embedded video playback halted; module qtdemux0 reported: Internal data stream error.

If anyone can provide a solution to this please help. I am really greatfull to everyone.

Hi,
Please run gst-launch-1.0 command with fakesink to ensure the pipeline is good. You can run like:

$ gst-launch-1.0 filesrc location=a.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! fakesink

If it runs successfully, it is supposed to work by applying to cv2.VideoCapture() with appsink.

Here is a python sample for your reference:
Increasing play speed decoding from mp4 file - #9 by DaneLLL

1 Like

In my case, the problem was caused by a conflict between opencv-headless and other packages within the environment. Removing opencv-headless and installing the standard opencv-python package resolved the issue.

If you’re using a virtual environment, you can try the following steps:

pip uninstall opencv-headless
pip install opencv-python

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.