H.265 (AMD VCE) encoding problem

HandBrake for Windows support
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
Hodrakir
Posts: 6
Joined: Fri Dec 28, 2018 10:25 am

H.265 (AMD VCE) encoding problem

Post by Hodrakir »

Description of problem or question:
I have an AMD RX580 graphics card running with an AMD Ryzen 1700x. I encoded some video files with the new H.265 (AMD VCE) codec and I think I found a bug. The resulting files look perfect and the encondig times are now a third of what they were before (around 80 FPS). However it is not possible to move in the timeline of the video. It always starts again. I have tested this on three different players with the same result on all (VLC windows 64 bits, MX Player Pro on Android TV and Dune Solo 4K).
Now I am re-encoding these files with x265 and with it they work again correctly... Unfortunately, I'm also back to my old FPS rate (around 30 FPS).
Greetings and thank you all for your excellent work.



Steps to reproduce the problem (If Applicable):




HandBrake version (e.g., 1.0.0):

1.2.0


Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10 Creators Update (1803)


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

Code: Select all

HandBrake 1.2.0 (2018121700)
OS: Microsoft Windows NT 10.0.17134.0
Ram: 32705 MB, 
GPU Information:
  Radeon RX 580 Series - 25.20.15002.58
Screen: 3840x2160
Temp Dir: C:\Users\Ricardo\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\Ricardo\AppData\Roaming\HandBrake

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


# Starting Encode ...

[00:45:28] hb_init: starting libhb thread
[00:45:28] 1 job(s) to process
[00:45:28] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": "av_aac",
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:ac3",
      "copy:dtshd",
      "copy:dts",
      "copy:eac3",
      "copy:flac",
      "copy:mp3",
      "copy:truehd"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "E:\\Nube\\Shared Videos\\02_TV Series\\Modern Family\\T7\\Modern Family 7x01 x265.mkv",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": "mkv"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "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": 11,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "720",
          "width": "1280"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "E:\\Nube\\Shared Videos\\02_TV Series\\Modern Family\\T7\\Modern Family 7x01.mkv"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "vce_h265",
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "balanced",
    "Profile": "main",
    "Quality": 21.0,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[00:45:28] CPU:
[00:45:28]  - logical processor count: 16
[00:45:28] Intel Quick Sync Video support: no
[00:45:28] hb_scan: path=E:\Nube\Shared Videos\02_TV Series\Modern Family\T7\Modern Family 7x01.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image E:\Nube\Shared Videos\02_TV Series\Modern Family\T7\Modern Family 7x01.mkv
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[00:45:28] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[00:45:28] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'E:\Nube\Shared Videos\02_TV Series\Modern Family\T7\Modern Family 7x01.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2015-10-15T01:10:46.000000Z
  Duration: 00:21:36.61, start: 0.000000, bitrate: 4085 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 2k tbc (default)
    Metadata:
      BPS             : 3891801
      BPS-eng         : 3891801
      DURATION        : 00:21:36.505000000
      DURATION-eng    : 00:21:36.505000000
      NUMBER_OF_FRAMES: 31085
      NUMBER_OF_FRAMES-eng: 31085
      NUMBER_OF_BYTES : 630717563
      NUMBER_OF_BYTES-eng: 630717563
      _STATISTICS_WRITING_APP: mkvmerge v7.5.0 ('Glass Culture') 32bit built on Jan  4 2015 16:37:25
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.5.0 ('Glass Culture') 32bit built on Jan  4 2015 16:37:25
      _STATISTICS_WRITING_DATE_UTC: 2015-10-15 00:28:21
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-15 00:28:21
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(spa): Audio: ac3, 44100 Hz, stereo, fltp, 192 kb/s (default) (forced)
    Metadata:
      BPS             : 191999
      BPS-eng         : 191999
      DURATION        : 00:21:36.614000000
      DURATION-eng    : 00:21:36.614000000
      NUMBER_OF_FRAMES: 37227
      NUMBER_OF_FRAMES-eng: 37227
      NUMBER_OF_BYTES : 31118732
      NUMBER_OF_BYTES-eng: 31118732
      _STATISTICS_WRITING_APP: mkvmerge v7.5.0 ('Glass Culture') 32bit built on Jan  4 2015 16:37:25
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.5.0 ('Glass Culture') 32bit built on Jan  4 2015 16:37:25
      _STATISTICS_WRITING_DATE_UTC: 2015-10-15 00:28:21
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-15 00:28:21
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 120x176, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : small_cover.jpg
      mimetype        : image/jpeg
    Stream #0:3: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 600x882, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : cover.jpg
      mimetype        : image/jpeg
    Stream #0:4: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1067x600, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : cover_land.jpg
      mimetype        : image/jpeg
    Stream #0:5: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 213x120, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : small_cover_land.jpg
      mimetype        : image/jpeg
[00:45:28] scan: decoding previews for title 1
[00:45:28] scan: audio 0x1: ac3, rate=44100Hz, bitrate=192000 español (AC3) (2.0 ch)
[00:45:28] scan: 10 previews, 1280x720, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[00:45:28] scan: supported video decoders: avcodec qsv
[00:45:28] libhb: scan thread found 1 valid title(s)
[00:45:28] Skipping subtitle scan.  No suitable subtitle tracks.
[00:45:28] starting job
[00:45:28] decomb filter thread started for segment 0
[00:45:28] decomb filter thread started for segment 1
[00:45:28] decomb filter thread started for segment 5
[00:45:28] decomb filter thread started for segment 3
[00:45:28] decomb filter thread started for segment 4
[00:45:28] decomb filter thread started for segment 2
[00:45:28] decomb filter thread started for segment 6
[00:45:28] decomb check thread started for segment 0
[00:45:28] decomb filter thread started for segment 8
[00:45:28] decomb filter thread started for segment 9
[00:45:28] decomb filter thread started for segment 10
[00:45:28] decomb filter thread started for segment 11
[00:45:28] decomb filter thread started for segment 12
[00:45:28] decomb filter thread started for segment 13
[00:45:28] decomb filter thread started for segment 14
[00:45:28] decomb filter thread started for segment 15
[00:45:28] decomb filter thread started for segment 7
[00:45:28] decomb check thread started for segment 1
[00:45:28] decomb check thread started for segment 2
[00:45:28] decomb check thread started for segment 3
[00:45:28] decomb check thread started for segment 4
[00:45:28] decomb check thread started for segment 5
[00:45:28] decomb check thread started for segment 6
[00:45:28] mask filter thread started for segment 8
[00:45:28] mask filter thread started for segment 9
[00:45:28] decomb check thread started for segment 9
[00:45:28] decomb check thread started for segment 10
[00:45:28] decomb check thread started for segment 11
[00:45:28] decomb check thread started for segment 12
[00:45:28] decomb check thread started for segment 13
[00:45:28] decomb check thread started for segment 14
[00:45:28] decomb check thread started for segment 15
[00:45:28] mask filter thread started for segment 0
[00:45:28] mask filter thread started for segment 1
[00:45:28] mask filter thread started for segment 2
[00:45:28] mask filter thread started for segment 3
[00:45:28] mask filter thread started for segment 4
[00:45:28] mask filter thread started for segment 5
[00:45:28] mask erode thread started for segment 12
[00:45:28] mask filter thread started for segment 7
[00:45:28] decomb check thread started for segment 7
[00:45:28] decomb check thread started for segment 8
[00:45:28] mask filter thread started for segment 10
[00:45:28] mask filter thread started for segment 11
[00:45:28] mask filter thread started for segment 12
[00:45:28] mask filter thread started for segment 13
[00:45:28] mask filter thread started for segment 14
[00:45:28] mask filter thread started for segment 15
[00:45:28] mask erode thread started for segment 0
[00:45:28] mask erode thread started for segment 1
[00:45:28] mask dilate thread started for segment 11
[00:45:28] mask erode thread started for segment 3
[00:45:28] mask erode thread started for segment 4
[00:45:28] mask dilate thread started for segment 15
[00:45:28] mask erode thread started for segment 6
[00:45:28] mask erode thread started for segment 7
[00:45:28] mask erode thread started for segment 8
[00:45:28] mask erode thread started for segment 9
[00:45:28] yadif thread started for segment 5
[00:45:28] mask erode thread started for segment 11
[00:45:28] yadif thread started for segment 8
[00:45:28] mask erode thread started for segment 13
[00:45:28] mask erode thread started for segment 14
[00:45:28] mask erode thread started for segment 15
[00:45:28] mask dilate thread started for segment 0
[00:45:28] mask dilate thread started for segment 1
[00:45:28] mask dilate thread started for segment 2
[00:45:28] mask dilate thread started for segment 3
[00:45:28] work: only 1 chapter, disabling chapter markers
[00:45:28] job configuration:
[00:45:28]  * source
[00:45:28] mask dilate thread started for segment 4
[00:45:28]    + E:\Nube\Shared Videos\02_TV Series\Modern Family\T7\Modern Family 7x01.mkv
[00:45:28]    + title 1, chapter(s) 1 to 1
[00:45:28]    + container: matroska,webm
[00:45:28] mask dilate thread started for segment 5
[00:45:28]    + data rate: 4085 kbps
[00:45:28]  * destination
[00:45:28]    + E:\Nube\Shared Videos\02_TV Series\Modern Family\T7\Modern Family 7x01 x265.mkv
[00:45:28]    + container: Matroska (libavformat)
[00:45:28] mask dilate thread started for segment 6
[00:45:28]  * video track
[00:45:28]    + decoder: h264
[00:45:28]    + filters
[00:45:28] mask dilate thread started for segment 7
[00:45: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)
[00:45:28] mask dilate thread started for segment 8
[00:45:28]      + Decomb (mode=39)
[00:45:28]      + Framerate Shaper (mode=0)
[00:45:28]        + frame rate: same as source (around 23.976 fps)
[00:45:28] mask dilate thread started for segment 9
[00:45:28]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[00:45:28]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[00:45:28]    + Output geometry
[00:45:28]      + storage dimensions: 1280 x 720
[00:45:28] mask dilate thread started for segment 10
[00:45:28]      + pixel aspect ratio: 1 : 1
[00:45:28]      + display dimensions: 1280 x 720
[00:45:28] mask erode thread started for segment 2
[00:45:28]    + encoder: H.265 (AMD VCE)
[00:45:28]      + preset:  balanced
[00:45:28]      + profile: main
[00:45:28]      + level:   auto
[00:45:28]      + quality: 21.00 (QP)
[00:45:28] mask dilate thread started for segment 12
[00:45:28]      + color profile: 1-1-1
[00:45:28]  * audio track 1
[00:45:28]    + decoder: español (AC3) (2.0 ch) (track 1, id 0x1)
[00:45:28]      + bitrate: 192 kbps, samplerate: 44100 Hz
[00:45:28]    + mixdown: Stereo
[00:45:28] mask dilate thread started for segment 13
[00:45:28]    + dither: none
[00:45:28]    + encoder: AAC (libavcodec)
[00:45:28]      + bitrate: 160 kbps, samplerate: 48000 Hz
[00:45:28] mask dilate thread started for segment 14
[00:45:28] mask erode thread started for segment 5
[00:45:28] yadif thread started for segment 0
[00:45:28] yadif thread started for segment 1
[00:45:28] yadif thread started for segment 2
[00:45:28] yadif thread started for segment 3
[00:45:28] yadif thread started for segment 4
[00:45:28] mask erode thread started for segment 10
[00:45:28] yadif thread started for segment 6
[00:45:28] yadif thread started for segment 7
[00:45:28] mask filter thread started for segment 6
[00:45:28] yadif thread started for segment 9
[00:45:28] yadif thread started for segment 10
[00:45:28] yadif thread started for segment 11
[00:45:28] yadif thread started for segment 12
[00:45:28] yadif thread started for segment 13
[00:45:28] yadif thread started for segment 14
[00:45:28] yadif thread started for segment 15
[00:45:28] sync: expecting 31087 video frames
[00:45:28] encavcodecInit: H.265 (AMD VCE)
[00:45:28] encavcodec: encoding at QP 21.00
[00:45:28] encavcodec: encoding with stored aspect 1/1
[00:45:28] sync: first pts video is 0
[00:45:28] sync: "Chapter 1" (1) at frame 1 time 0
[00:45:28] sync: first pts audio 0x1 is 0
[00:52:06] reader: done. 1 scr changes
[00:52:08] work: average encoding speed for job is 77.936089 fps
[00:52:08] comb detect: heavy 211 | light 797 | uncombed 30077 | total 31085
[00:52:08] decomb: deinterlaced 211 | blended 797 | unfiltered 30077 | total 31085
[00:52:08] vfr: lost time: 0 (0 frames)
[00:52:08] vfr: gained time: 0 (0 frames) (0 not accounted for)
[00:52:08] ac3-decoder done: 37227 frames, 0 decoder errors
[00:52:08] h264-decoder done: 31085 frames, 0 decoder errors
[00:52:08] sync: got 31085 frames, 31087 expected
[00:52:08] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
[00:52:08] mux: track 0, 31085 frames, 598439006 bytes, 3692.28 kbps, fifo 1024
[00:52:08] mux: track 1, 60779 frames, 26011977 bytes, 160.49 kbps, fifo 2048
[00:52:08] libhb: work result = 0

# Encode Completed ...
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: H.265 (AMD VCE) encoding problem

Post by s55 »

Reported here: https://github.com/HandBrake/HandBrake/issues/1561

We don't have any work around currently but as far as I know, it only affects the VCE encoder.

My guess is it might be related to another issue with chapter timings and the lack of I/IDR frames.
Hodrakir
Posts: 6
Joined: Fri Dec 28, 2018 10:25 am

Re: H.265 (AMD VCE) encoding problem

Post by Hodrakir »

I'm impressed by the work with my RX580 from the latest release of HandBrake (1.2.1). It seems that all the previous problems have been solved, but in addition the conversions to H.265 using the AMD codec gets the 370 f.p.s. (H.264 to H.265 720p) on average. Not below 180 f.p.s. when I convert to H.265 1080p... Unbelievable.
Congratulations to all the development team for this excellent work. Thank you.
Greetings
Hodrakir
Posts: 6
Joined: Fri Dec 28, 2018 10:25 am

Re: H.265 (AMD VCE) encoding problem

Post by Hodrakir »

Hi.
After installing the Radeon latest drivers (v.19.4.1) the average FPS has dropped to 80 f.p.s.
I needed to go back to the previous version (18.5.1) in order to keep above 300 f.p.s.
I suppose that some internal change in the code does not allow HandBrake to work so efficiently.
Post Reply