Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
guiodic
Posts: 5
Joined: Sat Sep 23, 2023 11:23 am

Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by guiodic »

Description of problem or question:
Not a problem:
HB seems to use GPU for AV1 encoding but my GPU has not that feature



Steps to reproduce the problem (If Applicable):
Try to transcode an h264 in AV1 with QSV (but the interface shows AV1 SVT)



HandBrake version (e.g., 1.0.0):
1.6.1



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Manjaro Linux (unstable branch, on par with Arch)



HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

[13:27:58] gtkgui: HandBrake 1.6.1 (2023021700) - Linux x86_64 - https://handbrake.fr
[13:27:58] Compile-time hardening features are enabled
[13:27:58] hb_display_init: using VA driver 'iHD'
[13:27:58] hb_display_init: using VA driver 'iHD'
[13:27:58] qsv: is available on this system
Cannot load libnvidia-encode.so.1
[13:27:58] hb_init: starting libhb thread
[13:27:58] hb_init: starting libhb thread
[13:27:58] hb_init: starting libhb thread
[13:27:58] CPU: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
[13:27:58]  - Intel microarchitecture Tiger Lake
[13:27:58]  - logical processor count: 8
[13:27:58] Intel Quick Sync Video support: yes
[13:27:58] Intel Quick Sync Video integrated adapter with index 0
[13:27:58] Impl mfx-gen library path: /usr/lib/libmfx-gen.so.1.2.9
[13:27:58]  - Intel Media SDK hardware: API 2.9 (minimum: 1.3)
[13:27:58]  - Decode support:  h264 hevc (8bit: yes, 10bit: yes) av1 (8bit: yes, 10bit: yes)
[13:27:58]  - H.264 encoder: yes
[13:27:58]     - preferred implementation: hardware (any) via ANY
[13:27:58]     - capabilities (hardware):  lowpower breftype vsinfo chromalocinfo opt1 opt2+mbbrc+extbrc+trellis+repeatpps+ib_adapt+nmpslice
[13:27:58]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[13:27:58]     - preferred implementation: hardware (any) via ANY
[13:27:58]     - capabilities (hardware):  lowpower bpyramid vsinfo masteringinfo cllinfo opt1
[13:27:58]  - AV1 encoder: no
[13:27:58] hb_scan: path=/home/guido/tmp/video_ancient_rome_v2.mp4, title_index=0
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /home/guido/tmp/video_ancient_rome_v2.mp4
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
[13:27:58] bd: not a bd - trying as a stream/file instead
libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[13:27:58] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/guido/tmp/video_ancient_rome_v2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:06:43.29, start: 0.000000, bitrate: 3233 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 3068 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[13:27:58] scan: decoding previews for title 1
[13:27:58] scan: audio 0x1: aac, rate=48000Hz, bitrate=159468 Unknown (AAC LC) (2.0 ch) (159 kbps)
[13:27:59] scan: 10 previews, 1280x720, 25,000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[13:27:59] scan: supported video decoders: avcodec qsv
[13:27:59] libhb: scan thread found 1 valid title(s)
[13:28:09] gtkgui: Preset: /Hardware/AV1 QSV 2160p 4K
[13:28:09] Starting work at: Sat Sep 23 13:28:09 2023

[13:28:09] 1 job(s) to process
[13:28:09] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "av_aac",
                "Gain": 0.0,
                "Mixdown": "stereo",
                "NormalizeMixLevel": false,
                "PresetEncoder": "av_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "none"
    },
    "Destination": {
        "AlignAVStart": false,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 6,
                    "Seconds": 43,
                    "Ticks": 36295740
                },
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "/home/guido/tmp/video_ancient_rome_v2RF24.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 7,
                "Settings": {
                    "mode": 0
                }
            },
            {
                "ID": 14,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 720,
                    "width": 1280
                }
            }
        ]
    },
    "Metadata": {
        "Name": "video_ancient_rome_v2"
    },
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/home/guido/tmp/video_ancient_rome_v2.mp4",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "ChromaLocation": 1,
        "ColorInputFormat": 0,
        "ColorMatrix": 1,
        "ColorOutputFormat": 0,
        "ColorPrimaries": 1,
        "ColorRange": 1,
        "ColorTransfer": 1,
        "Encoder": "svt_av1",
        "HardwareDecode": 0,
        "Level": "auto",
        "Options": "",
        "Preset": "12",
        "Profile": "auto",
        "QSV": {
            "AdapterIndex": 0,
            "AsyncDepth": 0,
            "Decode": true
        },
        "Quality": 24.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[13:28:09] CPU: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
[13:28:09]  - Intel microarchitecture Tiger Lake
[13:28:09]  - logical processor count: 8
[13:28:09] Intel Quick Sync Video support: yes
[13:28:09] Intel Quick Sync Video integrated adapter with index 0
[13:28:09] Impl mfx-gen library path: /usr/lib/libmfx-gen.so.1.2.9
[13:28:09]  - Intel Media SDK hardware: API 2.9 (minimum: 1.3)
[13:28:09]  - Decode support:  h264 hevc (8bit: yes, 10bit: yes) av1 (8bit: yes, 10bit: yes)
[13:28:09]  - H.264 encoder: yes
[13:28:09]     - preferred implementation: hardware (any) via ANY
[13:28:09]     - capabilities (hardware):  lowpower breftype vsinfo chromalocinfo opt1 opt2+mbbrc+extbrc+trellis+repeatpps+ib_adapt+nmpslice
[13:28:09]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[13:28:09]     - preferred implementation: hardware (any) via ANY
[13:28:09]     - capabilities (hardware):  lowpower bpyramid vsinfo masteringinfo cllinfo opt1
[13:28:09]  - AV1 encoder: no
[13:28:09] hb_scan: path=/home/guido/tmp/video_ancient_rome_v2.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /home/guido/tmp/video_ancient_rome_v2.mp4
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
[13:28:09] bd: not a bd - trying as a stream/file instead
libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[13:28:09] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/guido/tmp/video_ancient_rome_v2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:06:43.29, start: 0.000000, bitrate: 3233 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 3068 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[13:28:09] scan: decoding previews for title 1
[13:28:09] scan: audio 0x1: aac, rate=48000Hz, bitrate=159468 Unknown (AAC LC) (2.0 ch) (159 kbps)
[13:28:09] scan: 10 previews, 1280x720, 25,000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[13:28:09] scan: supported video decoders: avcodec qsv
[13:28:09] libhb: scan thread found 1 valid title(s)
[13:28:09] Starting Task: Encoding Pass
[13:28:09] Skipping vfr filter
[13:28:09] Skipping crop/scale filter
[13:28:09] job configuration:
[13:28:09]  * source
[13:28:09]    + /home/guido/tmp/video_ancient_rome_v2.mp4
[13:28:09]    + title 1, chapter(s) 1 to 1
[13:28:09]    + container: mov,mp4,m4a,3gp,3g2,mj2
[13:28:09]    + data rate: 3233 kbps
[13:28:09]  * destination
[13:28:09]    + /home/guido/tmp/video_ancient_rome_v2RF24.mp4
[13:28:09]    + container: MPEG-4 (libavformat)
[13:28:09]  * video track
[13:28:09]    + decoder: h264_qsv 8-bit (yuv420p)
[13:28:09]      + bitrate 3068 kbps
[13:28:09]    + Output geometry
[13:28:09]      + storage dimensions: 1280 x 720
[13:28:09]      + pixel aspect ratio: 1 : 1
[13:28:09]      + display dimensions: 1280 x 720
[13:28:09]    + encoder: AV1 (SVT)
[13:28:09]      + preset:  12
[13:28:09]      + profile: auto
[13:28:09]      + level:   auto
[13:28:09]      + quality: 24,00 (RF)
[13:28:09]      + color profile: 1-1-1
[13:28:09]      + chroma location: left
[13:28:09]  * audio track 1
[13:28:09]    + decoder: Unknown (AAC LC) (2.0 ch) (159 kbps) (track 1, id 0x1)
[13:28:09]      + bitrate: 159 kbps, samplerate: 48000 Hz
[13:28:09]    + mixdown: Stereo
[13:28:09]    + encoder: AAC (libavcodec)
[13:28:09]      + bitrate: 160 kbps, samplerate: 48000 Hz
[13:28:09] sync: expecting 10082 video frames
[13:28:09] encavcodecInit: AV1 encoder
[13:28:09] encavcodec: encoding at CRF 24,00
[13:28:09] encavcodec: encoding with stored aspect 1/1
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]:	SVT-AV1 Encoder Lib v1.4.1
Svt[info]: SVT [build]  :	GCC 12.2.1 20230201	 64 bit
Svt[info]: LIB Build date: Feb 17 2023 17:08:23
Svt[info]: -------------------------------------------
Svt[info]: Number of logical cores available: 8
Svt[info]: Number of PPCS 54
Svt[info]: [asm level on system : up to avx512]
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 		: 1280 / 720 / 25 / 1
Svt[info]: SVT [config]: bit-depth / color format 					: 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct 					: 12 / VQ / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type 			: 255 / 16 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor 					: CRF / 24 
Svt[info]: -------------------------------------------
[13:28:09] sync: first pts video is 0
[13:28:09] sync: Chapter 1 at frame 1 time 0
[13:28:09] sync: first pts audio 0x1 is 0
[13:28:51] reader: done. 1 scr changes
[13:28:51] work: average encoding speed for job is 239,885529 fps
[13:28:51] aac-decoder done: 18904 frames, 0 decoder errors
[13:28:51] h264_qsv-decoder done: 10082 frames, 0 decoder errors
[13:28:51] sync: got 10082 frames, 10082 expected
[13:28:51] sync: framerate min 25,000 fps, max 25,000 fps, avg 25,000 fps
[13:28:51] mux: track 0, 10082 frames, 79969888 bytes, 1586,23 kbps, fifo 4096
[13:28:51] mux: track 1, 18905 frames, 8007397 bytes, 158,83 kbps, fifo 8192
[13:28:51] Finished work at: Sat Sep 23 13:28:51 2023

[13:28:51] libhb: work result = 0

User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by s55 »

SVT-AV1 is not QuickSync. It's a software encoder only.
guiodic
Posts: 5
Joined: Sat Sep 23, 2023 11:23 am

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by guiodic »

intel_gpu_top shows an heavy use of "video" from HB. Average speed 248 fps.
I tried to reproduce it with ffmpeg and SVT but it's much slower.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by s55 »

SVT doesn't use the GPU at all so that's not what's driving it. It's maybe UI updates or something causing it to appear like load but no encoding is happening on your GPU. It simply doesn't support AV1
guiodic
Posts: 5
Joined: Sat Sep 23, 2023 11:23 am

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by guiodic »

p.s. ffmpeg with svt only 90 fps
guiodic
Posts: 5
Joined: Sat Sep 23, 2023 11:23 am

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by guiodic »

s55 wrote: Sat Sep 23, 2023 11:36 am SVT doesn't use the GPU at all so that's not what's driving it. It's maybe UI updates or something causing it to appear like load but no encoding is happening on your GPU. It simply doesn't support AV1
the gui shows SVT in facts, but the speed is more than double compared with system ffmpeg.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by s55 »

Different settings, or a problem with ffmpeg (or maybe it's built with an older version).

Speed can vary dramatically depending on settings used.

There is no magic in HandBrake.
guiodic
Posts: 5
Joined: Sat Sep 23, 2023 11:23 am

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by guiodic »

s55 wrote: Sat Sep 23, 2023 11:41 am Different settings,
How can I have the equivalent ffmpeg commandline used by handbrake?
or a problem with ffmpeg (or maybe it's built with an older version).
No, ffmpeg and svt on the system are much newer.
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Is HandBrake magic? It seems to encode AV1 with GPU on a Intel Xe (gen. 12)

Post by s55 »

>How can I have the equivalent ffmpeg commandline used by handbrake?

HandBrake doesn't use ffmpeg so doesn't generate said commands. You need to tell it to use the Ultrafast preset for SVT since that's what your using in HandBrake. I don't know the arguments for that off the top of my head.
Post Reply