ROCm / rocDecode

rocDecode is a high performance video decode SDK for AMD hardware
https://rocm.docs.amd.com/projects/rocDecode/en/latest
Other
10 stars 14 forks source link

[Issue]: Ubuntu 24.04 - FFMPEG V6.1.1 Support #387

Closed kiritigowda closed 1 month ago

kiritigowda commented 1 month ago

Problem Description

root@simon:~# ffmpeg -version
ffmpeg version 4.4.2 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
configuration: --prefix=/workspace/ffmpeg_build --extra-cflags=-I/workspace/ffmpeg_build/include --extra-ldflags=-L/workspace/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --enable-shared --disable-static --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libass --enable-gpl --enable-nonfree
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
root@simon:~# cat /etc/os-release  
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Tests

root@simon:~/test# ctest   
Test project /root/test
    Start 1: video_decode-H265
1/6 Test #1: video_decode-H265 ................   Passed    5.93 sec
    Start 2: video_decodeMem-H265
2/6 Test #2: video_decodeMem-H265 .............   Passed    5.84 sec
    Start 3: video_decodePerf-H265
3/6 Test #3: video_decodePerf-H265 ............   Passed    7.39 sec
    Start 4: video_decodeRGB-H265
4/6 Test #4: video_decodeRGB-H265 .............   Passed   94.48 sec
    Start 5: video_decode-H264
5/6 Test #5: video_decode-H264 ................   Passed    5.86 sec
    Start 6: video_decodeBatch
6/6 Test #6: video_decodeBatch ................   Passed    7.24 sec

100% tests passed, 0 tests failed out of 6

Total Test time (real) = 126.75 sec
root@simon:~/test# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"

Operating System

Ubuntu 24.04

CPU

ALL

GPU

AMD Instinct MI300X

ROCm Version

ROCm 6.1.0

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

kiritigowda commented 1 month ago

Stg 1 docker come preloaded with

ffmpeg -version
ffmpeg version 4.4.2 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
configuration: --prefix=/workspace/ffmpeg_build --extra-cflags=-I/workspace/ffmpeg_build/include --extra-ldflags=-L/workspace/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --enable-shared --disable-static --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libass --enable-gpl --enable-nonfree
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100
kiritigowda commented 1 month ago

FFMPEG Default version for 24.04

ffmpeg -version
ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
libavutil      58. 29.100 / 58. 29.100
libavcodec     60. 31.102 / 60. 31.102
libavformat    60. 16.100 / 60. 16.100
libavdevice    60.  3.100 / 60.  3.100
libavfilter     9. 12.100 /  9. 12.100
libswscale      7.  5.100 /  7.  5.100
libswresample   4. 12.100 /  4. 12.100
libpostproc    57.  3.100 / 57.  3.100
kiritigowda commented 1 month ago

rocDecode supports - V6.1.1

Issues observed if multiple versions of FFMPEG installed and package pointing to different headers and runtime.

6: Test command: /opt/venv/lib/python3.12/site-packages/cmake/data/bin/ctest "--build-and-test" "/opt/rocm/share/rocdecode/samples/videoDecodeBatch" "/root/test/videoDecodeBatch" "--build-generator" "Unix Makefiles" "--test-command" "videodecodebatch" "-i" "/opt/rocm/share/rocdecode/video/" "-t" "2"
6: Working Directory: /root/test
6: Test timeout computed to be: 1500
6: Internal cmake changing into directory: /root/test/videoDecodeBatch
6: ======== CMake output     ======
6: The C compiler identification is GNU 13.2.0
6: The CXX compiler identification is GNU 13.2.0
6: Detecting C compiler ABI info
6: Detecting C compiler ABI info - done
6: Check for working C compiler: /usr/bin/cc - skipped
6: Detecting C compile features
6: Detecting C compile features - done
6: Detecting CXX compiler ABI info
6: Detecting CXX compiler ABI info - done
6: Check for working CXX compiler: /usr/bin/c++ - skipped
6: Detecting CXX compile features
6: Detecting CXX compile features - done
6: Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
6: Checking for module 'libavcodec'
6:   Found libavcodec, version 60.31.102
6: Checking for module 'libavformat'
6:   Found libavformat, version 60.16.100
6: Checking for module 'libavutil'
6:   Found libavutil, version 58.29.100
6: -- Using FFMPEG --
6:  Libraries:/usr/local/lib/libavcodec.so;/usr/local/lib/libavformat.so;/usr/local/lib/libavutil.so
6:  Includes:/usr/local/include
6: -- videodecodebatch: Using rocDecode --
6:  Libraries:/opt/rocm/lib/librocdecode.so
6:  Includes:/opt/rocm/include/rocdecode
6: Found Threads: TRUE
6: Configuring done
6: Generating done
6: Build files have been written to: /root/test/videoDecodeBatch
6: ======== End CMake output ======
6: Change Dir: /root/test/videoDecodeBatch
6:
6: Run Clean Command:/usr/bin/gmake -f Makefile clean
6:
6: Run Build Command(s):/usr/bin/gmake -f Makefile && [ 33%] Building CXX object CMakeFiles/videodecodebatch.dir/videodecodebatch.cpp.o
6: [ 66%] Building CXX object CMakeFiles/videodecodebatch.dir/opt/rocm/share/rocdecode/utils/rocvideodecode/roc_video_dec.cpp.o
6: [100%] Linking CXX executable videodecodebatch
6: [100%] Built target videodecodebatch
6:
6: Running test command: "/root/test/videoDecodeBatch/videodecodebatch" "-i" "/opt/rocm/share/rocdecode/video/" "-t" "2"
6: info: Number of threads: 2
6: info: decoding AMD_driving_virtual_20-H265.mp4 using GPU device 0 - AMD Radeon PRO W6800[gfx1030] on PCI bus 0b:00.0
6: info: decoding AMD_driving_virtual_20-H264.mp4 using GPU device 0 - AMD Radeon PRO W6800[gfx1030] on PCI bus 0b:00.0
6: Input Video Information
6:  Codec        : AVC/H.264
6:  Frame rate   : 60000/2002 = 29.97 fps
6:  Sequence     : Progressive
6:  Coded size   : [2048, 1024]
6:  Display area : [0, 0, 2048, 1024]
6:  Chroma       : YUV 420
6:  Bit depth    : 8
6: Video Decoding Params:
6:  Num Surfaces : 7
6:  Crop         : [0, 0, 2048, 1024]
6:  Resize       : 2048x1024
6:
6: Input Video Information
6:  Codec        : H.265/HEVC
6:  Frame rate   : 30000/1001 = 29.97 fps
6:  Sequence     : Progressive
6:  Coded size   : [2048, 1024]
6:  Display area : [0, 0, 2048, 1024]
6:  Chroma       : YUV 420
6:  Bit depth    : 8
6: Video Decoding Params:
6:  Num Surfaces : 7
6:  Crop         : [0, 0, 2048, 1024]
6:  Resize       : 2048x1024
6:
6: info: Total frame decoded: 1202
6: info: avg decoding time per frame: 0.8767 ms
6: info: avg FPS: 1140.64
6:
6/6 Test #6: video_decodeBatch ................   Passed    7.90 sec