Today I want to show you how Joker can be used for video decode and encode (transcoding) using Intel GPU (QuickSync technology). For better performance we will use Intel GPU (graphics processing units). In this case CPU is not loaded with video processing tasks. This tutorial should work on any Linux distribution (CoreOS, Debian, RedHat, etc).
Let’s do some console work. Issue following command to pull and run docker container with required software:
docker run --privileged --name gstreamer -v /dev:/dev -it aospan/docker-gstreamer-vaapi /bin/bash
grab some coffee and wait. After all you will see following prompt:
now you can issue command for transcode sample video file:
this command takes sample file from /opt/moscow24.ts and change video codec from MPEG2 (resolution:720×576) to H264 (resolution:720×576) and change audio from MP2 to AAC. It should take about 25-30 seconds to transcode 100 seconds file.
Now you can change /opt/transode-file.sh script and do your own experiments with video transcoding on GPU.
CPU and GPU load monitoring
Open new terminal connection to Joker and issue following command:
docker exec -it gstreamer bash
if you see something like this root@70776fa24c04:/# then you successfully connected to docker container and can run command inside this container.
To monitor GPU load issue following command:
you should see GPU load:
To monitor CPU load issue following command:
you should see CPU load:
To check current power states of different parts of Intel CPU issue following command:
when transcoding started the unit ‘GFX RENDER’ change state from D0i3 (some kind of idle) to D0 (active):
and power usage (in Watts) will increase. Here is a measurements by joker-power utility while transcoding:
when transcoding started power usage increase from about 1Watt to about 5Watt. ‘SOC’ is all CPU usage, including GPU, but core is only CPU cores. Here is a picture (source) describing power domains in Intel RAPL (Running Average Power Limit) :
Note: DRAM power monitoring not available in Joker. Only server Intel CPU’s has this feature.
For more info about Intel RAPL please check original Intel’s article here.
Here is a list of projects inside docker container:
- gstreamer gst-plugins-base
Projects compiled from git repositories using ‘master’ branch (should be latest and full of new features/bugs). If you want to build stable release please change opt/build-gstreamer-vaapi.sh file and issue rebuild.