Skip to content

Convert gvapython samples to standalone Python GStreamer elements usi…#777

Open
jmotow wants to merge 1 commit intomainfrom
convert_samples_to_gvapython
Open

Convert gvapython samples to standalone Python GStreamer elements usi…#777
jmotow wants to merge 1 commit intomainfrom
convert_samples_to_gvapython

Conversation

@jmotow
Copy link
Copy Markdown
Contributor

@jmotow jmotow commented Apr 14, 2026

Summary

Converts two gvapython-based samples into standalone GStreamer Python elements using the GstAnalytics metadata API, as a step toward removing gvapython element support from the DLS project.

Changes

New samples in samples/gstreamer/gst_launch/python-elements/

save_frames_with_ROI_only

  • gvaframesaver_py — custom BaseTransform element that reads GstAnalytics.ODMtd detection metadata and saves annotated frames to disk
  • Replaces: gvapython module=... class=FrameSaver function=process_frame

face_detection_and_classification

  • gvaagelogger_py — custom BaseTransform element that reads GstAnalytics.ClsMtd classification metadata and logs age values to file
  • Replaces: 3× gvapython elements (SSD post-proc, age/gender post-proc, age logger) with gvadetect + gvaclassify + gvaagelogger_py

Key design decisions

  • Follows the same plugin pattern as samples/gstreamer/python/smart_nvr (custom elements in plugins/python/)
  • Uses GstAnalytics API (ODMtd, ClsMtd) instead of gstgva.VideoFrame API
  • Shell scripts auto-add local plugins/ to GST_PLUGIN_PATH — no external setup needed
  • Element properties are configurable via gst-launch-1.0 syntax

Other changes

  • Updated samples/gstreamer/README.md with new sample entries
  • Fixed setenv.sh to resolve script directory via dirname instead of $(pwd)

Testing

  • face_detection_and_classification.sh — ~212 FPS on CPU, 3410+ age entries logged to /tmp/age_log.txt
  • save_frames_with_roi.sh — frames with bounding boxes saved to saved_frames/
  • pylint 10.00/10 on both Python files (with project pylintrc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant