From 39c8eff41522456f5f74da5e8643e4a78bf882d9 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Tue, 24 Sep 2019 15:22:49 -0700 Subject: [PATCH] Reduced text in README.md Signed-off-by: James Ketrenos --- README.md | 81 ++++++++++++++++++------------------ assets/commands/1N_transcode | 2 +- 2 files changed, 41 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 5ffa0d8..35b0833 100644 --- a/README.md +++ b/README.md @@ -3,70 +3,69 @@ This project hosts a container demonstrating the use of ffmpeg using GPU offload for transcode operations. +The Dockerfile itself is constructed from templates/* and Dockerfile.solution, +and provides a multi-stage Docker container with the final container +being a minimal run-time installation on top of the base OS. + # Usage examples -## Build the container +## Getting the container -Build the container: - -```bash -docker build . -t intel-media-ffmpeg -``` - -or you can pull the container from Harbor: +You can pull the container from Harbor: ```bash docker pull amr-registry.caas.intel.com/vtt-osgc/solutions/intel-media-ffmpeg docker tag amr-registry.caas.intel.com/vtt-osgc/solutions/intel-media-ffmpeg intel-media-ffmpeg ``` - -## Download test content - -You will need some test content to run the following tests. You can download a -test stream here: +or build it yourself: ```bash -[ ! -e media ] && mkdir media -wget -q -O media/AUD_MW_E.264 https://fate-suite.libav.org/h264-conformance/AUD_MW_E.264 +docker build . -t intel-media-ffmpeg ``` -## Run a set of tests in sequence +## Verify hardware access -The following will decode, encode, and transcode the sample content: ```bash -HOST_MEDIA=$(pwd)/media -[ ! -e "${HOST_MEDIA}/AUD_MW_E.264" ] && { - mkdir -p ${HOST_MEDIA} - wget -q -O ${HOST_MEDIA}/AUD_MW_E.264 https://fate-suite.libav.org/h264-conformance/AUD_MW_E.264 -} -tests=( - "decode AUD_MW_E.264 AUD_MW.yuv" - "encode AUD_MW.yuv AUD_MW_E.h264" - "transcode AUD_MW_E.264 AUD_MW_E.hevc" - "1N_transcode AUD_MW_E.264 AUD_1N" -) -for test in "${tests[@]}"; do - test=($test) - docker run --rm \ - --volume ${HOST_MEDIA}:/media -it \ - --device=/dev/dri -e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \ - intel-media-ffmpeg ${test[*]} || { - echo "Error: Test failed: ${test[*]}" - break - } -done +docker run \ + --rm \ + --device=/dev/dri \ + -e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \ + -it \ + intel-media-ffmpeg \ + info ``` -If successful, looking in ${HOST_MEDIA} should show the following files: +The above will provide information about the software +in the container, as well as the detected Intel graphics +hardware. + +If you are in a multicard environment, see Appendix A. + +## Test hardware accelerated FFMPEG media operations ```bash -$ ls -1tr "${HOST_MEDIA}" +scripts/test +``` + +The above will: + +1. Download a test content file from fate-suite.libav.org into $(pwd)/media +2. Instantiate the 'intel-media-ffmpeg' container +3. Perfom the following tests: + 1. decode AUD_MW_E.264 to AUD_MW.yuv + 2. encode AUD_MW.yuv to AUD_MW_E.h264 + 3. transcode AUD_MW_E.264 to AUD_MW_E.hevc + 4. transcode AUD_MW_E.264 to two streams at once, AUD_1N-5M.h264 and AUD_1N-4M60FPS.h264 + +Once completed, you can check the contents of $(pwd)/media for the following files: + +``` AUD_MW_E.264 AUD_MW.yuv AUD_MW_E.h264 AUD_MW_E.hevc -AUD_1N-5M.mp4 +AUD_1N-5M.h264 AUD_1N-4M60FPS.h264 ``` diff --git a/assets/commands/1N_transcode b/assets/commands/1N_transcode index f1aa43b..4a4c0a3 100755 --- a/assets/commands/1N_transcode +++ b/assets/commands/1N_transcode @@ -38,7 +38,7 @@ ffmpeg command: [s1]scale_qsv=1280:720[o1]; \ [s2]vpp_qsv=framerate=60[o2]" \ -y \ - -map [o1] -c:v h264_qsv -b:v 5M /media/"\${OUT_FILE}-5M.mp4" \ + -map [o1] -c:v h264_qsv -b:v 5M /media/"\${OUT_FILE}-5M.h264" \ -map [o2] -c:v h264_qsv -b:v 4M /media/"\${OUT_FILE}-4M60FPS.h264" EOF