Transcoding Sample 8.6
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 | RHEL* 8.6 |
What You Will Learn | How to transcode a AVC encoded video file to HEVC encoded video file |
Time to Complete | 5 minutes |
Purpose
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 Red Hat Enterprise Linux 8.6 System
Step 1: Set up the media-delivery directory using the following command
git clone -b release/3.1 https://github.com/intel/media-delivery.git && 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=${DEVICE:-/dev/dri/renderD128} 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 \ intel-media-delivery
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 ffmpeg-qsv-AV1-1080p.sh 1 ffmpeg-qsv-AV1-4K.sh 1 sample-multi-transcode-AV1-1080p.sh 1 sample-multi-transcode-AV1-4K.sh 1 AVC output samples ffmpeg-qsv-AVC-1080p.sh 1 ffmpeg-qsv-AVC-4K.sh 1 sample-multi-transcode-AVC-1080p.sh 1 sample-multi-transcode-AVC-4K.sh 1 HEVC output samples ffmpeg-qsv-HEVC-1080p.sh 1 ffmpeg-qsv-HEVC-4K.sh 1 sample-multi-transcode-HEVC-1080p.sh 1 sample-multi-transcode-HEVC-4K.sh 1
More Information
You can find more information at the Intel Data Center GPU Flex Series Software Portal.
License
Content attribution for WAR_TRAILER_HiQ_10_withAudio.mp4
:
Film: WAR - Courtesy & Copyright: Yash Raj Films Pvt. Ltd.