-
Notifications
You must be signed in to change notification settings - Fork 98
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
Added simple RTSP support and custom video sink option #40
base: main
Are you sure you want to change the base?
Changes from all commits
50b21d5
6f18ec1
f5ced65
3b771c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ class GStreamerDetectionApp(GStreamerApp): | |
def __init__(self, args, user_data): | ||
# Call the parent class constructor | ||
super().__init__(args, user_data) | ||
self.video_sink = args.video_sink if hasattr(args, 'video_sink') else 'autovideosink' | ||
# Additional initialization code can be added here | ||
# Set Hailo parameters these parameters should be set based on the model used | ||
self.batch_size = 2 | ||
|
@@ -154,6 +155,14 @@ def get_pipeline_string(self): | |
f"v4l2src device={self.video_source} name=src_0 ! " | ||
"video/x-raw, width=640, height=480, framerate=30/1 ! " | ||
) | ||
elif self.video_source.startswith("rtsp://"): | ||
source_element = ( | ||
f"rtspsrc location={self.video_source} name=src_0 ! " | ||
"application/x-rtp,media=video ! " | ||
"decodebin ! " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll need to add some queues between decodebin, videoconvert and videoscale. These are big tasks which can benefit if separated to multiple threads. |
||
"videoconvert ! videoscale ! " | ||
f"video/x-raw, format={self.network_format}, width={self.network_width}, height={self.network_height} ! " | ||
) | ||
else: | ||
source_element = ( | ||
f"filesrc location=\"{self.video_source}\" name=src_0 ! " | ||
|
@@ -216,6 +225,8 @@ def get_pipeline_string(self): | |
default=None, | ||
help="Path to costume labels JSON file", | ||
) | ||
parser.add_argument('--video-sink', default='autovideosink', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not used |
||
help='GStreamer video sink to use (e.g., autovideosink, ximagesink, fakesink)') | ||
args = parser.parse_args() | ||
app = GStreamerDetectionApp(args, user_data) | ||
app.run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used please remove