Skip to main content

What is the GStreamer App Builder Skill?

The QIM SDK GStreamer App Builder is an AI coding skill that generates GStreamer pipelines/applications using the QIM SDK GStreamer API. You describe the pipeline behavior and configuration in natural language, and the agent produces either a native GStreamer C application (main.c + CMakeLists.txt) or a gst-launch shell script — along with a README.md that documents the generated app.
The skill can generate both native C applications and gst-launch shell scripts. The example on this page shows a native C application; use the prompt to request a gst-launch script instead when you want a quick, build-free pipeline.
Flow QIM SDK coding agent workflow What it generates For a native C application request, the agent produces an artifact folder containing:
  • main.c — a complete, buildable native GStreamer C application, including element creation, property configuration, dynamic pad handling, linking, and bus/event-loop management
  • CMakeLists.txt — the build script that compiles main.c against GStreamer and links gstappsutils
  • README.md — a detailed document covering:
    • Purpose and pipeline behavior summary
    • Configuration placeholders (input, model, labels, output paths)
    • A step-by-step pipeline flow (text summary + Mermaid diagram)
    • Steps to build and run the app on device
For a gst-launch request, the agent instead produces a shell script containing the full gst-launch-1.0 pipeline plus a README.md. Supported use cases:

Prerequisites

For generating code

Qualcomm dev kits are not needed for code generation.
Host Machine: Any PC with internet access Coding Agent: Any AI coding agent installed (Claude Code, Cursor, Codex, etc.) which supports skills — the skills provided are agent-agnostic.
This skill is designed to work well even with low-reasoning / smaller models.Eg: A Sonnet 4.5 model is sufficient.

For deploying and running apps

The target devices where QIM SDK is supported (see QIM SDK Installation Guide)

How to Use

Step 1: Get the skill

Clone the skill repository to your host machine, then copy the QIM SDK GStreamer App Builder skill into your coding agent’s skills directory. Also copy the qimsdk-deploy skill, which builds, deploys, and runs the generated app on device (see Step 4):
After copying, your skills directory should look like this:
The skills directory is agent-specific — Claude Code uses ~/.claude/skills/. Check your coding agent’s documentation for its skills location. You can also scope skills to a single workspace (e.g. Claude Code supports <project>/.claude/skills/).

Step 2: Load the skill

Restart (or reload) your coding agent after placing the skills so it picks them up. They will appear automatically in the /skills list. To verify, open the agent panel and run:
You should see both qimsdk-gstreamer-app-builder and qimsdk-deploy listed.

Step 3: Generate the application

Describe your pipeline to the agent. It will automatically activate the skill and generate a complete main.c, CMakeLists.txt, and README.md (or a gst-launch script plus README.md).

Sample Prompt

Prompt format — describe pipeline behavior and configuration:
To generate a gst-launch shell script instead of a C app, ask for it explicitly — e.g. “Create a gst-launch script for single-stream YOLOX object detection …”.
More sample prompts can be found in the Available Sample Prompts section below.

Generated README.md

The README documents the generated app in full:
  • Purpose — a plain-English summary of what the pipeline does
  • Files — lists main.c, CMakeLists.txt, and README.md with descriptions
  • Assumptions — codec format, quantization requirements, camera defaults, output directory pre-conditions
  • Configuration — all user-supplied paths (input, model, labels, output) with instructions on where to change them
  • Placeholders to Fill — any values you still need to supply, or a note that none remain when the request was fully specified
  • Pipeline Flow — a Text Summary walkthrough of every element plus a Mermaid Diagram of the full pipeline
  • Steps to Compile — how to build the app for Yocto
  • Steps to Run — exact commands to run on device

QIM SDK GStreamer C App — Single-Stream YOLOX Object Detection (MP4 → MP4)

Purpose

Decode an MP4 file with the Qualcomm hardware decoder, run YOLOX object detection on full frames using the TFLite external delegate on the HTP/NPU, merge the detection metadata with the video stream, overlay bounding boxes and class labels, then hardware-encode the annotated video to an output MP4 file. Headless (no display).

Files

  • main.c — GStreamer C sample app (uses gst_parse_launch)
  • CMakeLists.txt — build target gst-qimsdk-yolox-obj-detect-encode
  • README.md — this file

Assumptions

  • Input is H.264-in-MP4, decoded with v4l2h264dec (capture-io-mode=4, output-io-mode=4).
  • YOLOX (yolox_w8a8.tflite) uses the yolov8 postprocess module with yolov8.json labels, per the model catalog.
  • Confidence threshold: {"confidence": 51.0}.
  • No bbox-stabilization — this is a file source, not a live camera feed.
  • Encoder v4l2h264enc io-modes 4/4 — correct for decoder-produced (DMA) NV12 buffers from a file source.
  • All file paths are resolved at runtime via g_getenv("HOME") — C string literals do not expand $HOME.

Configuration (resolved at runtime from $HOME)

Placeholders to Fill

None — all paths and values are concrete. If you need different paths, edit the g_strdup_printf calls in main.c.

Pipeline Flow

Text Summary

filesrc reads the MP4; qtdemux demuxes the H.264 stream, h264parse prepares it, and v4l2h264dec hardware-decodes to NV12. A tee (t) splits:
  • AI branch: qtimlvconverterqtimltflite (YOLOX, HTP/NPU external delegate) → qtimlpostprocess (module=yolov8, confidence 51.0) → text/x-raw caps-filter → qtimetamux.
  • Passthrough / video branch: → qtimetamux (metamux).
qtimetamux merges metadata onto the video frames, qtivoverlay draws bounding boxes and labels, and v4l2h264enc encodes back to H.264. h264parse + mp4mux + filesink write the output MP4.

Mermaid Diagram

Steps to Compile

Yocto: https://imsdkdocs.qualcomm.com/advanced/yocto-build#steps-to-build-custom-application

Steps to Run

All referenced files — the input MP4, the yolox_w8a8.tflite model, and the yolov8.json labels — must already be present on the device at the paths listed in Configuration above.
The app runs to end-of-file, finalizes the MP4 container, and exits. The output file is written to $HOME/Downloads/qimsdk_samples/media/obj_detect_out.mp4 on the device.

Generated main.c

  • The generated application uses gst_parse_launch to build the full pipeline from a single pipeline string — no manual element creation or pad linking.
  • All file paths are resolved at runtime via g_getenv("HOME") and formatted with g_strdup_printf — C string literals do not expand $HOME.
  • A GLib main loop and bus watch handle EOS and errors; a SIGINT handler (g_unix_signal_add) allows clean shutdown.
  • qtivoverlay draws bounding boxes, and the result is hardware-encoded and written to an MP4 file via filesink.

Generated CMakeLists.txt

  • Uses pkg-config to locate the required gstreamer-1.0 development package.
  • Builds a single executable (gst-qimsdk-yolox-obj-detect-encode) from main.c and links GStreamer libraries plus gstappsutils.
  • Installs the binary to ${GST_PLUGINS_QTI_OSS_INSTALL_BINDIR} with standard executable permissions.

Step 4: Running the applications

1

Download Required Files

If the downloaded model file is a .zip archive, extract it on your host machine before copying: unzip filename.zip
2

Copy the assets to the device

The input video, model, and labels must be present on the device before running — regardless of how you build and run the app. Copy them to the paths main.c expects:
3

Build and run the application

Unlike a gst-launch script, a native C app must be compiled before it can run. With the assets in place, you have two options to build and run the agent-generated app:Option A — Use the QIM SDK Deploy skill:The qimsdk-deploy skill builds the app on your host against the SDK, then pushes the compiled binary to the device and runs it over SSH. It handles only the app build and binary transfer — the assets from the previous step must already be on the device.Option B — Follow the generated README:Follow the steps in the generated README.md to compile the app, then push the binary to the device and run it:
  1. Compile the app by following the build steps for your platform:
  2. Push the compiled binary to the device and run it:
On completion (EOS), the annotated video is written to ~/Downloads/qimsdk_samples/media/obj_detect_out.mp4.

Available Sample Prompts