Transcoding Sample Ubuntu 22.04

已更新 12/22/2022
版本 Latest




Getting Started with Transcoding on Intel® Data Center GPU Flex Series

These steps provide instructions on how to create a media delivery container and run a simple transcoding operation. This "Hello World" sample validates that the drivers have been loaded correctly and that the card functioning properly.

Optimized for Description
OS Ubuntu* 22.04
What You Will Learn How to transcode a AVC encoded video file to HEVC encoded video file
Time to Complete 5 minutes


This sample is a command line application that takes a file containing a AVC video elementary stream as an argument, decodes it, and encodes the output file WAR_TRAILER_HiQ_10_withAudio.hevc.mp4 as HEVC.

Key Implementation details

Configuration Default setting
Target device Intel® Data Center GPU Flex Series
Input format AVC video elementary stream
Output format HEVC video elementary stream
Output resolution same as input

Perform the following steps on a Linux Ubuntu 22.04 System

Step 1: Set up the media-delivery directory using the following command

git clone -b release/3.1 && cd media-delivery

Step 2: Build the media-delivery docker container using the following command

docker build \
  $(env | grep -E '(_proxy=|_PROXY)' | sed 's/^/--build-arg /') \
  --file docker/ubuntu22.04/intel-gfx/Dockerfile \
  --tag intel-media-delivery \

Step 3: Enter the docker container using the following commands

DEVICE_GRP=$(ls -g $DEVICE | awk '{print $3}' | \
  xargs getent group | awk -F: '{print $3}')
mkdir -p /tmp/ats-m && chmod -R 777 /tmp/ats-m
docker run --rm -it -v /tmp/ats-m:/opt/ats-m \
  -e DEVICE=$DEVICE --device $DEVICE --group-add $DEVICE_GRP \
  $(env | grep -E '(_proxy=|_PROXY)' | sed 's/^/-e /') \
  --cap-add SYS_ADMIN -p 8080:8080 \

Step 4: Run AVC to HEVC FFmpeg transcoding inside docker container using the following command

ffmpeg -hwaccel qsv -qsv_device $DEVICE -c:v h264_qsv -extra_hw_frames 8 \
    -i /opt/data/embedded/WAR_TRAILER_HiQ_10_withAudio.mp4 \
    -c:v hevc_qsv -preset medium -profile:v main -async_depth 1 \
    -b:v 4500000 -maxrate 9000000 -bufsize 18000000 \
    -rc_init_occupancy 9000000 \
    -look_ahead_depth 8 -extbrc 1 -b_strategy 1 \
    -bf 7 -refs 4 -g 256 -idr_interval begin_only -strict -1 \
    -vsync passthrough -y /opt/ats-m/WAR_TRAILER_HiQ_10_withAudio.hevc.mp4

More transcoding examples

These examples require network access and correct proxy setting.

To run these samples, simply replace the command in Step 4 with one of these commands.

AV1 output samples 1 1 1 1

AVC output samples 1 1 1 1

HEVC output samples 1 1 1 1

More Information

You can find more information at the Intel Data Center GPU Flex Series Software Portal.


Content attribution for WAR_TRAILER_HiQ_10_withAudio.mp4:

Film: WAR - Courtesy & Copyright: Yash Raj Films Pvt. Ltd.