ffmpeg with vulkan and or opencl

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg with vulkan and or opencl

owen s
I have installed opencl and vulkan drivers on linux: Linux
5.8.0-7630-generic #32~1609193707~20.10~781bb80-Ubuntu SMP Tue Jan 5
21:29:56 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

I am using ffmpeg version:
ffmpeg version 4.3.1-4ubuntu1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10 (Ubuntu 10.2.0-9ubuntu2)

I am running this ffmpeg command
ffmpeg -y -hwaccel any \
-loop 1 -framerate 30 -re \
-hwaccel dxva2 \
-i ./1280x720.jpg \
-stream_loop -1 -re \
-i ./audio.mp3 \
-vcodec libx264 -pix_fmt yuv420p \
-b:v 2500k -maxrate 2500k -bufsize 10000k \
-preset slow -tune stillimage \
-b:a 128k -ar 44100 -ac 2 -acodec aac \
-af "dynaudnorm=f=150:g=15" \
-g 60 \
-f flv tmp.flv

This is the output error:
ffmpeg version 4.3.1-4ubuntu1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10 (Ubuntu 10.2.0-9ubuntu2)
  configuration: --prefix=/usr --extra-version=4ubuntu1
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-gnutls --enable-ladspa --enable-libaom --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
--enable-libcodec2 --enable-libdav1d --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl
--enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx
--enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Multiple -hwaccel options specified for stream 0, only the last option
'-hwaccel dxva2' will be used.
Input #0, image2, from './1280x720.jpg':
  Duration: 00:00:00.03, start: 0.000000, bitrate: 46423 kb/s
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
bt470bg/unknown/unknown), 1280x720 [SAR 72:72 DAR 16:9], 30 fps, 30 tbr, 30
tbn, 30 tbc
Input #1, mp3, from './audio.mp3':
  Duration: 00:49:57.42, start: 0.025057, bitrate: 128 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : LAME3.99r
    Side data:
      replaygain: track gain - 13.000000, track peak - unknown, album gain
- unknown, album peak - unknown,
Device creation failed: -12.
[mjpeg @ 0x56112782f480] No device available for decoder: device type dxva2
needed for codec mjpeg.
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Device setup failed for decoder on input stream #0:0 : Cannot allocate
memory

====
I cannot get ffmpeg to work, do I need to build a special version?
the wiki page: https://trac.ffmpeg.org/wiki/HWAccelIntro

doesn't provide very detailed info.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg with vulkan and or opencl

Carl Eugen Hoyos-2
Am Sa., 16. Jan. 2021 um 19:13 Uhr schrieb owen s <[hidden email]>:
>
> I have installed opencl and vulkan drivers on linux: Linux
> 5.8.0-7630-generic #32~1609193707~20.10~781bb80-Ubuntu SMP Tue Jan 5
> 21:29:56 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
>
> I am using ffmpeg version:
> ffmpeg version 4.3.1-4ubuntu1 Copyright (c) 2000-2020 the FFmpeg developers
> built with gcc 10 (Ubuntu 10.2.0-9ubuntu2)

Please test current FFmpeg git head before asking questions here.

> I am running this ffmpeg command
> ffmpeg -y -hwaccel any \
> -loop 1 -framerate 30 -re \
> -hwaccel dxva2 \

I may misunderstand your question but there is no dxva2 on Linux.

> -i ./1280x720.jpg \
> -stream_loop -1 -re \
> -i ./audio.mp3 \
> -vcodec libx264 -pix_fmt yuv420p \
> -b:v 2500k -maxrate 2500k -bufsize 10000k \
> -preset slow -tune stillimage \
> -b:a 128k -ar 44100 -ac 2 -acodec aac \
> -af "dynaudnorm=f=150:g=15" \
> -g 60 \
> -f flv tmp.flv

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg with vulkan and or opencl

owen s
Hi Carl

I built ffmpeg from git:
https://gist.github.com/teamblubee/21937f6b606c6577f8c2a40da76d64e5

here's the output from ffmpeg:
ffmpeg version N-100671-gc48110a4a4 Copyright (c) 2000-2021 the FFmpeg
developers
  built with gcc 10 (Ubuntu 10.2.0-13ubuntu1)
  configuration: --prefix=/home/bb/Dev/ffmpeg_build/build
--extra-cflags='-I/home/bb/Dev/ffmpeg_build/build/include -I/usr/include'
--extra-ldflags='-L/home/bb/Dev/ffmpeg_build/build/lib
-L/home/bb/Dev/ffmpeg_build/build/lib/x86_64-linux-gnu
-Wl,-rpath=/home/bb/Dev/ffmpeg_build/build/lib/x86_64-linux-gnu -ldrm
-L/usr/lib' --pkg-config-flags=--static --extra-libs='-lpthread -lm'
--bindir=/home/bb/Dev/ffmpeg_build/bin --arch=amd64 --disable-shared
--disable-ffprobe --disable-ffplay --disable-gnutls --enable-openssl
--enable-zlib --enable-librtmp --enable-static --enable-chromaprint
--enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libx265 --enable-nonfree --enable-vdpau
--enable-ladspa --enable-libaom --enable-libbs2b --enable-libcaca
--enable-libcodec2 --enable-libdav1d --enable-libfontconfig
--enable-libfribidi --enable-libgme --enable-libopenjpeg --enable-librsvg
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libwebp
--enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl
--enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm
--enable-libiec61883 --enable-libass --enable-libfreetype --enable-libgsm
--enable-libmp3lame --enable-libmysofa --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-librabbitmq
--enable-libvorbis --enable-libvpx --enable-libflite --enable-chromaprint
--enable-frei0r
  libavutil      56. 63.101 / 56. 63.101
  libavcodec     58.117.101 / 58.117.101
  libavformat    58. 65.101 / 58. 65.101
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 96.100 /  7. 96.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options]
outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'


ffmpeg-git -hide_banner -hwaccels
Hardware acceleration methods:
vdpau
vaapi
drm
opencl

trying to run this command
ffmpeg-git -y \
-loglevel debug \
-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
-loop 1 -r 4.8 -i ./image.jpg \
-stream_loop -1 -i ./audio.mp3 \
-c:v h264_vaapi -pix_fmt vaapi_vld \
-b:a 128k -ar 44100 -ac 2 -acodec aac \
-r 30 -g 60  \
-f flv /dev/null

I get this error: http://0x0.st/-i1t.txt

How can I actually use any of these hardware accelerated options?

On Mon, Jan 18, 2021 at 5:34 AM Carl Eugen Hoyos <[hidden email]> wrote:

> Am Sa., 16. Jan. 2021 um 19:13 Uhr schrieb owen s <[hidden email]>:
> >
> > I have installed opencl and vulkan drivers on linux: Linux
> > 5.8.0-7630-generic #32~1609193707~20.10~781bb80-Ubuntu SMP Tue Jan 5
> > 21:29:56 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
> >
> > I am using ffmpeg version:
> > ffmpeg version 4.3.1-4ubuntu1 Copyright (c) 2000-2020 the FFmpeg
> developers
> > built with gcc 10 (Ubuntu 10.2.0-9ubuntu2)
>
> Please test current FFmpeg git head before asking questions here.
>
> > I am running this ffmpeg command
> > ffmpeg -y -hwaccel any \
> > -loop 1 -framerate 30 -re \
> > -hwaccel dxva2 \
>
> I may misunderstand your question but there is no dxva2 on Linux.
>
> > -i ./1280x720.jpg \
> > -stream_loop -1 -re \
> > -i ./audio.mp3 \
> > -vcodec libx264 -pix_fmt yuv420p \
> > -b:v 2500k -maxrate 2500k -bufsize 10000k \
> > -preset slow -tune stillimage \
> > -b:a 128k -ar 44100 -ac 2 -acodec aac \
> > -af "dynaudnorm=f=150:g=15" \
> > -g 60 \
> > -f flv tmp.flv
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".