-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gstreamer: Could not use gstreamer.run_pipeline with MP4 videosrc #87
Comments
Did you get to the bottom of this? Closest I've come to running my own video on the Dev Board Mini is to convert the mp4 using the following:
and then run it via:
I can't quite get this to work in the gstreamer.py script however |
@thebruce87m : I was able to put something together with help from a RidgeRun example pipeline The solution required a few extra components to be installed:
I was only targeting MP4 files, so I dropped the AVI support and ended up with the following pipeline definition:
Let me know if this works for you and/or if there are any changes/optimizations that can be made. I admittedly only know enough GStreamer to be dangerous so would welcome a second set of eyes! |
Thanks, with this edit to gstreamer.py along with changing to glimagesync I am able to run the example: diff --git a/gstreamer/gstreamer.py b/gstreamer/gstreamer.py
index 13dcd05..adff762 100755
--- a/gstreamer/gstreamer.py
+++ b/gstreamer/gstreamer.py
@@ -223,10 +223,11 @@ def run_pipeline(user_function,
PIPELINE = 'rtspsrc location=%s'%videosrc
else:
demux = 'avidemux' if videosrc.endswith('avi') else 'qtdemux'
- PIPELINE = """filesrc location=%s ! %s name=demux demux.video_0
- ! queue ! decodebin ! videorate
- ! videoconvert n-threads=4 ! videoscale n-threads=4
- ! {src_caps} ! {leaky_q} """ % (videosrc, demux)
+
+ PIPELINE = """filesrc location=%s ! qtdemux name=demux demux.video_0 !
+ h264parse ! avdec_h264 ! videorate ! videoconvert n-threads=4 !
+ videoscale n-threads=4 ! {src_caps} ! {leaky_q} """ % (videosrc)
+
''' Check for the object tracker.'''
if trackerName != None:
if trackerName == 'mediapipe':
@@ -254,7 +255,7 @@ def run_pipeline(user_function,
t. ! {leaky_q} ! videoconvert ! videoscale ! {scale_caps} ! videobox name=box autocrop=true
! {sink_caps} ! {sink_element}
t. ! {leaky_q} ! videoconvert
- ! rsvgoverlay name=overlay ! videoconvert ! ximagesink sync=false
+ ! rsvgoverlay name=overlay ! videoconvert ! glimagesink sync=false
"""
if objectOfTracker:
mot_tracker = objectOfTracker.trackerObject.mot_tracker
Now what I don't understand is that the inference time claims to be 140ms, but the fps claims to be 0 fps - which I think really means very slow. This is reflected by the bounding boxes not updating very often compared to the video output. Surely if the inference is 140ms I should be getting ~ 7 fps? Do you have any insights here? If not I'll add a new issue. Thanks for your help! |
Hi guys. A bit of a delayed response. I was also fighting with this one, and ended up streaming video with An other problem with direct video was that
|
Description
I am trying to leverage the gstreamer.py pipeline definition to run inference on test MP4 data instead of via the /dev/video1 webcam.
Looking at the run_pipeline function, this appears to be supported by the following else case on line 223 with the use of qtdemux:
When initializing the gstreamer pipeline, the following error occurs:
Click to expand!
Issue Type
Bug, Support
Operating System
Mendel Linux
Coral Device
Dev Board Mini
Other Devices
No response
Programming Language
Python 3.7
Relevant Log Output
No response
The text was updated successfully, but these errors were encountered: