jlesage / docker-handbrake

Docker container for HandBrake
MIT License
848 stars 97 forks source link

Synology strange QSV behaviour #248

Open slanglade opened 1 year ago

slanglade commented 1 year ago

Hi,

I've got a DS220+ with a celeron J4025. It is supposed to support hardware encoding of H264 and H265.

First of all, every time an encoding task starts, it reports full support for QSV :

[10:39:44] CPU: Intel(R) Celeron(R) J4025 CPU @ 2.00GHz
[10:39:44]  - logical processor count: 2
[10:39:44] Intel Quick Sync Video support: yes
[10:39:44]  - Intel Media SDK hardware: API 1.35 (minimum: 1.3)
[10:39:44]  - Decode support:  h264 hevc (8bit: yes, 10bit: yes) av1 (8bit: yes, 10bit: yes)
[10:39:44]  - H.264 encoder: yes
[10:39:44]     - preferred implementation: hardware (any) via ANY
[10:39:44]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[10:39:44]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[10:39:44]     - preferred implementation: hardware (any) via ANY
[10:39:44]     - capabilities (hardware):  lowpower bpyramid icq vsinfo opt1

The sample source movie is encoded like this (but the behaviour is the same with all video source I tried) :

ID                                       : 0
Format                                   : MPEG-4 Visual
Paramètres du format                     : BVOP1
Paramètres du format, BVOP               : 1
Paramètres du format, QPel               : Non
Paramètres du format, GMC                : Pas de warppoints
Paramètres du format, Matrice            : Default (H.263)
Type de muxing                           : Packed bitstream
Identifiant du codec                     : DX50
Identifiant du codec/Suggestion          : DivX 5
Durée                                    : 4 min 30s
Débit                                    : 1 011 kb/s
Débit nominal                            : 4 854 kb/s
Largeur                                  : 576 pixels
Hauteur                                  : 320 pixels
Format à l'écran                         : 16/9
Images par seconde                       : 25,000 Im/s
Espace de couleurs                       : YUV
Sous-échantillonnage de la chrominance   : 4:2:0
Profondeur des couleurs                  : 8 bits
Type de balayage                         : Progressif
Mode de compression                      : Avec perte
Bits/(Pixel*Image)                       : 0.219
Taille du flux                           : 32,6 Mio (88%)
Bibliothèque utilisée                    : DivX 6.8.0 (UTC 2007-12-04)

Only H264 constant qualiy or single pass constant bitrate are working. If I try, with the very same source movie, I get :

More details follows :

H264 constant bitrate with 2 passes

The first pass works ok, but the second pass fails with the container failing and restarting image The encoding part in the logs is

[10:50:44] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[10:50:44] encqsvInit: using encode-only path
[10:50:44] encqsvInit: H.264/AVC High profile @ level 3.0
[10:50:44] encqsvInit: TargetUsage 4 AsyncDepth 6
[10:50:44] encqsvInit: GopRefDist 3 GopPicSize 25 NumRefFrame 1
[10:50:44] encqsvInit: BFramesMax 2 BRefType off
[10:50:44] Unknown Header.BufferId=1347637059
[10:50:44] encqsvInit: RateControlMethod VBR TargetKbps 6000 MaxKbps 9000 BufferSizeInKB 1875 InitialDelayInKB 937 BRCParamMultiplier 1
[10:50:44] encqsvInit: MBBRC on
[10:50:44] sync: first pts video is 0
[10:50:44] sync: Chapter 1 at frame 1 time 0
[10:50:44] sync: first pts audio 0x1 is 0
[10:50:44] qsv_enc_init: using 'hardware (1) via VAAPI' implementation, API: 1.35
[10:51:28] reader: done. 1 scr changes
[10:51:28] work: average encoding speed for job is 153.674149 fps
[10:51:28] comb detect: heavy 27 | light 244 | uncombed 6503 | total 6774
[10:51:28] decomb: deinterlaced 27 | blended 244 | unfiltered 6503 | total 6774
[10:51:28] vfr: 6774 frames output, 0 dropped and 0 duped for CFR/PFR
[10:51:28] vfr: lost time: 0 (0 frames)
[10:51:28] vfr: gained time: 0 (0 frames) (0 not accounted for)
[10:51:28] mp3float-decoder done: 11290 frames, 0 decoder errors
[10:51:28] mpeg4-decoder done: 6774 frames, 0 decoder errors
[10:51:28] sync: got 6774 frames, 6774 expected
[10:51:28] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps
[10:51:28] Starting Task: Encoding Pass
[10:51:28] Skipping crop/scale filter
[10:51:28] job configuration:
[10:51:28]  * source
[10:51:28]    + /storage/Films/***.avi
[10:51:28]    + title 1, chapter(s) 1 to 1
[10:51:28]    + container: avi
[10:51:28]    + data rate: 1148 kbps
[10:51:28]  * destination
[10:51:28]    + /output/***.m4v
[10:51:28]    + container: MPEG-4 (libavformat)
[10:51:28]      + align initial A/V stream timestamps
[10:51:28]  * video track
[10:51:28]    + decoder: mpeg4 8-bit (yuv420p)
[10:51:28]      + bitrate 1010 kbps
[10:51:28]    + filters
[10:51:28]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[10:51:28]      + Decomb (mode=39)
[10:51:28]      + Framerate Shaper (mode=2:rate=27000000/900000)
[10:51:28]        + frame rate: 25.000 fps -> peak rate limited to 30.000 fps
[10:51:28]    + Output geometry
[10:51:28]      + storage dimensions: 576 x 320
[10:51:28]      + pixel aspect ratio: 1 : 1
[10:51:28]      + display dimensions: 576 x 320
[10:51:28]    + encoder: H.264 (Intel Media SDK)
[10:51:28]      + preset:  balanced
[10:51:28]      + profile: auto
[10:51:28]      + level:   auto
[10:51:28]      + bitrate: 6000 kbps, pass: 2
[10:51:28]      + color profile: 5-1-6
[10:51:28]      + chroma location: left
[10:51:28]  * audio track 1
[10:51:28]    + decoder: Unknown (MP3) (2.0 ch) (128 kbps) (track 1, id 0x1)
[10:51:28]      + bitrate: 128 kbps, samplerate: 48000 Hz
[10:51:28]    + mixdown: Stereo
[10:51:28]    + encoder: AAC (libfdk_aac)
[10:51:28]      + bitrate: 160 kbps, samplerate: 48000 Hz
[10:51:28] sync: expecting 6774 video frames
[10:51:28] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[10:51:28] encqsvInit: using encode-only path
[10:51:28] encqsvInit: H.264/AVC High profile @ level 3.0
[10:51:28] encqsvInit: TargetUsage 4 AsyncDepth 6
[10:51:28] encqsvInit: GopRefDist 3 GopPicSize 25 NumRefFrame 1
[10:51:28] encqsvInit: BFramesMax 2 BRefType off
[10:51:28] Unknown Header.BufferId=1347637059
[10:51:28] encqsvInit: RateControlMethod VBR TargetKbps 6000 MaxKbps 9000 BufferSizeInKB 1875 InitialDelayInKB 937 BRCParamMultiplier 1
[10:51:28] encqsvInit: MBBRC on
[10:51:28] sync: first pts video is 0
[10:51:28] sync: Chapter 1 at frame 1 time 0
[10:51:28] sync: first pts audio 0x1 is 0
[10:51:28] qsv_enc_init: MFXVideoENCODE_Init failed (-16)
[10:51:28] work: average encoding speed for job is 0.000000 fps
[10:51:28] comb detect: heavy 0 | light 0 | uncombed 20 | total 20
[10:51:28] decomb: deinterlaced 0 | blended 0 | unfiltered 16 | total 16
[10:51:28] vfr: 12 frames output, 0 dropped and 0 duped for CFR/PFR
[10:51:28] vfr: lost time: 0 (0 frames)
[10:51:28] vfr: gained time: 0 (0 frames) (0 not accounted for)
[10:51:29] mp3float-decoder done: 106 frames, 0 decoder errors
[10:51:29] mpeg4-decoder done: 50 frames, 0 decoder errors
[10:51:29] sync: got 21 frames, 6774 expected
[10:51:29] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps

H265, any quality / bitrate / passes combination

The job fails when starting (but no container restart): image

[11:05:57] job configuration:
[11:05:57]  * source
[11:05:57]    + /storage/***.avi
[11:05:57]    + title 1, chapter(s) 1 to 1
[11:05:57]    + container: avi
[11:05:57]    + data rate: 1148 kbps
[11:05:57]  * destination
[11:05:57]    + /output/***.m4v
[11:05:57]    + container: MPEG-4 (libavformat)
[11:05:57]      + align initial A/V stream timestamps
[11:05:57]  * video track
[11:05:57]    + decoder: mpeg4 8-bit (yuv420p)
[11:05:57]      + bitrate 1010 kbps
[11:05:57]    + filters
[11:05:57]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[11:05:57]      + Decomb (mode=39)
[11:05:57]      + Framerate Shaper (mode=2:rate=27000000/900000)
[11:05:57]        + frame rate: 25.000 fps -> peak rate limited to 30.000 fps
[11:05:57]    + Output geometry
[11:05:57]      + storage dimensions: 576 x 320
[11:05:57]      + pixel aspect ratio: 1 : 1
[11:05:57]      + display dimensions: 576 x 320
[11:05:57]    + encoder: H.265 (Intel Media SDK)
[11:05:57]      + preset:  balanced
[11:05:57]      + profile: auto
[11:05:57]      + level:   auto
[11:05:57]      + quality: 16.00 (ICQ)
[11:05:57]      + color profile: 5-1-6
[11:05:57]      + chroma location: left
[11:05:57]  * audio track 1
[11:05:57]    + decoder: Unknown (MP3) (2.0 ch) (128 kbps) (track 1, id 0x1)
[11:05:57]      + bitrate: 128 kbps, samplerate: 48000 Hz
[11:05:57]    + mixdown: Stereo
[11:05:57]    + encoder: AAC (libfdk_aac)
[11:05:57]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:05:57] sync: expecting 6774 video frames
[11:05:57] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[11:05:57] encqsvInit: MFXVideoENCODE_Init failed (-3)
[11:05:57] encqsvInit: using encode-only (LowPower) path
[11:05:57] encqsvInit: H.265/HEVC (null) profile @ level (null)
[11:05:57] encqsvInit: TargetUsage 4 AsyncDepth 6
[11:05:57] encqsvInit: GopRefDist 3 GopPicSize 25 NumRefFrame 1
[11:05:57] encqsvInit: BFramesMax 2 BRefType off
[11:05:57] encqsvInit: RateControlMethod ICQ ICQQuality 16
[11:05:57] Failure to initialise thread 'Quick Sync Video encoder (Intel Media SDK)'
[11:05:57] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[11:05:57] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[11:05:57] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[11:05:57] vfr: lost time: 0 (0 frames)
[11:05:57] vfr: gained time: 0 (0 frames) (0 not accounted for)
[11:05:57] mp3float-decoder done: 0 frames, 0 decoder errors
[11:05:57] mpeg4-decoder done: 0 frames, 0 decoder errors
[11:05:57] sync: got 0 frames, 6774 expected
[11:05:57] Finished work at: Wed Feb 22 11:05:57 2023
jlesage commented 1 year ago

Can you try the latest image to see if it's better ?

khromov commented 1 year ago

I just tried this on 1.6.1 (h265 QSV, VBR 2-pass encoding, 6000kbps bitrate) and I have exactly the same problem. I also have a Synology with a slightly different CPU: J4125. I am also using the lowpower=0 workaround, otherwise the encoding doesn't start at all:

Screenshot 2023-02-27 at 13 30 25

Example log:

[12:23:45] 1 job(s) to process
[12:23:45] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "fdk_aac",
                "Gain": 0.0,
                "Mixdown": "stereo",
                "NormalizeMixLevel": false,
                "PresetEncoder": "fdk_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "fdk_aac"
    },
    "Destination": {
        "AlignAVStart": false,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 0,
                    "Seconds": 12,
                    "Ticks": 1126800
                },
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "/output/MVI_0103 (1).mkv",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "mkv"
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 7,
                "Settings": {
                    "mode": 1
                }
            },
            {
                "ID": 14,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 1080,
                    "width": 1920
                }
            }
        ]
    },
    "Metadata": {
        "Name": "MVI_0103"
    },
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/storage/Haystack/MVI_0103.MOV",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "Bitrate": 6000,
        "ChromaLocation": 1,
        "ColorInputFormat": 0,
        "ColorMatrix": 1,
        "ColorOutputFormat": 0,
        "ColorPrimaries": 1,
        "ColorRange": 2,
        "ColorTransfer": 1,
        "Encoder": "qsv_h265",
        "HardwareDecode": 0,
        "Level": "auto",
        "Options": "lowpower=0",
        "Preset": "balanced",
        "Profile": "auto",
        "QSV": {
            "AdapterIndex": 0,
            "AsyncDepth": 0,
            "Decode": false
        },
        "Tune": "",
        "Turbo": false,
        "TwoPass": true
    }
}
[12:23:45] CPU: Intel(R) Celeron(R) J4125 CPU @ 2.00GHz
[12:23:45]  - logical processor count: 4
[12:23:45] Intel Quick Sync Video support: yes
[12:23:45] Intel Quick Sync Video integrated adapter with index 0
[12:23:45] Impl mfxhw64 library path: /opt/intel/mediasdk/lib/libmfxhw64.so.1.35
[12:23:45]  - Intel Media SDK hardware: API 1.35 (minimum: 1.3)
[12:23:45]  - Decode support:  h264 hevc (8bit: yes, 10bit: yes) av1 (8bit: yes, 10bit: yes)
[12:23:45]  - H.264 encoder: yes
[12:23:45]     - preferred implementation: hardware (any) via ANY
[12:23:45]     - capabilities (hardware):  lowpower breftype icq+la+i+downs vsinfo chromalocinfo opt1 opt2+mbbrc+extbrc+trellis+repeatpps+ib_adapt+nmpslice
[12:23:45]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[12:23:45]     - preferred implementation: hardware (any) via ANY
[12:23:45]     - capabilities (hardware):  lowpower bpyramid icq vsinfo masteringinfo cllinfo opt1
[12:23:45]  - AV1 encoder: no
[12:23:45] hb_scan: path=/storage/Haystack/MVI_0103.MOV, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /storage/Haystack/MVI_0103.MOV
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
[12:23:45] 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
[12:23:45] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/Haystack/MVI_0103.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    com.apple.quicktime.make: Canon
    com.apple.quicktime.model: Canon EOS 700D
    com.apple.quicktime.rating.user: 0.000000
    creation_time   : 2023-01-19T19:54:14.000000Z
  Duration: 00:00:12.52, start: 0.000000, bitrate: 45348 kb/s
  Stream #0:0[0x1](eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, 43728 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2023-01-19T19:54:14.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2023-01-19T19:54:14.000000Z
      vendor_id       : [0][0][0][0]
[12:23:45] scan: decoding previews for title 1
[12:23:45] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 English (pcm_s16le) (2.0 ch) (1536 kbps)
[12:23:46] scan: 10 previews, 1920x1080, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[12:23:46] scan: supported video decoders: avcodec qsv
[12:23:46] libhb: scan thread found 1 valid title(s)
[12:23:46] Starting Task: Analysis Pass
[12:23:46] Skipping crop/scale filter
[12:23:46] job configuration:
[12:23:46]  * source
[12:23:46]    + /storage/Haystack/MVI_0103.MOV
[12:23:46]    + title 1, chapter(s) 1 to 1
[12:23:46]    + container: mov,mp4,m4a,3gp,3g2,mj2
[12:23:46]    + data rate: 45348 kbps
[12:23:46]  * destination
[12:23:46]    + /output/MVI_0103 (1).mkv
[12:23:46]    + container: Matroska (libavformat)
[12:23:46]  * video track
[12:23:46]    + decoder: h264 8-bit (yuv420p)
[12:23:46]      + bitrate 43728 kbps
[12:23:46]    + filters
[12:23:46]      + Framerate Shaper (mode=1)
[12:23:46]        + frame rate: 25.000 fps -> constant 25.000 fps
[12:23:46]      + Format (format=nv12)
[12:23:46]    + Output geometry
[12:23:46]      + storage dimensions: 1920 x 1080
[12:23:46]      + pixel aspect ratio: 1 : 1
[12:23:46]      + display dimensions: 1920 x 1080
[12:23:46]    + encoder: H.265 (Intel Media SDK)
[12:23:46]      + preset:  balanced
[12:23:46]      + options: lowpower=0
[12:23:46]      + profile: auto
[12:23:46]      + level:   auto
[12:23:46]      + bitrate: 6000 kbps, pass: 1
[12:23:46]      + color profile: 1-1-1
[12:23:46]      + chroma location: left
[12:23:46]  * audio track 1
[12:23:46]    + decoder: English (pcm_s16le) (2.0 ch) (1536 kbps) (track 1, id 0x1)
[12:23:46]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[12:23:46]    + mixdown: Stereo
[12:23:46]    + encoder: AAC (libfdk_aac)
[12:23:46]      + bitrate: 160 kbps, samplerate: 48000 Hz
[12:23:46] sync: expecting 313 video frames
[12:23:46] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.17.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[12:23:46] encqsvInit: using encode-only path
[12:23:46] encqsvInit: H.265/HEVC Main profile @ level 4.0
[12:23:46] encqsvInit: TargetUsage 4 AsyncDepth 6
[12:23:46] encqsvInit: GopRefDist 8 GopPicSize 32 NumRefFrame 4 IdrInterval 0
[12:23:46] encqsvInit: BFramesMax 7 BRefType pyramid
[12:23:46] encqsvInit: RateControlMethod VBR TargetKbps 6000 MaxKbps 6000 BufferSizeInKB 1500 InitialDelayInKB 750 BRCParamMultiplier 1
[12:23:46] sync: first pts video is 0
[12:23:46] sync: Chapter 1 at frame 1 time 0
[12:23:46] sync: first pts audio 0x1 is 0
[12:23:47] qsv_enc_init: using 'hardware (1) via VAAPI' implementation, API: 1.35
[12:23:54] reader: done. 1 scr changes
[12:23:57] work: average encoding speed for job is 32.325069 fps
[12:23:58] vfr: 313 frames output, 0 dropped and 0 duped for CFR/PFR
[12:23:58] vfr: lost time: 0 (0 frames)
[12:23:58] vfr: gained time: 0 (0 frames) (0 not accounted for)
[12:23:58] pcm_s16le-decoder done: 587 frames, 0 decoder errors
[12:23:58] h264-decoder done: 313 frames, 0 decoder errors
[12:23:58] sync: got 313 frames, 313 expected
[12:23:58] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps
[12:23:58] Starting Task: Encoding Pass
[12:23:58] Skipping crop/scale filter
[12:23:58] job configuration:
[12:23:58]  * source
[12:23:58]    + /storage/Haystack/MVI_0103.MOV
[12:23:58]    + title 1, chapter(s) 1 to 1
[12:23:58]    + container: mov,mp4,m4a,3gp,3g2,mj2
[12:23:58]    + data rate: 45348 kbps
[12:23:58]  * destination
[12:23:58]    + /output/MVI_0103 (1).mkv
[12:23:58]    + container: Matroska (libavformat)
[12:23:58]  * video track
[12:23:58]    + decoder: h264 8-bit (yuv420p)
[12:23:58]      + bitrate 43728 kbps
[12:23:58]    + filters
[12:23:58]      + Framerate Shaper (mode=1)
[12:23:58]        + frame rate: 25.000 fps -> constant 25.000 fps
[12:23:58]      + Format (format=nv12)
[12:23:58]    + Output geometry
[12:23:58]      + storage dimensions: 1920 x 1080
[12:23:58]      + pixel aspect ratio: 1 : 1
[12:23:58]      + display dimensions: 1920 x 1080
[12:23:58]    + encoder: H.265 (Intel Media SDK)
[12:23:58]      + preset:  balanced
[12:23:58]      + options: lowpower=0
[12:23:58]      + profile: auto
[12:23:58]      + level:   auto
[12:23:58]      + bitrate: 6000 kbps, pass: 2
[12:23:58]      + color profile: 1-1-1
[12:23:58]      + chroma location: left
[12:23:58]  * audio track 1
[12:23:58]    + decoder: English (pcm_s16le) (2.0 ch) (1536 kbps) (track 1, id 0x1)
[12:23:58]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[12:23:58]    + mixdown: Stereo
[12:23:58]    + encoder: AAC (libfdk_aac)
[12:23:58]      + bitrate: 160 kbps, samplerate: 48000 Hz
[12:23:58] sync: expecting 313 video frames
[12:23:58] hb_display_init: using VA driver 'iHD'
libva info: VA-API version 1.17.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
[12:23:58] encqsvInit: using encode-only path
[12:23:58] encqsvInit: H.265/HEVC Main profile @ level 4.0
[12:23:58] encqsvInit: TargetUsage 4 AsyncDepth 6
[12:23:58] encqsvInit: GopRefDist 8 GopPicSize 32 NumRefFrame 4 IdrInterval 0
[12:23:58] encqsvInit: BFramesMax 7 BRefType pyramid
[12:23:58] encqsvInit: RateControlMethod VBR TargetKbps 6000 MaxKbps 6000 BufferSizeInKB 1500 InitialDelayInKB 750 BRCParamMultiplier 1
[12:23:58] sync: first pts video is 0
[12:23:58] sync: Chapter 1 at frame 1 time 0
[12:23:58] sync: first pts audio 0x1 is 0
[12:23:58] qsv_enc_init: MFXVideoENCODE_Init failed (-16)
[12:23:58] work: average encoding speed for job is 0.000000 fps
[12:23:58] vfr: 12 frames output, 0 dropped and 0 duped for CFR/PFR
[12:23:58] vfr: lost time: 0 (0 frames)
[12:23:58] vfr: gained time: 0 (0 frames) (0 not accounted for)
[12:23:58] pcm_s16le-decoder done: 135 frames, 0 decoder errors
[12:23:58] h264-decoder done: 48 frames, 0 decoder errors
[12:23:58] sync: got 16 frames, 313 expected
[12:23:58] sync: framerate min 25.000 fps, max 25.000 fps, avg 25.000 fps
[12:23:58] mux: track 0, 0 frames, 0 bytes, 0.00 kbps, fifo 8
[12:23:58] mux: track 1, 29 frames, 12905 bytes, 172.07 kbps, fifo 32
[12:23:59] Finished work at: Mon Feb 27 12:23:59 2023

[12:23:59] libhb: work result = 3
slanglade commented 1 year ago

Hi,

Latest version can't use QSV anymore for me : h264 single pass is now failing with "MFXVideoEncode_init failed (-15)". If I remove the container and the latest image, and recreate using v1.25.1 image, it works again.

Two side notes :

Is there a way to have a more verbose output for the intel drive part ?

jlesage commented 1 year ago

I am also using the lowpower=0 workaround, otherwise the encoding doesn't start at all

Yeah, it seems that the workaround might still be needed.

Note that HandBrake 1.6 still has issues with QSV:

https://github.com/HandBrake/HandBrake/issues/4768

jlesage commented 1 year ago

Latest version can't use QSV anymore for me : h264 single pass is now failing with "MFXVideoEncode_init failed (-15)". If I remove the container and the latest image, and recreate using v1.25.1 image, it works again.

You are not alone, see the issue I linked in my previous comment.

the new control tab on the left + full size UI is great !

Thanks! It's always appreciated to have positive feedback !

for a strange reason, I have to change my group_id from 100 ('users' on DSM 7.1) to 101 (admin) when trying the latest image. Otherwise it fails with a strange "grp100 doesn't exists". It looks like it doesn't like me speciying the same group id that is uses by default. Again, no problem with v1.25.1

This will be fixed in next version of the image.

slanglade commented 1 year ago

Sorry for the delay. Indeed the QSV status for handbrake (particulary on older CPU version) seems to be cahotic.

After upgrading to latest image, I did the following :

I can then encode using h264 or h265, single pass only. If I try two passes, the container crash and reboot instantly when the second pass starts.

Edit: in fact, the i915 config file is totally useless. The dmesg still show messages stating "no huc or guc firmware", so I guess we're stuck with lowpower=0 ?

So Iet's wait for a better Handbrake release regarding this problem.

PS : no more problem with "group_id=100" !