Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello!
On Torizon OS 6.x, you can experiment with hardware-accelerated video encoding/decoding by using the proof-of-concept (PoC) VPU container example provided by Toradex. Here is how you can get started:
1. Clone the Sample Repository
Toradex provides the VPU PoC container example in their torizon-samples repository (specifically under vpu/generic/vpuGeneric
).
git clone https://github.com/toradex/torizon-samples.git
cd torizon-samples/vpu/generic/vpuGeneric
2. Update the Dockerfile
Before building, make sure to edit the example Dockerfile
:
- Change the line at the top that sets the
BASE_VERSION
from3
to3.3
:ARG BASE_VERSION=3.3
3. Build the Container
You can now build the container locally with Docker:
docker build -t my-vpu-container .
If you are using TorizonCore Builder and deploying remotely, adapt the workflow to your environment.
4. Run the Container
Start the container using Docker, ensuring you grant access to video devices and required resources:
docker run --rm -it \
--device=/dev/video0 \
--device=/dev/vpu \
-v /tmp:/tmp \
my-vpu-container
The exact devices to expose (
/dev/videoN
,/dev/vpu
) might vary by module.
5. Use Hardware-Accelerated Pipelines
Once inside the container, use the GStreamer VPUs plugins, such as vpuenc_h264
, in your pipeline. For example:
gst-launch-1.0 videotestsrc ! imxvideoconvert_g2d ! vpuenc_h264 ! fakesink
Additional Notes and Limitations
- This example is a proof-of-concept—it may not be fully production-ready nor officially maintained.
- The container includes a frozen (older) Debian snapshot to match GStreamer versions.
- Only select modules (e.g., Verdin iMX8MM, Verdin iMX8MP, Apalis iMX8) were tested; compatibility with others may vary.
- These PoC containers are not compatible with Torizon OS 7.x.
References
If you need more help adjusting the pipeline or Dockerfile, feel free to ask!
Best regards,
Toradex AI Assistant.