[Cin] Prepping HW upgrade options for AV1 de-/encoding

Terje J. Hanssen terjejhanssen at gmail.com
Wed Dec 13 23:53:33 CET 2023



Den 11.12.2023 00:02, skrev Terje J. Hanssen:
>
>
> Den 10.12.2023 19:04, skrev Andrew Randrianasulu:
>>
>>
>> вс, 10 дек. 2023 г., 20:37 Andrew Randrianasulu 
>> <randrianasulu at gmail.com>:
>>
>>
>>
>>     вс, 10 дек. 2023 г., 20:32 Terje J. Hanssen via Cin
>>     <cin at lists.cinelerra-gg.org>:
>>
>>
>>         Den 03.12.2023 22:29, skrev Terje J. Hanssen:
>>>         Already touched this topic barely in another thread
>>>         https://lists.cinelerra-gg.org/pipermail/cin/2023-December/007346.html
>>>
>>>         But so many SW and HW pieces are mentioned around, it is
>>>         almost a full-time reading and study:
>>>         VAAPI, MESA, VULKAN, Intel Quick Sync Video etc......
>>>
>>>         I realize my aging hardware which is fast enough for other
>>>         tasks, needs some "AV1 upgrade", if possible.
>>>
>>>         But first I wonder, what is expected possible to do (obtain)
>>>         with AV1 de-/encoding on my existing 64bit hardware:
>>>
>>>             1) laptop 2018: Dell XPS 13-9370: quad core i7-8550U CPU
>>>             (8. gen Kabylake) and Intel UHD Graphics
>>>
>>>             2) WS infinity: MSI Z170A mobo:  quad core i7-6700K CPU
>>>             (6. gen Skylake), NVIDIA GeForce GT-730 graphics
>>>
>>>
>>
>>         I continue the "AV1 de-/encoding on my existing 64bit
>>         hardware" question above as a branch here (instead of a new
>>         related thread).
>>
>>         This part is also related to another 2021 thread, [Cin] tried
>>         to update av1.webm profile
>>         https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg02804.html
>>         which refere to FFmpeg's AV1 Video Encoding Guide
>>         https://trac.ffmpeg.org/wiki/Encode/AV1
>>
>
> I took my first AV1 rendering test with CinGGs default av1.webm preset 
> by loading a standard SD DV file clip.
>
>     du -sh dv*
>     389M    dv01_07.dv
>     30M    dv01_07.webm
>
>
>     ffprobe -hide_banner dv01_07.dv
>     [dv @ 0x5595e79b4580] Estimating duration from bitrate, this may
>     be inaccurate
>     Input #0, dv, from 'dv01_07.dv':
>       Metadata:
>         timecode        : 01:09:35:09
>       Duration: 00:01:53.28, start: 0.000000, bitrate: 28800 kb/s
>       Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR
>     4:3], 25000 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
>       Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
>
>
>     ffprobe -hide_banner dv01_07.webm
>     [libdav1d @ 0x560ccddb3380] libdav1d 1.0.0
>     Input #0, matroska,webm, from 'dv01_07.webm':
>       Metadata:
>         ENCODER         : Lavf60.16.100
>       Duration: 00:01:53.28, start: 0.000000, bitrate: 2220 kb/s
>       Stream #0:0: Video: av1 (Main), yuv420p(tv,
>     bt470bg/unknown/unknown), 720x576 [SAR 1:1 DAR 5:4], 25 fps, 25
>     tbr, 1k tbn, 1k tbc
>         Metadata:
>           DURATION        : 00:01:53.243000000
>       Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
>         Metadata:
>           DURATION        : 00:01:53.281000000
>
> Rendering took 0:03:33 or 1.87 x the Duration
> This webm file was displayed ok in VLC and FFplay on Leap 15.5

SVT-AV1 re-encoding
---------------------------------
I will add the re-encoded sample SD DV file using ffmpeg SVT-AV1, as I 
was positive surprised how much faster (preset 10 about 25 sec) it was 
than rendering AV1 with CinGG (libaom?) .  I've tested three presets: 8, 
10 and 12. "Useable visible quality" for all.

    ffmpeg -i dv01_07.dv -c:v libsvtav1 -preset 8 -crf 35 -c:a libvorbis
    dv01_07_svt-av1_pr8.webm
    frame= 2832 fps= 66 q=35.0 Lsize=   28836kB time=00:01:53.26
    bitrate=2085.6kbits/s speed=2.65x

    ffmpeg -i dv01_07.dv -c:v libsvtav1 -preset 10 -crf 35 -c:a
    libvorbis dv01_07_svt-av1_pr10.webm
    frame= 2832 fps=112 q=35.0 Lsize=   34419kB time=00:01:53.26
    bitrate=2489.4kbits/s speed=4.47x

    ffmpeg -i dv01_07.dv -c:v libsvtav1 -preset 12 -crf 35 -c:a
    libvorbis dv01_07_svt-av1_pr12.webm
    frame= 2832 fps=262 q=35.0 Lsize=   35913kB time=00:01:53.26
    bitrate=2597.5kbits/s speed=10.5x

    du -sh *
    30M    dv01_07_av1_cingg.webm
    389M    dv01_07.dv
    34M    dv01_07_svt-av1_pr10.webm
    36M    dv01_07_svt-av1_pr12.webm
    29M    dv01_07_svt-av1_pr8.webm

    I add full output for preset 10 only:

    ffprobe -hide_banner dv01_07_svt-sv1_pr10.webm
    [libdav1d @ 0x55ba878325c0] libdav1d 1.3.0
    Input #0, matroska,webm, from 'dv01_07_svt-sv1_pr10.webm':
       Metadata:
         TIMECODE        : 01:09:35:09
         ENCODER         : Lavf60.3.100
       Duration: 00:01:53.28, start: 0.000000, bitrate: 2488 kb/s
       Stream #0:0: Video: av1 (Main), yuv420p(tv), 720x576, SAR 16:15
    DAR 4:3, 25 fps, 25 tbr, 1k tbn
         Metadata:
           ENCODER         : Lavc60.3.100 libsvtav1
           DURATION        : 00:01:53.283000000
       Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
         Metadata:
           ENCODER         : Lavc60.3.100 libvorbis
           DURATION        : 00:01:53.283000000
    [libdav1d @ 0x55ba8788e6c0] libdav1d 1.3.0

    ----------

    ffmpeg -i dv01_07.dv -c:v libsvtav1 -preset 10 -crf 35 -c:a
    libvorbis dv01_07_svt-sv1_pr10.webm
    ffmpeg version 6.0.1 Copyright (c) 2000-2023 the FFmpeg developers
       built with gcc 13 (SUSE Linux)
       configuration: --prefix=/usr --libdir=/usr/lib64
    --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg
    --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
    -fstack-protector-strong -funwind-tables
    -fasynchronous-unwind-tables -fstack-clash-protection
    -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2
    -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong
    -funwind-tables -fasynchronous-unwind-tables
    -fstack-clash-protection -Werror=return-type -flto=auto
    -ffat-lto-objects -g' --disable-htmlpages --enable-pic
    --disable-stripping --enable-shared --disable-static --enable-gpl
    --enable-version3 --disable-openssl --enable-gnutls --enable-ladspa
    --enable-libshaderc --enable-vulkan --enable-libplacebo
    --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b
    --enable-libcdio --enable-libcodec2 --enable-libdav1d
    --enable-libdc1394 --enable-libdrm --enable-libfontconfig
    --enable-libfreetype --enable-libfribidi --enable-libgsm
    --enable-libjack --enable-libjxl --enable-librist
    --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg
    --enable-libopenmpt --enable-libopenh264-dlopen --enable-libopus
    --enable-libpulse --enable-librav1e --enable-librubberband
    --enable-libsvtav1 --enable-libsoxr --enable-libspeex
    --enable-libssh --enable-libsrt --enable-libtheora
    --enable-libtwolame --enable-libvidstab --enable-libvmaf
    --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2
    --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lto
    --enable-lv2 --enable-libmfx --enable-vaapi --enable-vdpau
    --enable-version3 --enable-libfdk-aac-dlopen --enable-nonfree
    --enable-libopencore-amrnb --enable-libopencore-amrwb
    --enable-libvo-amrwbenc --enable-libx264 --enable-libx265
    --enable-libxvid
       libavutil      58.  2.100 / 58.  2.100
       libavcodec     60.  3.100 / 60.  3.100
       libavformat    60.  3.100 / 60.  3.100
       libavdevice    60.  1.100 / 60.  1.100
       libavfilter     9.  3.100 /  9.  3.100
       libswscale      7.  1.100 /  7.  1.100
       libswresample   4. 10.100 /  4. 10.100
       libpostproc    57.  1.100 / 57.  1.100
    [dv @ 0x55c1b0b87380] Estimating duration from bitrate, this may be
    inaccurate
    Input #0, dv, from 'dv01_07.dv':
       Metadata:
         timecode        : 01:09:35:09
       Duration: 00:01:53.28, start: 0.000000, bitrate: 28800 kb/s
       Stream #0:0: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR
    4:3], 25000 kb/s, 25 fps, 25 tbr, 25 tbn
       Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    File 'dv01_07_svt-sv1_pr10.webm' already exists. Overwrite? [y/N] y
    Stream mapping:
       Stream #0:0 -> #0:0 (dvvideo (native) -> av1 (libsvtav1))
       Stream #0:1 -> #0:1 (pcm_s16le (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    Svt[info]: -------------------------------------------
    Svt[info]: SVT [version]:    SVT-AV1 Encoder Lib v1.7.0
    Svt[info]: SVT [build]  :    GCC 13.2.1 20230912 [revision
    b96e66fd4ef3e36983969fb8cdd1956f551a074b]  64 bit
    Svt[info]: LIB Build date: Nov  3 2023 00:00:00
    Svt[info]: -------------------------------------------
    Svt[info]: Number of logical cores available: 8
    Svt[info]: Number of PPCS 107
    Svt[info]: [asm level on system : up to avx2]
    Svt[info]: [asm level selected : up to avx2]
    Svt[info]: -------------------------------------------
    Svt[info]: SVT [config]: main profile tier (auto)    level (auto)
    Svt[info]: SVT [config]: width / height / fps numerator / fps
    denominator         : 720 / 576 / 25 / 1
    Svt[info]: SVT [config]: bit-depth / color format                
         : 8 / YUV420
    Svt[info]: SVT [config]: preset / tune / pred struct                
         : 10 / PSNR / random access
    Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type
                 : 161 / 32 / key frame
    Svt[info]: SVT [config]: BRC mode / rate factor                    
    : CRF / 35
    Svt[info]: -------------------------------------------
    Output #0, webm, to 'dv01_07_svt-sv1_pr10.webm':
       Metadata:
         timecode        : 01:09:35:09
         encoder         : Lavf60.3.100
       Stream #0:0: Video: av1, yuv420p(bottom coded first (swapped)),
    720x576 [SAR 16:15 DAR 4:3], q=2-31, 25 fps, 1k tbn
         Metadata:
           encoder         : Lavc60.3.100 libsvtav1
       Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
         Metadata:
           encoder         : Lavc60.3.100 libvorbis
    frame= 2832 fps=112 q=35.0 Lsize=   34419kB time=00:01:53.26
    bitrate=2489.4kbits/s speed=4.47x
    video:32865kB audio:1495kB subtitle:0kB other streams:0kB global
    headers:4kB muxing overhead: 0.171717%


>
>>         To start with the workstation 2) above, I want suggestions
>>         how to test the possible AV1 encoding options (libaom,
>>         SVT-AV1, MESA, VAAPI, VDPAU) using my  system enabled ffmpeg
>>         6.0.1 commands,, and also suggestions to required change in
>>         system/graphics settings.
>>
>>         System output as background info:
>>
>>             fmpeg -encoders -hide_banner | grep av1
>>              V....D libaom-av1           libaom AV1 (codec av1)
>>              V....D librav1e             librav1e AV1 (codec av1)
>>
>>
>>     From phoronix articles librav1e and SVT-AV1 should be faster, but
>>     sometimes at  quality cost.
>>
>>     Sorry, not tried them personally due to svt demanding 64-bit
>>     system and rav1e demanding rust.
>>
>>     So for this task you are on your own .. sorry!
>>
>>
>> https://ottverse.com/analysis-of-svt-av1-presets-and-crf-values/
>>
>>
>> may be crf 26 (ish) and preset 6 ?
>>
>> On 36 core machine with avx512 it surely was fast, but on 4c .. I 
>> guess 1.25 fps or so will be best you can get? (for fullhd source)
>>
>>
>>
>>
>>
>>
>>              V..... libsvtav1            SVT-AV1(Scalable Video
>>             Technology for AV1) encoder (codec av1)
>>              V....D av1_nvenc            NVIDIA NVENC av1 encoder
>>             (codec av1)
>>              V....D av1_amf              AMD AMF AV1 encoder (codec av1)
>>              A....D wmav1                Windows Media Audio 1
>>
>>             libaom3 v. 3,7.1
>>
>>             libSvtAv1Enc1 v. 1.7.0
>>
>>             libva-vdpau-driver v. 0.7.4
>>
>>             vainfo
>>             Trying display: wayland
>>             error: XDG_RUNTIME_DIR is invalid or not set in the
>>             environment.
>>             Trying display: x11
>>             libva info: VA-API version 1.20.0
>>             libva info: Trying to open
>>             /usr/lib64/dri/nouveau_drv_video.so
>>             libva info: Found init function __vaDriverInit_1_20
>>             libva info: va_openDriver() returns 0
>>             vainfo: VA-API version: 1.20 (libva 2.20.0)
>>             vainfo: Driver version: Mesa Gallium driver 23.2.1 for NV106
>>             vainfo: Supported profile and entrypoints
>>             VAProfileNone                   : VAEntrypointVideoProc
>>
>>             ---------------
>>
>>             inxi -zdGCS
>>             System:
>>               Kernel: 6.6.1-1-default arch: x86_64 bits: 64 Desktop:
>>             GNOME v: 45.1
>>                 Distro: openSUSE Tumbleweed-Slowroll 20231119
>>             CPU:
>>               Info: quad core model: Intel Core i7-6700K bits: 64
>>             type: MT MCP cache:
>>                 L2: 1024 KiB
>>               Speed (MHz): avg: 800 min/max: 800/4200 cores: 1: 800
>>             2: 800 3: 800 4: 800
>>                 5: 800 6: 800 7: 800 8: 800
>>             Graphics:
>>               Device-1: NVIDIA GK208B [GeForce GT 730] driver:
>>             nouveau v: kernel
>>               Device-2: Microdia Camera driver:
>>             snd-usb-audio,uvcvideo type: USB
>>               Device-3: MACROSILICON USB3.0 UHD
>>                 driver: hid-generic,snd-usb-audio,usbhid,uvcvideo
>>             type: USB
>>               Display: server: X.org v: 1.21.1.9 with: Xwayland v:
>>             23.2.2 driver: X:
>>                 loaded: nouveau unloaded: fbdev,modesetting,vesa dri:
>>             nouveau gpu: nouveau
>>                 resolution: 2560x1440~60Hz
>>               API: OpenGL v: 4.3 vendor: mesa v: 23.2.1 renderer: NV106
>>               API: EGL Message: EGL data requires eglinfo. Check
>>             --recommends.
>>             Drives:
>>               Local Storage: total: 8.8 TiB used: 5.02 TiB (57.1%)
>>               ID-1: /dev/nvme0n1 vendor: Samsung model:
>>             MZVPV512HDGL-00000
>>                 size: 476.94 GiB
>>               ID-2: /dev/sda vendor: Intel model: SSDSA2CW160G3 size:
>>             149.05 GiB
>>               ID-3: /dev/sdb vendor: Seagate model: ST3500418AS size:
>>             465.76 GiB
>>               ID-4: /dev/sdc vendor: Seagate model: ST3500418AS size:
>>             465.76 GiB
>>               ID-5: /dev/sdd vendor: Seagate model: Expansion HDD
>>             size: 7.28 TiB
>>                 type: USB
>>               Optical-1: /dev/sr0 vendor: HL-DT-ST model: BD-RE BH10LS30
>>                 dev-links: cdrom
>>               Features: speed: 40 multisession: yes audio: yes dvd: yes
>>                 rw: cd-r,cd-rw,dvd-r,dvd-ram
>>
>>             ------------------
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>         -- 
>>         Cin mailing list
>>         Cin at lists.cinelerra-gg.org
>>         https://lists.cinelerra-gg.org/mailman/listinfo/cin
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20231213/b7c23b02/attachment-0001.htm>


More information about the Cin mailing list