[Cin] SVT-AV1 encoding quite fast on x86_64

Terje J. Hanssen terjejhanssen at gmail.com
Sat Dec 30 00:55:14 CET 2023



Den 29.12.2023 19:27, skrev Terje J. Hanssen:
>
>
> Den 29.12.2023 11:56, skrev Andrew Randrianasulu:
>>
>>
>> пт, 29 дек. 2023 г., 05:01 Terje J. Hanssen <terjejhanssen at gmail.com>:
>>
>>
>>
>>     Den 17.12.2023 00:05, skrev Andrew Randrianasulu:
>>>
>>>
>>>     пт, 15 дек. 2023 г., 21:10 Terje J. Hanssen via Cin
>>>     <cin at lists.cinelerra-gg.org>:
>>>
>>>
>>>
>>>         Anyway, apparently SVT-AV1 libsvtav1 shines as the superiour
>>>         fastest and simple to use CPU based AV1 encoder (before GPU
>>>         hwaccels)
>>>
>>>
>>>     After rebuilding SVT-AV1 on termux for Neon acceleration I tried
>>>     three variations of same file:
>>>
>>>     du -h av1-1.8.0*
>>>     5.0M    av1-1.8.0-pr12.webm
>>>     4.3M    av1-1.8.0-pr2.webm
>>>     4.6M    av1-1.8.0.webm
>>>
>>>     all on crf 30
>>>
>>>     ffmpeg -i 20081103140154.m2t -c:v libsvtav1 -an -preset 2 -crf
>>>     30 av1-1.8.0-pr2.webm
>>>
>>>     this one run at 0.2 fps
>>>
>>>     ffmpeg -i 20081103140154.m2t -c:v libsvtav1 -an -preset 12 -crf
>>>     30 av1-1.8.0-pr12.webm
>>>
>>>     this one run up to 9.4 fps!
>>>
>>>     ffmpeg -i 20081103140154.m2t -c:v libsvtav1 -an -preset 6 -crf
>>>     30 av1-1.8.0.webm
>>>
>>>     and this one run  at 1.3 fps.
>>>
>>>     all files encoded from same input:
>>>
>>>     Stream #0:0[0x810]: Video: mpeg2video (Main) ([2][0][0][0] /
>>>     0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR
>>>     16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn
>>>
>>>     So, I guess on aarch64 tablet this one definitely not as fast as
>>>     on desktop (x86_64) Intel.
>>>
>>>
>>
>>
>>     AV1 Encoding/Rendering:
>>     ======================
>>
>>     To compare encoding with FFmpeg/SVT-AV1 v. 1.7.0 and rendering
>>     with the current CinGG/AOM-AV1 (v. 3.1.1?), I used a medium
>>     length 1080i HDV clip (ca. 7 min duration) as input file:
>>     1,3G    hdv07_05.m2t
>>
>>
>>     239M    hdv07_05_m2t_svt-av1_pr10.webm
>>     ffmpeg -i hdv07_05.m2t -c:v libsvtav1 -preset 10 -crf 35 -c:a
>>     libvorbis hdv07_05_m2t_svt-av1_pr10.webm
>>     frame=10240 fps= 68 q=27.0 Lsize=  244069kB time=00:06:58.24
>>     bitrate=4780.5kbits/s speed=2.78x
>>
>>
>>     235M    hdv07_05_cingg_aom-av1.webm
>>     Rendering with CinGG/AOM-AV1
>>     Rendering took 0:37:06 = 2226 sek
>>     FPS=10240/2226=4.6
>>
>>
>>     Rendering speed results:
>>     ------------------------
>>     68 FPS vs 4.6 FPS
>>
>>
>>     FFplay playback:
>>     ===============
>>
>>     hdv07_05_m2t_svt-av1_pr10.webm
>>     ------------------------------
>>     ffplay -hide_banner hdv07_05_m2t_svt-av1_pr10.webm
>>     [libdav1d @ 0x7fe318004880] libdav1d 1.3.0    0KB sq=    0B f=0/0
>>     Input #0, matroska,webm, from 'hdv07_05_m2t_svt-av1_pr10.webm':
>>       Metadata:
>>         ENCODER         : Lavf60.3.100
>>       Duration: 00:06:58.28, start: 0.000000, bitrate: 4780 kb/s
>>       Stream #0:0: Video: av1 (Main), yuv420p(tv, bt709), 1440x1080,
>>     SAR 4:3 DAR 16:9, 25 fps, 25 tbr, 1k tbn
>>         Metadata:
>>           ENCODER         : Lavc60.3.100 libsvtav1
>>           DURATION        : 00:06:58.283000000
>>       Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
>>         Metadata:
>>           ENCODER         : Lavc60.3.100 libvorbis
>>           DURATION        : 00:06:57.939000000
>>     [libdav1d @ 0x7fe3180d5b80] libdav1d 1.3.0
>>       20.51 A-V: -0.032 fd=   0 aq=   12KB vq=  310KB sq=    0B f=0/0
>>
>>
>>     hdv07_05_cingg_aom-av1.webm
>>     ----------------------------
>>     ffplay -hide_banner hdv07_05_cingg_aom-av1.webm
>>     [libdav1d @ 0x7f3650004640] libdav1d 1.3.0    0KB sq=    0B f=0/0
>>     Input #0, matroska,webm, from 'hdv07_05_cingg_aom-av1.webm':f=0/0
>>       Metadata:
>>         ENCODER         : Lavf60.16.100
>>       Duration: 00:06:58.08, start: 0.000000, bitrate: 4708 kb/s
>>       Stream #0:0: Video: av1 (Main), yuv420p(tv,
>>     bt470bg/unknown/unknown), 1440x1080, SAR 1:1 DAR 4:3, 25 fps, 25
>>     tbr, 1k tbn
>>         Metadata:
>>           DURATION        : 00:06:58.043000000
>>       Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
>>         Metadata:
>>           DURATION        : 00:06:58.082000000
>>     [libdav1d @ 0x7f36500da540] libdav1d 1.3.0
>>       24.95 A-V: -0.008 fd=   3 aq=   21KB vq=  583KB sq=    0B f=0/0
>>
>>
>>     VLC Playback (copied codec info from GUI Tool tab)
>>     ============
>>
>>     vlc hdv07_05_m2t_svt-av1_pr10.webm
>>     ----------------------------------
>>     Stream 0
>>         Codec: AOMedia's AV1 Video (av01)
>>         Type: Video
>>         Video resolution: 1440x1080
>>         Buffer dimensions: 1536x1152
>>         Frame rate: 25
>>         Decoded format: Planar 4:2:0 YUV
>>         Orientation: Top left
>>         Color primaries: ITU-R BT.709
>>         Color transfer function: ITU-R BT.709
>>     Stream 1
>>         Codec: Vorbis Audio (vorb)
>>         Type: Audio
>>         Channels: Stereo
>>         Sample rate: 48000 Hz
>>         Bits per sample: 32
>>         Bitrate: 112 kb/s
>>         encoder: Lavc60.3.100
>>
>>
>>     vlc hdv07_05_cingg_aom-av1.webm
>>     -------------------------------
>>     Stream 0
>>         Codec: AOMedia's AV1 Video (av01)
>>         Type: Video
>>         Video resolution: 1440x1080
>>         Buffer dimensions: 1536x1152
>>         Frame rate: 25
>>         Decoded format: Planar 4:2:0 YUV
>>         Orientation: Top left
>>         Color space: ITU-R BT.601 Range
>>     Stream 1
>>         Codec: Vorbis Audio (vorb)
>>         Type: Audio
>>         Channels: Stereo
>>         Sample rate: 48000 Hz
>>         Bits per sample: 32
>>         Bitrate: 112 kb/s
>>         encoder: Lavc60.31.102
>>
>>
>>     Playback results:
>>     -----------------
>>
>>     hdv07_05_m2t_svt-av1_pr10.webm
>>     ------------------------------
>>     FFplay and VLC: Correct playback of HDV 16:9 (DAR) Video and
>>     correct Audio
>>     BT.709 Colors should be correct for HD(V) video
>>
>>
>>     hdv07_05_cingg_aom-av1.webm
>>     ----------------------------
>>     FFplay and VLC: wrong playback of HDV 4:3 (DAR) Video,
>>     and som screeching (scratch) sound on Audio
>>     BT.601 colors is seemingly for (older) SD video
>>     That said, I just loaded the HDV clip in Cin-GG without change of
>>     the default Preferences,
>>     so this can probably be corrected/tuned.
>>
>>
>> well, lack of correct (display) aspect ratio on output, as well as 
>> distorted sound is concerning!
>>
>> Can you try another audio encoder, and may be manually set 'format' 
>> parameters, if container-level aspect ratio still not set up 
>> automatically?
>>
>>
>
> Within Settings | Format I selected "our" Preset "HDV 1080i/25".
> The Color model changed from RGB-8 bit to YUVA-8 bit. but I didn't see 
> it change of geometry parameters.
> Still the Canvas size was: Width:1440, Height:1080, W Ratio:1.0, H 
> Ratio:1.0, Aspect Ratio:16.0:9.0
>
> If the latter Aspect Ratio is equivalent to FFmpeg's DAR 16:9,
> shouldn't W Ratio and H Ratio be equivalent to FFmpegs pixel aspect 
> ratio SAR 4:3 as in the svt-av1 encoded file?
>
> Or generic: Would it be possible to automatic get the format 
> parameters identical to how FFmpeg (FFprobe) read the source file?
> And like SVT-AV1: By default SVT-AV1 will encode 10-bit sources to 
> 10-bit outputs and 8-bit to 8-bit.
>
> ---------------
>
> I tested also Cin-GG/aom-av1 rendering of 20081103140154.m2t hdv file 
> (you used above with ffmpeg.)
> The same result, display aspect ratio is 4:3. Actually as soon the 
> files are saved to disk, Gnome File manager show them visually like 
> the 4:3 SD icons.
>
> Could you possibly try to render the same file using CinGG av1.webm to 
> verify what happends ?
>

Incidentally I managed to get 20081103140154_m2t_cingg_aom-av1.webm 
rendered and playback with the correct 16:9 Aspect ratio.
But only for that single hdv file, not for my own hdv07_5xx.webm files

    ffplay -hide_banner 20081103140154_m2t_cingg_aom-av1.webm
    [libdav1d @ 0x7faf50005a80] libdav1d 1.0.0    0KB sq=    0B f=0/0
    Input #0, matroska,webm, from '20081103140154_m2t_cingg_aom-av1.webm':
    Metadata:
    ENCODER         : Lavf60.16.100
    Duration: 00:00:13.44, start: 0.000000, bitrate: 1515 kb/s
    Stream #0:0: Video: av1 (Main), yuv420p(tv,
    bt470bg/unknown/unknown), 1440x810 [SAR 1:1 DAR 16:9], 25 fps, 25
    tbr, 1k tbn, 1k tbc
    Metadata:
    DURATION        : 00:00:13.403000000
    Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
    Metadata:
    DURATION        : 00:00:13.441000000
    [libdav1d @ 0x7faf500b7900] libdav1d 1.0.0
    7.67 A-V:  0.032 fd=   0 aq=   19KB vq=  230KB sq=    0B f=0/0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20231230/82e0fa2c/attachment-0001.htm>


More information about the Cin mailing list