Giter Club home page Giter Club logo

gmat's Introduction

License

Platform

GPU toolkit on Multimedia, AI and Transcoding (GMAT)

GMAT is a collection of tools for accelerating video/image processing and transcoding using GPUs in datacenter.

Upgrade ffmpeg-gpu-demo to GMAT

For those who have known this repo as ffmpeg-gpu-demo, you can still find the demo pipelines in the ffmpeg-gpu-demo branch. GMAT is developed based on ffmpeg-gpu-demo, and features like tensorrt filter are kept in GMAT. We have been listening and gathering feedback from the industry during the past year, and developed tools that users told us useful but missing in GPU video processing. We organized these tools together and hence the new GMAT, hope you can find what you need here : )

Features

  • ffmpeg-gpu: GPU-enhanced ffmpeg
    • GPU filters: crop, rotate, flip, smooth, tensorrt
    • libgpuscale: GPU accelerated libswscale, providing rgb<->yuv conversion and scaling on GPU
    • CUDA Runtime API support
  • MeTrans SDK: GPU transcoding toolkit
    • GPU codec tools: Programs to access and benchmark nvdec/nvenc/nvjpeg
    • Smart decoding: Decode video frames at uniform intervals, or decode frames with scene cut detection.
    • HEIF codec: HEIF image encoding/decoding accelerated by nvenc/nvdec

It should be noted that GMAT does not aim to provide a complete set of APIs for GPU video processing, there are a lot of great libraries/SDKs doing that already. Instead, our target is to solve the missing puzzle pieces. It's intented to use GMAT along with other libraries/SDKs you have been using in your current pipeline or solution. You can carve out whatever you need and integrate it into your project.

Feedbacks are welcome!

If you want to do something using GPU but can't find it in GMAT or elsewhere, you are welcome to submit an issue or even better, a PR, we would be happy to look into it.

Getting Started

Currently, ffmpeg-gpu and MeTrans need to be compiled separately.

Compile ffmpeg-gpu

ffmpeg-gpu has the following dependencies:

  • CUDA Toolkit >= 11.0
  • TensorRT >= 8.2 (Optional)
  • CV-CUDA >= 0.3.0 (Optional)

We strongly recommend you to start with the NGC containers. If you would like to use the tensorrt filter, choose the tensorrt image; If you do not care for the tensorrt filter, the CUDA image will do. Note that for CUDA images, tags including devel are required since we need NVCC and CUDA header files, which are not included in base or runtime images.

# use CUDA image
docker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -it --rm -v $(pwd):/gmat nvcr.io/nvidia/cuda:12.2.0-devel-ubuntu20.04 bash

# use TensorRT image
docker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -it --rm -v $(pwd):/gmat nvcr.io/nvidia/tensorrt:23.07-py3 bash

Once inside the container, you can install CV-CUDA. Please refer to CV-CUDA's GitHub repo for more details on installation.

wget https://github.com/CVCUDA/CV-CUDA/releases/download/v0.3.1-beta/nvcv-lib-0.3.1_beta-cuda12-x86_64-linux.deb
wget https://github.com/CVCUDA/CV-CUDA/releases/download/v0.3.1-beta/nvcv-dev-0.3.1_beta-cuda12-x86_64-linux.deb

sudo apt install ./nvcv-lib-0.3.1_beta-cuda12-x86_64-linux.deb ./nvcv-dev-0.3.1_beta-cuda12-x86_64-linux.deb

Like compiling the original ffmpeg, we need to configure ffmpeg before running make.

cd gmat/ffmpeg-gpu
./configure --disable-ptx-compression --enable-cvcuda --enable-libtensorrt --extra-cflags=-I/opt/nvidia/cvcuda0/include/ --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_86,code=sm_86 -I./' --extra-libs=-lstdc++
make -j10

The TensorRT filter is enabled by the --enable-libtensorrt option. Remember to change the --nvccflags option to match your GPU arch. E.g. arch=compute_86,code=sm_86 is for Ampere GPUs except A100. If you are using L4 (Ada), you should change it to arch=compute_89,code=sm_89. FFmpeg does not support PTX JIT at this moment, CUDA will report no kernel image available if you don't get the arch correct.

Compile MeTrans SDK

MeTranshas the following dependencies:

  • CUDA Toolkit
  • ffmpeg-gpu
  • HEIF (Optional)

(Optional) If you need HEIF codec, you need to install HEIF reader/writer before compiling MeTrans:

git clone https://github.com/nokiatech/heif.git
cd heif/build
cmake ../srcs
make -j10
sudo mkdir /usr/local/include/heif
sudo cp -r ../srcs/api/* /usr/local/include/heif
sudo cp ./lib/*.so /usr/local/lib

MeTrans does not require ffmpeg-gpu to be built with cvcuda or tensorrt, so we can use the CUDA image:

docker run --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -it --rm -v $(pwd):/gmat nvcr.io/nvidia/cuda:12.2.0-devel-ubuntu20.04 bash

# build and install ffmpeg-gpu
cd gmat/ffmpeg-gpu
./configure --disable-ptx-compression --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_86,code=sm_86 -I./' --extra-libs=-lstdc++
make -j10
sudo make install

cd ../metrans
make -j10
# make all_but_gl -j10

The compiled binaries are located in metrans/build.

If you need HEIF codec, run make all_but_gl -j10 instead of make -j10. If you also need the AppNvDecGL sample which demonstrates how to display decoded video frames in OpenGL using CUDA OpenGL interoperation, run make all -j10. Note that AppNvDecGL requires OpenGL to be setup properly, it is recommended to run the sample on a local machine, as setup display on a remote environment can be tricky.

License

FFmpeg GPU Demo is under MIT license, check out the LICENSE for details.

gmat's People

Contributors

xiaoweiw-nv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gmat's Issues

TensorRT image No such filter: 'scale_npp' and more

Hi,

I followed your guide but it seems it is incomplete. No scale_npp, also no nvdec/nvenc decoders/encoders

./configure --disable-ptx-compression --enable-cvcuda --enable-libtensorrt --extra-cflags=-I/opt/nvidia/cvcuda0/include/ --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_75,code=sm_75 -I./' --extra-libs=-lstdc++ --enable-cuda
install prefix            /usr/local
source path               .
C compiler                gcc
C library                 glibc
ARCH                      x86 (generic)
big-endian                no
runtime cpu detection     yes
standalone assembly       yes
x86 assembler             nasm
MMX enabled               yes
MMXEXT enabled            yes
3DNow! enabled            yes
3DNow! extended enabled   yes
SSE enabled               yes
SSSE3 enabled             yes
AESNI enabled             yes
AVX enabled               yes
AVX2 enabled              yes
AVX-512 enabled           yes
AVX-512ICL enabled        yes
XOP enabled               yes
FMA3 enabled              yes
FMA4 enabled              yes
i686 features enabled     yes
CMOV is fast              yes
EBX available             yes
EBP available             yes
debug symbols             yes
strip symbols             yes
optimize for size         no
optimizations             yes
static                    no
shared                    yes
postprocessing support    no
network support           yes
threading support         pthreads
safe bitstream reader     yes
texi2html enabled         no
perl enabled              yes
pod2man enabled           yes
makeinfo enabled          no
makeinfo supports HTML    no
xmllint enabled           yes

External libraries:
iconv                   zlib

External libraries providing hardware acceleration:
cuda                    cuda_nvcc               cuvid                   ffnvcodec               nvdec
cuda_llvm               cudart                  cvcuda                  libtensorrt             v4l2_m2m

Libraries:
avcodec                 avfilter                avutil                  swscale
avdevice                avformat                swresample

Programs:
ffmpeg                  ffprobe

Enabled decoders:
aac                     bmp                     huffyuv                 pcm_f24le               ssa
aac_fixed               bmv_audio               hymt                    pcm_f32be               stl
aac_latm                bmv_video               iac                     pcm_f32le               subrip
aasc                    brender_pix             idcin                   pcm_f64be               subviewer
ac3                     c93                     idf                     pcm_f64le               subviewer1
ac3_fixed               cavs                    iff_ilbm                pcm_lxf                 sunrast
acelp_kelvin            ccaption                ilbc                    pcm_mulaw               svq1
adpcm_4xm               cdgraphics              imc                     pcm_s16be               svq3
adpcm_adx               cdtoons                 imm4                    pcm_s16be_planar        tak
adpcm_afc               cdxl                    imm5                    pcm_s16le               targa
adpcm_agm               cfhd                    indeo2                  pcm_s16le_planar        targa_y216
adpcm_aica              cinepak                 indeo3                  pcm_s24be               tdsc
adpcm_argo              clearvideo              indeo4                  pcm_s24daud             text
adpcm_ct                cljr                    indeo5                  pcm_s24le               theora
adpcm_dtk               cllc                    interplay_acm           pcm_s24le_planar        thp
adpcm_ea                comfortnoise            interplay_dpcm          pcm_s32be               tiertexseqvideo
adpcm_ea_maxis_xa       cook                    interplay_video         pcm_s32le               tiff
adpcm_ea_r1             cpia                    ipu                     pcm_s32le_planar        tmv
adpcm_ea_r2             cri                     jacosub                 pcm_s64be               truehd
adpcm_ea_r3             cscd                    jpeg2000                pcm_s64le               truemotion1
adpcm_ea_xas            cyuv                    jpegls                  pcm_s8                  truemotion2
adpcm_g722              dca                     jv                      pcm_s8_planar           truemotion2rt
adpcm_g726              dds                     kgv1                    pcm_sga                 truespeech
adpcm_g726le            derf_dpcm               kmvc                    pcm_u16be               tscc
adpcm_ima_acorn         dfa                     lagarith                pcm_u16le               tscc2
adpcm_ima_alp           dfpwm                   loco                    pcm_u24be               tta
adpcm_ima_amv           dirac                   lscr                    pcm_u24le               twinvq
adpcm_ima_apc           dnxhd                   m101                    pcm_u32be               txd
adpcm_ima_apm           dolby_e                 mace3                   pcm_u32le               ulti
adpcm_ima_cunning       dpx                     mace6                   pcm_u8                  utvideo
adpcm_ima_dat4          dsd_lsbf                magicyuv                pcm_vidc                v210
adpcm_ima_dk3           dsd_lsbf_planar         mdec                    pcx                     v210x
adpcm_ima_dk4           dsd_msbf                metasound               pfm                     v308
adpcm_ima_ea_eacs       dsd_msbf_planar         microdvd                pgm                     v408
adpcm_ima_ea_sead       dsicinaudio             mimic                   pgmyuv                  v410
adpcm_ima_iss           dsicinvideo             mjpeg                   pgssub                  vb
adpcm_ima_moflex        dss_sp                  mjpeg_cuvid             pgx                     vble
adpcm_ima_mtf           dst                     mjpegb                  phm                     vbn
adpcm_ima_oki           dvaudio                 mlp                     photocd                 vc1
adpcm_ima_qt            dvbsub                  mmvideo                 pictor                  vc1_cuvid
adpcm_ima_rad           dvdsub                  mobiclip                pixlet                  vc1_v4l2m2m
adpcm_ima_smjpeg        dvvideo                 motionpixels            pjs                     vc1image
adpcm_ima_ssi           dxa                     movtext                 png                     vcr1
adpcm_ima_wav           dxtory                  mp1                     ppm                     vmdaudio
adpcm_ima_ws            dxv                     mp1float                prores                  vmdvideo
adpcm_ms                eac3                    mp2                     prosumer                vmnc
adpcm_mtaf              eacmv                   mp2float                psd                     vorbis
adpcm_psx               eamad                   mp3                     ptx                     vp3
adpcm_sbpro_2           eatgq                   mp3adu                  qcelp                   vp4
adpcm_sbpro_3           eatgv                   mp3adufloat             qdm2                    vp5
adpcm_sbpro_4           eatqi                   mp3float                qdmc                    vp6
adpcm_swf               eightbps                mp3on4                  qdraw                   vp6a
adpcm_thp               eightsvx_exp            mp3on4float             qoi                     vp6f
adpcm_thp_le            eightsvx_fib            mpc7                    qpeg                    vp7
adpcm_vima              escape124               mpc8                    qtrle                   vp8
adpcm_xa                escape130               mpeg1_cuvid             r10k                    vp8_cuvid
adpcm_yamaha            evrc                    mpeg1_v4l2m2m           r210                    vp8_v4l2m2m
adpcm_zork              exr                     mpeg1video              ra_144                  vp9
agm                     fastaudio               mpeg2_cuvid             ra_288                  vp9_cuvid
aic                     ffv1                    mpeg2_v4l2m2m           ralf                    vp9_v4l2m2m
alac                    ffvhuff                 mpeg2video              rasc                    vplayer
alias_pix               ffwavesynth             mpeg4                   rawvideo                vqa
als                     fic                     mpeg4_cuvid             realtext                wavpack
amrnb                   fits                    mpeg4_v4l2m2m           rl2                     wcmv
amrwb                   flac                    mpegvideo               roq                     webp
amv                     flashsv                 mpl2                    roq_dpcm                webvtt
anm                     flashsv2                msa1                    rpza                    wmalossless
ansi                    flic                    mscc                    rscc                    wmapro
ape                     flv                     msmpeg4v1               rv10                    wmav1
apng                    fmvc                    msmpeg4v2               rv20                    wmav2
aptx                    fourxm                  msmpeg4v3               rv30                    wmavoice
aptx_hd                 fraps                   msnsiren                rv40                    wmv1
arbc                    frwu                    msp2                    s302m                   wmv2
argo                    g2m                     msrle                   sami                    wmv3
ass                     g723_1                  mss1                    sanm                    wmv3image
asv1                    g729                    mss2                    sbc                     wnv1
asv2                    gdv                     msvideo1                scpr                    wrapped_avframe
atrac1                  gem                     mszh                    screenpresso            ws_snd1
atrac3                  gif                     mts2                    sdx2_dpcm               xan_dpcm
atrac3al                gremlin_dpcm            mv30                    sga                     xan_wc3
atrac3p                 gsm                     mvc1                    sgi                     xan_wc4
atrac3pal               gsm_ms                  mvc2                    sgirle                  xbin
atrac9                  h261                    mvdv                    sheervideo              xbm
aura                    h263                    mvha                    shorten                 xface
aura2                   h263_v4l2m2m            mwsc                    simbiosis_imx           xl
av1                     h263i                   mxpeg                   sipr                    xma1
av1_cuvid               h263p                   nellymoser              siren                   xma2
avrn                    h264                    notchlc                 smackaud                xpm
avrp                    h264_cuvid              nuv                     smacker                 xsub
avs                     h264_v4l2m2m            on2avc                  smc                     xwd
avui                    hap                     opus                    smvjpeg                 y41p
ayuv                    hca                     paf_audio               snow                    ylc
bethsoftvid             hcom                    paf_video               sol_dpcm                yop
bfi                     hevc                    pam                     sonic                   yuv4
bink                    hevc_cuvid              pbm                     sp5x                    zero12v
binkaudio_dct           hevc_v4l2m2m            pcm_alaw                speedhq                 zerocodec
binkaudio_rdft          hnm4_video              pcm_bluray              speex                   zlib
bintext                 hq_hqa                  pcm_dvd                 srgc                    zmbv
bitpacked               hqx                     pcm_f16le               srt

Enabled encoders:
a64multi                cljr                    mpeg1video              pcm_u24be               ssa
a64multi5               comfortnoise            mpeg2video              pcm_u24le               subrip
aac                     dca                     mpeg4                   pcm_u32be               sunrast
ac3                     dfpwm                   mpeg4_v4l2m2m           pcm_u32le               svq1
ac3_fixed               dnxhd                   msmpeg4v2               pcm_u8                  targa
adpcm_adx               dpx                     msmpeg4v3               pcm_vidc                text
adpcm_argo              dvbsub                  msvideo1                pcx                     tiff
adpcm_g722              dvdsub                  nellymoser              pfm                     truehd
adpcm_g726              dvvideo                 opus                    pgm                     tta
adpcm_g726le            eac3                    pam                     pgmyuv                  ttml
adpcm_ima_alp           exr                     pbm                     phm                     utvideo
adpcm_ima_amv           ffv1                    pcm_alaw                png                     v210
adpcm_ima_apm           ffvhuff                 pcm_bluray              ppm                     v308
adpcm_ima_qt            fits                    pcm_dvd                 prores                  v408
adpcm_ima_ssi           flac                    pcm_f32be               prores_aw               v410
adpcm_ima_wav           flashsv                 pcm_f32le               prores_ks               vbn
adpcm_ima_ws            flashsv2                pcm_f64be               qoi                     vc2
adpcm_ms                flv                     pcm_f64le               qtrle                   vorbis
adpcm_swf               g723_1                  pcm_mulaw               r10k                    vp8_v4l2m2m
adpcm_yamaha            gif                     pcm_s16be               r210                    wavpack
alac                    h261                    pcm_s16be_planar        ra_144                  webvtt
alias_pix               h263                    pcm_s16le               rawvideo                wmav1
amv                     h263_v4l2m2m            pcm_s16le_planar        roq                     wmav2
apng                    h263p                   pcm_s24be               roq_dpcm                wmv1
aptx                    h264_v4l2m2m            pcm_s24daud             rpza                    wmv2
aptx_hd                 hevc_v4l2m2m            pcm_s24le               rv10                    wrapped_avframe
ass                     huffyuv                 pcm_s24le_planar        rv20                    xbm
asv1                    jpeg2000                pcm_s32be               s302m                   xface
asv2                    jpegls                  pcm_s32le               sbc                     xsub
avrp                    ljpeg                   pcm_s32le_planar        sgi                     xwd
avui                    magicyuv                pcm_s64be               smc                     y41p
ayuv                    mjpeg                   pcm_s64le               snow                    yuv4
bitpacked               mlp                     pcm_s8                  sonic                   zlib
bmp                     movtext                 pcm_s8_planar           sonic_ls                zmbv
cfhd                    mp2                     pcm_u16be               speedhq
cinepak                 mp2fixed                pcm_u16le               srt

Enabled hwaccels:
av1_nvdec               mjpeg_nvdec             mpeg4_nvdec             vp9_nvdec
h264_nvdec              mpeg1_nvdec             vc1_nvdec               wmv3_nvdec
hevc_nvdec              mpeg2_nvdec             vp8_nvdec

Enabled parsers:
aac                     cri                     g723_1                  mlp                     sipr
aac_latm                dca                     g729                    mpeg4video              tak
ac3                     dirac                   gif                     mpegaudio               vc1
adx                     dnxhd                   gsm                     mpegvideo               vorbis
amr                     dolby_e                 h261                    opus                    vp3
av1                     dpx                     h263                    png                     vp8
avs2                    dvaudio                 h264                    pnm                     vp9
avs3                    dvbsub                  hevc                    qoi                     webp
bmp                     dvd_nav                 ipu                     rv30                    xbm
cavsvideo               dvdsub                  jpeg2000                rv40                    xma
cook                    flac                    mjpeg                   sbc

Enabled demuxers:
aa                      dhav                    image_pcx_pipe          msnwc_tcp               sds
aac                     dirac                   image_pfm_pipe          msp                     sdx
aax                     dnxhd                   image_pgm_pipe          mtaf                    segafilm
ac3                     dsf                     image_pgmyuv_pipe       mtv                     ser
ace                     dsicin                  image_pgx_pipe          musx                    sga
acm                     dss                     image_phm_pipe          mv                      shorten
act                     dts                     image_photocd_pipe      mvi                     siff
adf                     dtshd                   image_pictor_pipe       mxf                     simbiosis_imx
adp                     dv                      image_png_pipe          mxg                     sln
ads                     dvbsub                  image_ppm_pipe          nc                      smacker
adx                     dvbtxt                  image_psd_pipe          nistsphere              smjpeg
aea                     dxa                     image_qdraw_pipe        nsp                     smush
afc                     ea                      image_qoi_pipe          nsv                     sol
aiff                    ea_cdata                image_sgi_pipe          nut                     sox
aix                     eac3                    image_sunrast_pipe      nuv                     spdif
alp                     epaf                    image_svg_pipe          obu                     srt
amr                     ffmetadata              image_tiff_pipe         ogg                     stl
amrnb                   filmstrip               image_vbn_pipe          oma                     str
amrwb                   fits                    image_webp_pipe         paf                     subviewer
anm                     flac                    image_xbm_pipe          pcm_alaw                subviewer1
apc                     flic                    image_xpm_pipe          pcm_f32be               sup
ape                     flv                     image_xwd_pipe          pcm_f32le               svag
apm                     fourxm                  ingenient               pcm_f64be               svs
apng                    frm                     ipmovie                 pcm_f64le               swf
aptx                    fsb                     ipu                     pcm_mulaw               tak
aptx_hd                 fwse                    ircam                   pcm_s16be               tedcaptions
aqtitle                 g722                    iss                     pcm_s16le               thp
argo_asf                g723_1                  iv8                     pcm_s24be               threedostr
argo_brp                g726                    ivf                     pcm_s24le               tiertexseq
argo_cvg                g726le                  ivr                     pcm_s32be               tmv
asf                     g729                    jacosub                 pcm_s32le               truehd
asf_o                   gdv                     jv                      pcm_s8                  tta
ass                     genh                    kux                     pcm_u16be               tty
ast                     gif                     kvag                    pcm_u16le               txd
au                      gsm                     live_flv                pcm_u24be               ty
av1                     gxf                     lmlm4                   pcm_u24le               v210
avi                     h261                    loas                    pcm_u32be               v210x
avr                     h263                    lrc                     pcm_u32le               vag
avs                     h264                    luodat                  pcm_u8                  vc1
avs2                    hca                     lvf                     pcm_vidc                vc1t
avs3                    hcom                    lxf                     pjs                     vividas
bethsoftvid             hevc                    m4v                     pmp                     vivo
bfi                     hls                     matroska                pp_bnk                  vmd
bfstm                   hnm                     mca                     pva                     vobsub
bink                    ico                     mcc                     pvf                     voc
binka                   idcin                   mgsts                   qcp                     vpk
bintext                 idf                     microdvd                r3d                     vplayer
bit                     iff                     mjpeg                   rawvideo                vqf
bitpacked               ifv                     mjpeg_2000              realtext                w64
bmv                     ilbc                    mlp                     redspark                wav
boa                     image2                  mlv                     rl2                     wc3
brstm                   image2_alias_pix        mm                      rm                      webm_dash_manifest
c93                     image2_brender_pix      mmf                     roq                     webvtt
caf                     image2pipe              mods                    rpl                     wsaud
cavsvideo               image_bmp_pipe          moflex                  rsd                     wsd
cdg                     image_cri_pipe          mov                     rso                     wsvqa
cdxl                    image_dds_pipe          mp3                     rtp                     wtv
cine                    image_dpx_pipe          mpc                     rtsp                    wv
codec2                  image_exr_pipe          mpc8                    s337m                   wve
codec2raw               image_gem_pipe          mpegps                  sami                    xa
concat                  image_gif_pipe          mpegts                  sap                     xbin
data                    image_j2k_pipe          mpegtsraw               sbc                     xmv
daud                    image_jpeg_pipe         mpegvideo               sbg                     xvag
dcstr                   image_jpegls_pipe       mpjpeg                  scc                     xwma
derf                    image_jpegxl_pipe       mpl2                    scd                     yop
dfa                     image_pam_pipe          mpsub                   sdp                     yuv4mpegpipe
dfpwm                   image_pbm_pipe          msf                     sdr2

Enabled muxers:
a64                     dnxhd                   ismv                    ogg                     scc
ac3                     dts                     ivf                     ogv                     segafilm
adts                    dv                      jacosub                 oma                     segment
adx                     eac3                    kvag                    opus                    smjpeg
aiff                    f4v                     latm                    pcm_alaw                smoothstreaming
alp                     ffmetadata              lrc                     pcm_f32be               sox
amr                     fifo                    m4v                     pcm_f32le               spdif
amv                     fifo_test               matroska                pcm_f64be               spx
apm                     filmstrip               matroska_audio          pcm_f64le               srt
apng                    fits                    md5                     pcm_mulaw               stream_segment
aptx                    flac                    microdvd                pcm_s16be               streamhash
aptx_hd                 flv                     mjpeg                   pcm_s16le               sup
argo_asf                framecrc                mkvtimestamp_v2         pcm_s24be               swf
argo_cvg                framehash               mlp                     pcm_s24le               tee
asf                     framemd5                mmf                     pcm_s32be               tg2
asf_stream              g722                    mov                     pcm_s32le               tgp
ass                     g723_1                  mp2                     pcm_s8                  truehd
ast                     g726                    mp3                     pcm_u16be               tta
au                      g726le                  mp4                     pcm_u16le               ttml
avi                     gif                     mpeg1system             pcm_u24be               uncodedframecrc
avif                    gsm                     mpeg1vcd                pcm_u24le               vc1
avm2                    gxf                     mpeg1video              pcm_u32be               vc1t
avs2                    h261                    mpeg2dvd                pcm_u32le               voc
avs3                    h263                    mpeg2svcd               pcm_u8                  w64
bit                     h264                    mpeg2video              pcm_vidc                wav
caf                     hash                    mpeg2vob                psp                     webm
cavsvideo               hds                     mpegts                  rawvideo                webm_chunk
codec2                  hevc                    mpjpeg                  rm                      webm_dash_manifest
codec2raw               hls                     mxf                     roq                     webp
crc                     ico                     mxf_d10                 rso                     webvtt
dash                    ilbc                    mxf_opatom              rtp                     wsaud
data                    image2                  null                    rtp_mpegts              wtv
daud                    image2pipe              nut                     rtsp                    wv
dfpwm                   ipod                    obu                     sap                     yuv4mpegpipe
dirac                   ircam                   oga                     sbc

Enabled protocols:
async                   ffrtmphttp              httpproxy               prompeg                 tcp
cache                   file                    icecast                 rtmp                    tee
concat                  ftp                     md5                     rtmpt                   udp
concatf                 gopher                  mmsh                    rtp                     udplite
crypto                  hls                     mmst                    srtp                    unix
data                    http                    pipe                    subfile

Enabled filters:
abench                  asubcut                 drawbox                 lut2                    showpalette
abitscope               asupercut               drawgraph               lut3d                   showspatial
acompressor             asuperpass              drawgrid                lutrgb                  showspectrum
acontrast               asuperstop              drmeter                 lutyuv                  showspectrumpic
acopy                   atadenoise              dynaudnorm              mandelbrot              showvolume
acrossfade              atempo                  earwax                  maskedclamp             showwaves
acrossover              atilt                   ebur128                 maskedmax               showwavespic
acrusher                atrim                   edgedetect              maskedmerge             shuffleframes
acue                    avectorscope            elbg                    maskedmin               shufflepixels
addroi                  avgblur                 entropy                 maskedthreshold         shuffleplanes
adeclick                avsynctest              epx                     maskfun                 sidechaincompress
adeclip                 axcorrelate             equalizer               mcompand                sidechaingate
adecorrelate            bandpass                erosion                 median                  sidedata
adelay                  bandreject              estdif                  mergeplanes             sierpinski
adenorm                 bass                    exposure                mestimate               signalstats
aderivative             bbox                    extractplanes           metadata                silencedetect
adrawgraph              bench                   extrastereo             midequalizer            silenceremove
adynamicequalizer       bilateral               fade                    minterpolate            sinc
adynamicsmooth          biquad                  feedback                mix                     sine
aecho                   bitplanenoise           fftdnoiz                monochrome              siti
aemphasis               blackdetect             fftfilt                 morpho                  smooth_nvcv
aeval                   blend                   field                   movie                   smptebars
aevalsrc                blockdetect             fieldhint               msad                    smptehdbars
aexciter                blurdetect              fieldmatch              multiply                sobel
afade                   bm3d                    fieldorder              negate                  spectrumsynth
afftdn                  bwdif                   fifo                    nlmeans                 speechnorm
afftfilt                cas                     fillborders             noformat                split
afifo                   cellauto                firequalizer            noise                   sr
afir                    channelmap              flanger                 normalize               ssim
afirsrc                 channelsplit            flip_nvcv               null                    stereotools
aformat                 chorus                  floodfill               nullsink                stereowiden
afreqshift              chromahold              format                  nullsrc                 streamselect
afwtdn                  chromakey               format_cuda             oscilloscope            superequalizer
agate                   chromakey_cuda          fps                     overlay                 surround
agraphmonitor           chromanr                framepack               overlay_cuda            swaprect
ahistogram              chromashift             framerate               pad                     swapuv
aiir                    ciescope                framestep               pal100bars              tblend
aintegral               codecview               freezedetect            pal75bars               telecine
ainterleave             color                   freezeframes            palettegen              tensorrt
alatency                colorbalance            gblur                   paletteuse              testsrc
alimiter                colorchannelmixer       geq                     pan                     testsrc2
allpass                 colorchart              gradfun                 perms                   thistogram
allrgb                  colorcontrast           gradients               photosensitivity        threshold
allyuv                  colorcorrect            graphmonitor            pixdesctest             thumbnail
aloop                   colorhold               grayworld               pixelize                thumbnail_cuda
alphaextract            colorize                greyedge                pixscope                tile
alphamerge              colorkey                guided                  premultiply             tiltshelf
amerge                  colorlevels             haas                    prewitt                 tlut2
ametadata               colormap                haldclut                pseudocolor             tmedian
amix                    colorspace              haldclutsrc             psnr                    tmidequalizer
amovie                  colorspectrum           hdcd                    qp                      tmix
amplify                 colortemperature        headphone               random                  tonemap
amultiply               compand                 hflip                   readeia608              tpad
anequalizer             compensationdelay       highpass                readvitc                transpose
anlmdn                  concat                  highshelf               realtime                treble
anlmf                   convolution             hilbert                 remap                   tremolo
anlms                   convolve                histogram               removegrain             trim
anoisesrc               copy                    hqx                     removelogo              unpremultiply
anull                   crop                    hstack                  replaygain              unsharp
anullsink               crop_nvcv               hsvhold                 reverse                 untile
anullsrc                crossfeed               hsvkey                  rgbashift               v360
apad                    crystalizer             hue                     rgbtestsrc              varblur
aperms                  cue                     huesaturation           roberts                 vectorscope
aphasemeter             curves                  hwdownload              rotate                  vflip
aphaser                 datascope               hwmap                   rotate_nvcv             vfrdet
aphaseshift             dblur                   hwupload                scale                   vibrance
apsyclip                dcshift                 hwupload_cuda           scale2ref               vibrato
apulsator               dctdnoiz                hysteresis              scale_cuda              vif
arealtime               deband                  identity                scdet                   vignette
aresample               deblock                 idet                    scharr                  virtualbass
areverse                decimate                il                      scroll                  vmafmotion
arnndn                  deconvolve              inflate                 segment                 volume
asdr                    dedot                   interleave              select                  volumedetect
asegment                deesser                 join                    select_cuda             vstack
aselect                 deflate                 kirsch                  selectivecolor          w3fdif
asendcmd                deflicker               lagfun                  sendcmd                 waveform
asetnsamples            dejudder                latency                 separatefields          weave
asetpts                 derain                  lenscorrection          setdar                  xbr
asetrate                deshake                 life                    setfield                xcorrelate
asettb                  despill                 limitdiff               setparams               xfade
ashowinfo               detelecine              limiter                 setpts                  xmedian
asidedata               dialoguenhance          loop                    setrange                xstack
asoftclip               dilation                loudnorm                setsar                  yadif
aspectralstats          displace                lowpass                 settb                   yadif_cuda
asplit                  dnn_classify            lowshelf                shear                   yaepblur
astats                  dnn_detect              lumakey                 showcqt                 yuvtestsrc
astreamselect           dnn_processing          lut                     showfreqs               zoompan
asubboost               doubleweave             lut1d                   showinfo

Enabled bsfs:
aac_adtstoasc           eac3_core               hevc_mp4toannexb        noise                   text2movsub
av1_frame_merge         extract_extradata       imx_dump_header         null                    trace_headers
av1_frame_split         filter_units            mjpeg2jpeg              opus_metadata           truehd_core
av1_metadata            h264_metadata           mjpega_dump_header      pcm_rechunk             vp9_metadata
chomp                   h264_mp4toannexb        mov2textsub             pgs_frame_merge         vp9_raw_reorder
dca_core                h264_redundant_pps      mp3_header_decompress   prores_metadata         vp9_superframe
dump_extradata          hapqa_extract           mpeg2_metadata          remove_extradata        vp9_superframe_split
dv_error_marker         hevc_metadata           mpeg4_unpack_bframes    setts

Enabled indevs:
fbdev                   lavfi                   oss                     v4l2

Enabled outdevs:
fbdev                   oss                     v4l2
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i S05E12.mkv -vf scale_npp=1280:720,format_cuda=rgbpf32le,tensorrt=realesr-animevideov3_2080ti_720x1280_fasterDynamicShapes0805.engine,format_cuda=nv12 -c:v h264 out.mkv
ffmpeg version b1aea74 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
  configuration: --disable-ptx-compression --enable-cvcuda --enable-libtensorrt --extra-cflags=-I/opt/nvidia/cvcuda0/include/ --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_75,code=sm_75 -I./' --extra-libs=-lstdc++ --enable-cuda
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
Input #0, matroska,webm, from 'S05E12.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2014-09-12T13:47:28.000000Z
  Duration: 00:49:02.48, start: 0.000000, bitrate: 7292 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)
  Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
  Stream #0:2(ger): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
  Stream #0:3(eng): Subtitle: subrip
File 'out.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_v4l2m2m))
  Stream #0:1 -> #0:1 (ac3 (native) -> ac3 (native))
  Stream #0:3 -> #0:2 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x55751834fb80] No such filter: 'scale_npp'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
ffmpeg -filters|grep scale
 ... alphaextract      V->V       Extract an alpha channel as a grayscale image component.
 ... extractplanes     V->N       Extract planes as grayscale frames.
 ..C scale             V->V       Scale the input video size and/or convert the image format.
 ... scale_cuda        V->V       GPU accelerated video resizer
 ..C scale2ref         VV->VV     Scale the input video size and/or convert the image format to the given reference

When trying to use scale_cuda instead it also does not work:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i S05E12.mkv -vf scale_cuda=1280:720,format_cuda=rgbpf32le,tensorrt=realesr-animevideov3_2080ti_720x1280_fasterDynamicShapes0805.engine,format_cuda=nv12 -c:v h264 out.mkv
ffmpeg version b1aea74 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
  configuration: --disable-ptx-compression --enable-cvcuda --enable-libtensorrt --extra-cflags=-I/opt/nvidia/cvcuda0/include/ --disable-static --enable-shared --enable-nonfree --enable-cuda-nvcc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --nvccflags='-gencode arch=compute_75,code=sm_75 -I./' --extra-libs=-lstdc++ --enable-cuda
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
Input #0, matroska,webm, from 'S05E12.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2014-09-12T13:47:28.000000Z
  Duration: 00:49:02.48, start: 0.000000, bitrate: 7292 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)
  Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
  Stream #0:2(ger): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
  Stream #0:3(eng): Subtitle: subrip
File 'out.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_v4l2m2m))
  Stream #0:1 -> #0:1 (ac3 (native) -> ac3 (native))
  Stream #0:3 -> #0:2 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x55b037cacb80] Too many inputs specified for the "format_cuda" filter.
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

Compile issues in the libavfilter/vf_pose.cpp

Hi,

While it seems that all the required files and libraries are correctly included, I face many compile issues within the libavfilter/vf_pose.cpp file. Any help will be appreciated.

/usr/include/eigen3/Eigen/src/Core/Matrix.h:259:25: note: candidate expects 0 arguments, 1 provided
libavfilter/vf_pose.cpp: In function 'void load_ort(OrtContext*, char*, std::array<long int, 3>)':
libavfilter/vf_pose.cpp:208:51: error: no matching function for call to 'OrtCUDAProviderOptions::OrtCUDAProviderOptions()'
208 | OrtCUDAProviderOptions cuda_provider_options{0};
| ^
In file included from /volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_cxx_api.h:16,
from libavfilter/vf_pose.cpp:34:
/volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h:351:3: note: candidate: 'OrtCUDAProviderOptions::OrtCUDAProviderOptions()'
351 | OrtCUDAProviderOptions() : device_id{}, cudnn_conv_algo_search{OrtCudnnConvAlgoSearchExhaustive}, gpu_mem_limit{SIZE_MAX}, arena_extend_strategy{}, do_copy_in_default_stream{1}, has_user_compute_stream{}, user_compute_stream{}, default_memory_arena_cfg{} {}
| ^~~~~~~~~~~~~~~~~~~~~~
/volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h:351:3: note: candidate expects 0 arguments, 1 provided
/volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h:349:16: note: candidate: 'constexpr OrtCUDAProviderOptions::OrtCUDAProviderOptions(const OrtCUDAProviderOptions&)'
349 | typedef struct OrtCUDAProviderOptions {
| ^~~~~~~~~~~~~~~~~~~~~~
/volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h:349:16: note: no known conversion for argument 1 from 'int' to 'const OrtCUDAProviderOptions&'
/volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h:349:16: note: candidate: 'constexpr OrtCUDAProviderOptions::OrtCUDAProviderOptions(OrtCUDAProviderOptions&&)'
/volumes2/optimizations/video-sdk/FFmpeg-GPU-Demo/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h:349:16: note: no known conversion for argument 1 from 'int' to 'OrtCUDAProviderOptions&&'
libavfilter/vf_pose.cpp:209:52: error: 'EXHAUSTIVE' was not declared in this scope
209 | cuda_provider_options.cudnn_conv_algo_search = EXHAUSTIVE;
| ^~~~~~~~~~
libavfilter/vf_pose.cpp:194:17: warning: unused variable 'api' [-Wunused-variable]
194 | const auto& api = Ort::GetApi();
| ^~~
libavfilter/vf_pose.cpp:197:17: warning: unused variable 'keys' [-Wunused-variable]
197 | const char* keys[] = {"max_mem", "arena_extend_strategy", "initial_chunk_size_bytes", "max_dead_bytes_per_chunk", "initial_growth_chunk_size_bytes"};
| ^~~~
libavfilter/vf_pose.cpp:198:18: warning: unused variable 'values' [-Wunused-variable]
198 | const size_t values[] = {0 /let ort pick default max memory/, 0, 1024, 0, 256};
| ^~~~~~
libavfilter/vf_pose.cpp:207:13: warning: unused variable 'env_ptr' [-Wunused-variable]
207 | OrtEnv* env_ptr = (OrtEnv*)(env);
| ^~~~~~~
libavfilter/vf_pose.cpp: In function 'int transform_and_draw_mask(PoseContext*, AVFrame*, AVFrame*, float*, int, float*, CudaFunctions*, CUcontext, int, int, float)':
libavfilter/vf_pose.cpp:572:16: warning: unused variable 'tex_array' [-Wunused-variable]
572 | cudaArray tex_array;
| ^~~~~~~~~
libavfilter/vf_pose.cpp: In function 'int filter_frame(AVFilterLink
, AVFrame*)':
libavfilter/vf_pose.cpp:763:62: warning: 'T* at::Tensor::data() const [with T = float]' is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
763 | transform_and_draw_mask(s, in, out, dofs_out.data(), dofs_out.sizes()[0],

How to scale frame with specified GPU Index?

I have use sws_getContext with flag SWS_HWACCEL_CUDA to get context, and successfully call sws_scale.
It is work when frame data is on the GPU0, but when I decode frame on other GPUs, I get error while use function cv::cuda::GpuMat download :,error is :(-217:Gpu API call) an illegal memory access was encountered in function 'download'.
How could I specify the GPU index before sws_scale?

tensorrt filter cannot run?

commond line:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i ./test-video/pexels-allan.mp4 -vf scale_npp=512:512,format_cuda=rgbpf32,tensorrt=./trt_engines/ESRGAN_x4_512.trt,format_cuda=nv12 -c:v h264_nvenc output.mp4 -y

logs(It's stuck here the whole time):
image

Find the problem:block in trt_model->Execute
image

How to solve the problem?

How to scale and convert frame which pix_fmt is AV_PIX_FMT_CUDA

https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html#hwaccel-transcode-with-scaling

According to https://github.com/NVIDIA/GMAT/blob/main/ffmpeg-gpu/libswscale/cuda/swscale_cuda.c#L34, supported_fmts do not include AV_PIX_FMT_CUDA, which my ffmpeg hw_decoder px_fmt is AV_PIX_FMT_CUDA, how to scale and transform px_fmt to RGB, then to host memory?

As far as I know AV_PIX_FMT_CUDA is the NV12 format on the GPU, which is YUV_NV12, So, how to support AV_PIX_FMT_CUDA format when use libgpuscale

Linking to ONNXRUNTIME Issue

Hi,

In the very last steps of the build process, I face an issue that seems that the onnxruntime library is not linked properly and I get the following message:
LD ffmpeg_g /usr/bin/ld: libavfilter/libavfilter.so: undefined reference to OrtGetApiBase collect2: error: ld returned 1 exit status make: *** [Makefile:124: ffmpeg_g] Error 1

Any suggestion? Thanks!

The format_cuda filter does not work well

Hi,
I just wanted to try tensorrt in this framework, but I found that I got full green screen as the final result. The test command is like this:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i SampleVideo_640x360_1mb.mp4 -vf scale_npp=640:360,format_cuda=rgbpf32le,tensorrt=ESRGAN_x4_723_360.trt,format_cuda=nv12 -c:v h264_nvenc SRResult.mp4

It seams that this is caused by the "format_cuda" filter. I dumped the output of format_cuda filter like this:

ffmpeg -hwaccel cuda  -hwaccel_output_format cuda -i SampleVideo_640x360_1mb.mp4 -vf scale_npp=640:360,format_cuda=rgbpf32le,hwdownload,format=rgbpf32le output.yuv -y
ffmpeg version f41f54b Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --enable-nonfree --enable-libtensorrt --enable-cuda-nvcc --enable-libnpp --enable-libopencv --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared --enable-pic --nvccflags='-gencode arch=compute_86,code=sm_86'
  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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SampleVideo_640x360_1mb.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf53.24.2
  Duration: 00:00:06.40, start: 0.000000, bitrate: 1321 kb/s
  Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x368 [SAR 1:1 DAR 40:23], 932 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to 'output.yuv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.76.100
  Stream #0:0(und): Video: rawvideo, rgbpf32le(progressive), 640x360 [SAR 45:46 DAR 40:23], q=2-31, 552960 kb/s, 25 fps, 25 tbn (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc58.134.100 rawvideo
frame=  160 fps=0.0 q=-0.0 Lsize=  432000kB time=00:00:06.40 bitrate=552960.0kbits/s speed=  13x    
video:432000kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

I got an output file filled with all 0. But with command that dump nv12 data directly after decode:
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i SampleVideo_640x360_1mb.mp4 -vf scale_npp=640:360,hwdownload,format=nv12 output.yuv -y
I could get correct yuv file which can be play by the ffplay.

Can anyone tell me what's the problem? Thanks in advance!

libavfilter/format_cuda_kernel.cu:22:10: fatal error: libavutil/pixfmt.h: No such file or directory

@xiaoweiw-nv
Dear weiw, I followed the REAME's instructions to compile this project, the compilation task was failed, the error info like these:
libavfilter/format_cuda_kernel.cu:22:10: fatal error: libavutil/pixfmt.h: No such file or directory

Platform information: Ubuntu18.04 x64, cuda: 10.2 Nvidia Driver: 510.60.02, gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
My compiling command:
make clean && bash config_ffmpeg_libtorch.sh /home/user/FFmpeg-GPU-Demo/libtorch && make -j5 && sudo make install -j5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.