HandBrake / HandBrake

HandBrake's main development repository
https://handbrake.fr
Other
17.5k stars 1.33k forks source link

HandBrakeCLI ERROR: Failure to initialise thread 'H.265/HEVC encoder (libx265)' #6122

Closed aztack closed 3 months ago

aztack commented 3 months ago

Problem Description

Run HandBrakeCli form command line with following parameter get an Failure to initialise thread 'H.265/HEVC encoder errors

Here is the command line:

./HandBrakeCLI --input=/Users/me/Desktop/videos/video_3.mp4 --output=/Users/me/Desktop/videos/video_3-compressed.mp4 --preset-import-file /Users/me/handbrake/presets/a.darwin.json --encoder=x265 --rate=60 --quality=60

Activity Log, Crash Log or any other details

[16:04:16] Compile-time hardening features are enabled
[16:04:16] hb_init: starting libhb thread
[16:04:16] thread 16d92b000 started ("libhb")
HandBrake 1.8.0 (2024052000) - Darwin arm64 - https://handbrake.fr
12 CPUs detected
Opening /Users/me/Desktop/videos/video_3.mp4...
[16:04:16] CPU: Apple M3 Pro
[16:04:16]  - logical processor count: 12
[16:04:16] hb_scan: path=/Users/me/Desktop/videos/video_3.mp4, title_index=1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/me/Desktop/videos/video_3.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.23.100
  Duration: 00:00:03.33, start: 0.000000, bitrate: 7778 kb/s
  Stream #0:0[0x1](eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1504x1632 [SAR 1:1 DAR 47:51], 7774 kb/s, 60 fps, 60 tbr, 15360 tbn (default)
      Metadata:
        handler_name    : Apple Video Media Handler
        vendor_id       : [0][0][0][0]
[16:04:16] scan: decoding previews for title 1
[16:04:16] using container PAR 1:1
[16:04:16] scan: 10 previews, 1504x1632, 60.000 fps, autocrop = 0/0/0/0, aspect 1:1.09, PAR 1:1, color profile: 1-1-1, chroma location: left
[16:04:16] libhb: scan thread found 1 valid title(s)
+ Using preset: AlphaPlayer
+ title 1:
  + stream: /Users/me/Desktop/videos/video_3.mp4
  + duration: 00:00:03
  + size: 1504x1632, pixel aspect: 1/1, display aspect: 0.92, 60.000 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: duration 00:00:03
  + audio tracks:
  + subtitle tracks:
[16:04:16] Starting work at: Tue Jun 11 16:04:16 2024

[16:04:16] 1 job(s) to process
[16:04:16] json job:
{
    "Audio": {
        "AudioList": [],
        "CopyMask": [],
        "FallbackEncoder": 0
    },
    "Destination": {
        "AlignAVStart": true,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 0,
                    "Seconds": 3,
                    "Ticks": 299999
                },
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "/Users/me/Desktop/videos/video_3-compressed.mp4",
        "InlineParameterSets": false,
        "Mux": "m4v",
        "Options": {
            "IpodAtom": false,
            "Optimize": false
        }
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 4,
                "Settings": {
                    "block-height": "16",
                    "block-thresh": "40",
                    "block-width": "16",
                    "filter-mode": "2",
                    "mode": "3",
                    "motion-thresh": "1",
                    "spatial-metric": "2",
                    "spatial-thresh": "1"
                }
            },
            {
                "ID": 6,
                "Settings": {
                    "mode": "7"
                }
            },
            {
                "ID": 11,
                "Settings": {
                    "mode": 2,
                    "rate": "27000000/450000"
                }
            },
            {
                "ID": 20,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 1080,
                    "width": 1504
                }
            }
        ]
    },
    "Metadata": {},
    "PAR": {
        "Den": 68,
        "Num": 45
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "HWDecode": 0,
        "Path": "/Users/me/Desktop/videos/video_3.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": "x265",
        "HardwareDecode": 0,
        "Level": "auto",
        "MultiPass": false,
        "Options": "",
        "Preset": "medium",
        "Profile": "auto",
        "QSV": {
            "AdapterIndex": 0,
            "AsyncDepth": 0,
            "Decode": false
        },
        "Quality": 60.0,
        "Tune": "",
        "Turbo": false
    }
}
[16:04:16] Starting Task: Encoding Pass
[16:04:16] job configuration:
[16:04:16]  * source
[16:04:16]    + /Users/me/Desktop/videos/video_3.mp4
[16:04:16]    + title 1, chapter(s) 1 to 1
[16:04:16]    + container: mov,mp4,m4a,3gp,3g2,mj2
[16:04:16]    + data rate: 7778 kbps
[16:04:16]  * destination
[16:04:16]    + /Users/me/Desktop/videos/video_3-compressed.mp4
[16:04:16]    + container: MPEG-4 (libavformat)
[16:04:16]      + align initial A/V stream timestamps
[16:04:16]  * video track
[16:04:16]    + decoder: h264 8-bit (yuv420p)
[16:04:16]      + bitrate 7774 kbps
[16:04:16]    + filters
[16:04:16]      + 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)
[16:04:16]      + Decomb (mode=39)
[16:04:16]      + Framerate Shaper (mode=2:rate=27000000/450000)
[16:04:16]        + frame rate: 60.000 fps -> peak rate limited to 60.000 fps
[16:04:16]      + Crop and Scale (width=1504:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[16:04:16]        + source: 1504 * 1632, crop (0/0/0/0): 1504 * 1632, scale: 1504 * 1080
[16:04:16]    + Output geometry
[16:04:16]      + storage dimensions: 1504 x 1080
[16:04:16]      + pixel aspect ratio: 45 : 68
[16:04:16]      + display dimensions: 995 x 1080
[16:04:16]    + encoder: H.265 (libx265)
[16:04:16]      + preset:  medium
[16:04:16]      + profile: auto
[16:04:16]      + level:   auto
[16:04:16]      + quality: 60.00 (RF)
[16:04:16]      + color profile: 1-1-1
[16:04:16]      + color range: tv
[16:04:16]      + chroma location: left
[16:04:16] sync: expecting 199 video frames
x265 [info]: HEVC encoder version 3.6+1-aa7f602f7
x265 [info]: build info [Mac OS X][clang 15.0.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: NEON
x265 [error]: Valid quality based range: -qpBDOffsetY to 51
ERROR: encx265: x265_encoder_open failed.
ERROR: Failure to initialise thread 'H.265/HEVC encoder (libx265)'
[16:04:16] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[16:04:16] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[16:04:16] vfr: lost time: 0 (0 frames)
[16:04:16] vfr: gained time: 0 (0 frames) (0 not accounted for)
[16:04:16] h264-decoder done: 0 frames, 0 decoder errors
[16:04:16] sync: got 0 frames, 199 expected
[16:04:16] Finished work at: Tue Jun 11 16:04:16 2024

[16:04:16] libhb: work result = 3

Encode failed (error 3).

Preset file

{
  "PresetList" : [
    {
      "AlignAVStart" : true,
      "AudioCopyMask" : [
        "copy:aac"
      ],
      "AudioEncoderFallback" : "ca_aac",
      "AudioLanguageList" : [

      ],
      "AudioList" : [
        {
          "AudioBitrate" : 160,
          "AudioCompressionLevel" : 0,
          "AudioDitherMethod" : "auto",
          "AudioEncoder" : "ca_aac",
          "AudioMixdown" : "stereo",
          "AudioNormalizeMixLevel" : false,
          "AudioSamplerate" : "auto",
          "AudioTrackDRCSlider" : 0,
          "AudioTrackGainSlider" : 0,
          "AudioTrackQuality" : -1,
          "AudioTrackQualityEnable" : false
        }
      ],
      "AudioSecondaryEncoderMode" : true,
      "AudioTrackSelectionBehavior" : "first",
      "ChapterMarkers" : true,
      "ChildrenArray" : [],
      "Default" : true,
      "FileFormat" : "av_mp4",
      "Folder" : false,
      "FolderOpen" : false,
      "InlineParameterSets" : false,
      "MetadataPassthrough" : true,
      "Mp4iPodCompatible" : false,
      "Optimize" : false,
      "PictureAllowUpscaling" : false,
      "PictureAutoCrop" : true,
      "PictureBottomCrop" : 0,
      "PictureChromaSmoothCustom" : "",
      "PictureChromaSmoothPreset" : "off",
      "PictureChromaSmoothTune" : "none",
      "PictureColorspaceCustom" : "",
      "PictureColorspacePreset" : "off",
      "PictureCombDetectCustom" : "",
      "PictureCombDetectPreset" : "default",
      "PictureCropMode" : 2,
      "PictureDARWidth" : 995,
      "PictureDeblockCustom" : "strength=strong:thresh=20:blocksize=8",
      "PictureDeblockPreset" : "off",
      "PictureDeblockTune" : "medium",
      "PictureDeinterlaceCustom" : "",
      "PictureDeinterlaceFilter" : "decomb",
      "PictureDeinterlacePreset" : "default",
      "PictureDenoiseCustom" : "",
      "PictureDenoiseFilter" : "off",
      "PictureDenoisePreset" : "light",
      "PictureDenoiseTune" : "none",
      "PictureDetelecine" : "off",
      "PictureDetelecineCustom" : "",
      "PictureForceHeight" : 0,
      "PictureForceWidth" : 0,
      "PictureHeight" : 1080,
      "PictureItuPAR" : false,
      "PictureKeepRatio" : true,
      "PictureLeftCrop" : 0,
      "PictureModulus" : 2,
      "PicturePadBottom" : 0,
      "PicturePadColor" : "black",
      "PicturePadLeft" : 0,
      "PicturePadMode" : "none",
      "PicturePadRight" : 0,
      "PicturePadTop" : 0,
      "PicturePAR" : "auto",
      "PictureRightCrop" : 0,
      "PictureRotate" : "angle=0:hflip=0",
      "PictureSharpenCustom" : "",
      "PictureSharpenFilter" : "off",
      "PictureSharpenPreset" : "medium",
      "PictureSharpenTune" : "none",
      "PictureTopCrop" : 0,
      "PictureUseMaximumSize" : true,
      "PictureWidth" : 1920,
      "PresetDescription" : "",
      "PresetDisabled" : false,
      "PresetName" : "AlphaPlayer",
      "SubtitleAddCC" : false,
      "SubtitleAddForeignAudioSearch" : true,
      "SubtitleAddForeignAudioSubtitle" : false,
      "SubtitleBurnBDSub" : true,
      "SubtitleBurnBehavior" : "foreign",
      "SubtitleBurnDVDSub" : true,
      "SubtitleLanguageList" : [

      ],
      "SubtitleTrackSelectionBehavior" : "none",
      "Type" : 1,
      "UsesPictureFilters" : true,
      "VideoAvgBitrate" : 1500,
      "VideoColorMatrixCodeOverride" : 0,
      "VideoEncoder" : "x265",
      "VideoFramerate" : "60",
      "VideoFramerateMode" : "pfr",
      "VideoGrayScale" : false,
      "VideoHWDecode" : 0,
      "VideoLevel" : "auto",
      "VideoMultiPass" : false,
      "VideoOptionExtra" : "",
      "VideoPreset" : "medium",
      "VideoProfile" : "auto",
      "VideoQSVDecode" : false,
      "VideoQualitySlider" : 22,
      "VideoQualityType" : 1,
      "VideoScaler" : "swscale",
      "VideoTune" : "",
      "VideoTurboMultiPass" : true,
      "x264Option" : "",
      "x264UseAdvancedOptions" : false
    }
  ],
  "VersionMajor" : 56,
  "VersionMicro" : 0,
  "VersionMinor" : 0
}

What Operating System are you running?

MacOS Sonama 14.5 (23F79)

What version of HandBrake are you running?

HandBrake 1.8.0 (2024052000) - Darwin arm64

Where did you download HandBrake from?

Github Release Page

galad87 commented 3 months ago

The quality value is out of bounds, x265 range is from 51 to 0.