Docker Build Scripts

I put together a GitHub repo to simplify building various vendor components including the kernel, U-Boot, rkdeveloptool, and EDK2.

There are also dedicated builds for Rockchip NPU (ML) and Rockchip MPP (hardware accelerated video encoding/decoding via Gstreamer).

The README should get you started, but if you have any questions, feel free to open an issue or reply here. I hope someone else finds it useful!


DISCLAIMER: I work for Docker Inc but this is a personal side-project.

4 Likes

Nice! Thanks for contributing

I’m continuing to maintain & expand this. For example, U-Boot has been building for the 5A as well for a while now. I pre-ordered, so once I get my voucher + board, I’ll actually test this :wink:

Two bigger additions are builds & images for the Rockchip NPU (for ML) libraries and Rockchip MPP (for accelerated video encoding/decoding).

rknpu

The NPU builds are a bit more experimental. I believe everything is working, but I haven’t been able to get the benchmark with YOLOv8s running yet.

If you’re interested, however, take a look here:

rkmpp

The MPP builds I’ve been able to use a bit more extensively: I’ve successfully captured HDMI-IN @ 4k60, encoded it as H264, and streamed it with RTMP from within a container.

tl;dr

Ubuntu base images with everything needed for hardware accelerated encoding/decoding now on Docker Hub: https://hub.docker.com/r/milas/rkmpp-ubuntu

docker run --rm -it --privileged docker.io/milas/rkmpp-ubuntu:22.04

(Or :20.04 for Focal.)

Example: HDMI-IN @ 4k60 --> h264 RTMP Stream [Docker]

  1. Launch mediamtx on the Rock 5
    docker run --rm -it --network=host aler9/rtsp-simple-server
    
    When you’re done, hit Ctrl-C to kill it.
  2. Run a container and stream to the server:
    docker run --pull=always --rm -it --privileged --network=host milas/rkmpp-ubuntu:22.04 \
      gst-launch-1.0 v4l2src device=/dev/video0 io-mode=dmabuf \
      ! video/x-raw,format=NV12,width=3840,height=2160,framerate=60/1 \
      ! mpph264enc \
      ! h264parse \
      ! mux. audiotestsrc wave=silence \
      ! voaacenc bitrate=128000 \
      ! aacparse \
      ! mux. flvmux streamable=true name=mux \
      ! queue \
      ! rtmpsink location=rtmp://127.0.0.1:1935/mystream
    
    Note that the audio track will be silent in this example.
    You’ll need to adjust things if your input is not 4k60.
    Alternatively, replace v4l2src device=/dev/video0 io-mode=dmabuf with videotestsrc is-live=true to send the Gstreamer test stream, which has some colored lines and live static.
  3. Open http://127.0.0.1:8888/mystream on the Rock 5 to view the stream or replace 127.0.0.1 with your Rock 5’s LAN IP. (Refer to mediamtx docs for more possibilities.)

This thread is also a good resource about Gstreamer & RTSP/RTMP with some Rock 5 specific bits:

More info about the available builds/targets is at https://github.com/milas/rock5-toolchain/blob/main/rkmpp/README.md.


DISCLAIMER: I work for Docker Inc but this is a personal side-project.

1 Like

Thank you, this will help a lot