Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD VCN h.265 and AV1 option preanalysis=1 fails #5794

Open
SKECHER9 opened this issue Feb 20, 2024 · 3 comments
Open

AMD VCN h.265 and AV1 option preanalysis=1 fails #5794

SKECHER9 opened this issue Feb 20, 2024 · 3 comments
Labels

Comments

@SKECHER9
Copy link

Problem Description

Seems something might be misconfigured, docs say at least one of these should work.
[av1_amf @ 00000179800742c0] encoder->Init() failed with error 4
[08:54:33] encavcodecInit: avcodec_open failed
Failure to initialise thread 'FFMPEG encoder (libavcodec)'

Activity Log, Crash Log or any other details

HandBrake 1.7.3 (2024021000)
OS: Microsoft Windows NT 10.0.19045.0
CPU: AMD Ryzen 9 5900X 12-Core Processor            
Ram: 65461 MB, 
GPU Information:
  AMD Radeon RX 7900 XTX - 31.0.24002.92
Screen: 1920x1080
Temp Dir: C:\Users\user\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake\
Data Dir: C:\Users\user\AppData\Roaming\HandBrake

-------------------------------------------

 # Starting Encode ...

[08:54:31] base preset: Fast 1080p30 (Modified)
[08:54:31] Remote Process started with Process ID: 18172 using port: 8038. Max Allowed Instances: 4
[08:54:31] Worker: Starting HandBrake Engine ...
[08:54:31] Worker: Parent Process Id 11064
[08:54:31] Worker: Starting Web Server on port 8038 ...
[08:54:31] Worker: Starting Listener: 1
[08:54:31] Worker: Server Started
[08:54:32] Worker: Disconnected worker monitoring enabled!
[08:54:32] Compile-time hardening features are enabled
Cannot load nvEncodeAPI64.dll
[08:54:32] vcn: is available
[08:54:32] qsv: not available on this system
[08:54:32] hb_init: starting libhb thread
[08:54:32] Starting work at: Tue Feb 20 08:54:32 2024
[08:54:32] 1 job(s) to process
[08:54:32] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0,
        "Encoder": "av_aac",
        "Gain": 0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Name": "Surround 5.1",
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac"
    ],
    "FallbackEncoder": "av_aac"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      },
      {
        "Name": "Chapter 2"
      },
      {
        "Name": "Chapter 3"
      },
      {
        "Name": "Chapter 4"
      },
      {
        "Name": "Chapter 5"
      },
      {
        "Name": "Chapter 6"
      },
      {
        "Name": "Chapter 7"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "I:\\Videos\\Examplepreanalysis1.mkv",
    "Options": {
      "IpodAtom": false,
      "Optimize": false
    },
    "Mux": "av_mkv"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 19,
        "Settings": {
          "crop-bottom": "22",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "22",
          "height": "1036",
          "width": "1920"
        }
      },
      {
        "ID": 10,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {
    "Name": "Mirai"
  },
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 7
    },
    "Title": 1,
    "Path": "C:\\Users\\user\\Videos\\example.mkv",
    "HWDecode": 4
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "vce_av1",
    "Level": "auto",
    "MultiPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "preanalysis=1",
    "Preset": "quality",
    "Profile": "main",
    "Quality": 22,
    "QSV": {
      "Decode": false
    },
    "HardwareDecode": 0
  }
}
[08:54:32] CPU: Unknown
[08:54:32]  - logical processor count: 24
[08:54:32] Intel Quick Sync Video support: no
[08:54:32] hb_scan: path=C:\Users\user\Videos\example.mkv, title_index=1
Input #0, matroska,webm, from 'C:\Users\user\Videos\example.mkv':
  Metadata:
    title           : Mirai
    encoder         : libmakemkv v1.17.5 (1.3.10/1.5.2) win(x64-release)
    creation_time   : 2024-02-17T19:45:18.000000Z
  Duration: 00:06:21.76, start: 0.000000, bitrate: 19589 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 48.048000
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 48.048000, end 138.721917
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 138.721917, end 239.197292
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 239.197292, end 278.111167
      Metadata:
        title           : Chapter 04
    Chapter #0:4: start 278.111167, end 314.689375
      Metadata:
        title           : Chapter 05
    Chapter #0:5: start 314.689375, end 350.558542
      Metadata:
        title           : Chapter 06
    Chapter #0:6: start 350.558542, end 381.756375
      Metadata:
        title           : Chapter 07
  Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
    Metadata:
      BPS-eng         : 14222891
      DURATION-eng    : 00:06:21.756375000
      NUMBER_OF_FRAMES-eng: 9153
      NUMBER_OF_BYTES-eng: 678709250
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.5 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-02-17 19:45:18
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:1(mul): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s32p (24 bit) (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 3850951
      DURATION-eng    : 00:06:21.760000000
      NUMBER_OF_FRAMES-eng: 35790
      NUMBER_OF_BYTES-eng: 183767384
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.5 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-02-17 19:45:18
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:2(mul): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 1509000
      DURATION-eng    : 00:06:21.760000000
      NUMBER_OF_FRAMES-eng: 35790
      NUMBER_OF_BYTES-eng: 72009480
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.5 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-02-17 19:45:18
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 10045
      DURATION-eng    : 00:01:18.849604166
      NUMBER_OF_FRAMES-eng: 16
      NUMBER_OF_BYTES-eng: 99012
      SOURCE_ID-eng   : 001200
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.5 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2024-02-17 19:45:18
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[08:54:32] scan: decoding previews for title 1
[AVHWDeviceContext @ 0000017981400c40] Cannot load nvcuda.dll
[AVHWDeviceContext @ 0000017981400c40] Could not dynamically load CUDA
hwaccel: failed to create hwdevice
[08:54:32] scan: audio 0x1: dca, rate=48000Hz, bitrate=1 Unknown (DTS-HD MA, 5.1 ch)
[08:54:32] scan: audio 0x2: dca, rate=48000Hz, bitrate=1536000 Unknown (DTS, 5.1 ch, 1536 kbps)
[08:54:32] using container PAR 1:1
[08:54:32] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 22/22/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[08:54:33] libhb: scan thread found 1 valid title(s)
[08:54:33] Skipping subtitle scan.  No suitable subtitle tracks.
[08:54:33] Starting Task: Encoding Pass
[08:54:33] work: track 1, dithering not supported by codec
[08:54:33] job configuration:
[08:54:33]  * source
[08:54:33]    + C:\Users\user\Videos\example.mkv
[08:54:33]    + title 1, chapter(s) 1 to 7
[08:54:33]    + container: matroska,webm
[08:54:33]    + data rate: 19589 kbps
[08:54:33]  * destination
[08:54:33]    + I:\Videos\Examplepreanalysis1.mkv
[08:54:33]    + container: Matroska (libavformat)
[08:54:33]      + chapter markers
[08:54:33]  * video track
[08:54:33]    + decoder: h264 8-bit (yuv420p)
[08:54:33]    + filters
[08:54:33]      + Framerate Shaper (mode=0)
[08:54:33]        + frame rate: same as source (around 23.976 fps)
[08:54:33]      + Crop and Scale (width=1920:height=1036:crop-top=22:crop-bottom=22:crop-left=0:crop-right=0)
[08:54:33]        + source: 1920 * 1080, crop (22/22/0/0): 1920 * 1036, scale: 1920 * 1036
[08:54:33]    + Output geometry
[08:54:33]      + storage dimensions: 1920 x 1036
[08:54:33]      + pixel aspect ratio: 1 : 1
[08:54:33]      + display dimensions: 1920 x 1036
[08:54:33]    + encoder: AV1 (AMD VCE)
[08:54:33]      + preset:  quality
[08:54:33]      + options: preanalysis=1
[08:54:33]      + profile: main
[08:54:33]      + level:   auto
[08:54:33]      + quality: 22.00 (CQ)
[08:54:33]      + color profile: 1-1-1
[08:54:33]      + chroma location: left
[08:54:33]  * audio track 1
[08:54:33]    + name: Surround 5.1
[08:54:33]    + decoder: Unknown (DTS-HD MA, 5.1 ch) (track 1, id 0x1)
[08:54:33]      + samplerate: 48000 Hz
[08:54:33]    + mixdown: Stereo
[08:54:33]    + encoder: AAC (libavcodec)
[08:54:33]      + bitrate: 160 kbps, samplerate: 48000 Hz
[08:54:33] sync: expecting 9152 video frames
[08:54:33] encavcodecInit: AV1 (AMD VCE)
[08:54:33] encavcodec: encoding at CQ 22.00
[08:54:33] encavcodec: QP (I)   22.00
[08:54:33] encavcodec: QP (P)   27.50
[08:54:33] encavcodec: QP (B)   33.00
[08:54:33] encavcodec: GOP Size 47
[08:54:33] encavcodec: encoding with stored aspect 1/1
[av1_amf @ 00000179800742c0] encoder->Init() failed with error 4
[08:54:33] encavcodecInit: avcodec_open failed
Failure to initialise thread 'FFMPEG encoder (libavcodec)'
[08:54:33] vfr: 0 frames output, 0 dropped
[08:54:33] vfr: lost time: 0 (0 frames)
[08:54:33] vfr: gained time: 0 (0 frames) (0 not accounted for)
[08:54:33] dca-decoder done: 0 frames, 0 decoder errors
[08:54:33] h264-decoder done: 0 frames, 0 decoder errors
[08:54:33] sync: got 0 frames, 9152 expected
[08:54:33] Finished work at: Tue Feb 20 08:54:33 2024
[08:54:33] libhb: work result = 3

 # Job Failed to Initialise. Check log and input settings (3)

What Operating System are you running?

Windows 10

What version of HandBrake are you running?

1.7.3 (2024021000)

Where did you download HandBrake from?

auto update, handbrake.fr?

@sr55
Copy link
Contributor

sr55 commented Feb 20, 2024

You'll get that kind of error if the option isn't valid for the current selection or not supported with the current driver.
Unfortunately, there isn't an easy way to know what's causing that.

Could be it's not compatible with the rate control method used. (Not configurable via HandBrake)

@sr55
Copy link
Contributor

sr55 commented Apr 17, 2024

Finally got around to testing this on hardware. I can reproduce.

Confirmed the error code is AMF rejecting it but I'm not sure why.

@sr55
Copy link
Contributor

sr55 commented Apr 17, 2024

Looks like it is infact limited to certain rate control modes however I think there is also an issue in HandBrake as I can't get it to work in the same circumstances as ffmpeg.exe

Setting as a bug for now until we can find out why.

@sr55 sr55 added the Bug label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants
@sr55 @SKECHER9 and others