[GitHub #660] Handbrake hangs during QSV encode

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
bradbradbradbr
Posts: 7
Joined: Sun Mar 05, 2017 10:14 pm

[GitHub #660] Handbrake hangs during QSV encode

Post by bradbradbradbr »

Please describe the problem in as much detail as possible:
Handbrake stops encoding at a given time during the process (it seems random) and will not continue no matter what I do. I must close it all the way out and start over. Sometimes that helps and the encode finishes. Other times it just stops at a different point (or the same point). I'm using Intel QSV. I read somewhere that it might help to have my monitor cable plugged into the Motherboard DVI port instead of my graphics card. I've done that, and it does seem to cause the hang ups to be less frequent, but it still continues to do it. It doesn't seem to matter if I rip the movie with MakeMKV and encode it that way, or encode it straight from the Bluray. I've tried the latest nightly build but it still seems to be an issue. I've checked Disable QuickSync Decoding . I've attempted to encode without QuickSync and they seem to work fine, but the process takes 4+ hrs. I've tried to remove all audio tracks, remove all subtitles and chapter markers, leaving just the video file itself. Still no luck. Any thoughts?

What version of HandBrake you are running:
1.0.3

What operating system and version and you running (e.g. OSX 10.11, Windows 7, Ubuntu 14):
Windows 10

Where did you download HandBrake from? handbrake.fr or somewhere else?
handbrake.fr

If there was any error, exception or crash report displayed, please copy it and paste it here:

Code: Select all

 Error code -17,	hb_qsv_wait_on_sync	602 
Please include the scan or encode log:

Code: Select all

 # Starting Encode ...

[15:35:30] hb_init: starting libhb thread
[15:35:30] 1 job(s) to process
[15:35:30] json job:
{
  "Audio": {
    "AudioList": [],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      },
      {
        "Name": "Chapter 2"
      },
      {
        "Name": "Chapter 3"
      },
      {
        "Name": "Chapter 4"
      },
      {
        "Name": "Chapter 5"
      },
      {
        "Name": "Chapter 6"
      },
      {
        "Name": "Chapter 7"
      },
      {
        "Name": "Chapter 8"
      },
      {
        "Name": "Chapter 9"
      },
      {
        "Name": "Chapter 10"
      },
      {
        "Name": "Chapter 11"
      },
      {
        "Name": "Chapter 12"
      },
      {
        "Name": "Chapter 13"
      },
      {
        "Name": "Chapter 14"
      },
      {
        "Name": "Chapter 15"
      },
      {
        "Name": "Chapter 16"
      },
      {
        "Name": "Chapter 17"
      },
      {
        "Name": "Chapter 18"
      },
      {
        "Name": "Chapter 19"
      },
      {
        "Name": "Chapter 20"
      }
    ],
    "ChapterMarkers": true,
    "File": "D:\\Movies\\Interstellar\\Interstellar (2014).mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 131072
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 11,
        "Settings": {
          "crop-bottom": "138",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "138",
          "height": "804",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 20
    },
    "Title": 1,
    "Path": "F:\\Rips\\Interstellar (2014).mkv"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 256,
    "Level": "4.0",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "level=4.0:rc-lookahead=50:vbv-bufsize=31250:vbv-maxrate=25000:ref=4:bframes=4:b-adapt=2:direct=auto:me=umh:subme=10:analyse=all:trellis=2",
    "Preset": "balanced",
    "Profile": "high",
    "Quality": 20.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[15:35:30] CPU: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
[15:35:30]  - Intel microarchitecture Ivy Bridge
[15:35:30]  - logical processor count: 4
[15:35:30] Intel Quick Sync Video support: yes
[15:35:30]  - Intel Media SDK hardware: API 1.11 (minimum: 1.3)
[15:35:30]  - H.264 encoder: yes
[15:35:30]     - preferred implementation: hardware (any)
[15:35:30]     - capabilities (hardware):  vsinfo opt1 opt2+extbrc+ib_adapt+nmpslice
[15:35:30]  - H.265 encoder: no
[15:35:30] hb_scan: path=F:\Rips\Interstellar (2014).mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image F:\Rips\Interstellar (2014).mkv
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[15:35:30] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
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
[15:35:30] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'F:\Rips\Interstellar (2014).mkv':
  Metadata:
    title           : Interstellar
  Duration: 02:49:03.92, start: 0.000000, bitrate: N/A
    Chapter #0:0: start 0.000000, end 575.283042
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 575.283042, end 1032.281250
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 1032.281250, end 1500.707542
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 1500.707542, end 2145.101292
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 2145.101292, end 2536.825958
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 2536.825958, end 3019.558208
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 3019.558208, end 3287.784500
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 3287.784500, end 3539.369167
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 3539.369167, end 3974.971000
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 3974.971000, end 4648.018375
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 4648.018375, end 5131.960167
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 5131.960167, end 5671.957958
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 5671.957958, end 6374.659958
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 6374.659958, end 6934.510917
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 6934.510917, end 7334.327000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 7334.327000, end 7976.802167
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 7976.802167, end 8453.778667
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 8453.778667, end 9312.052750
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 9312.052750, end 9839.830000
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 9839.830000, end 10143.925458
    Metadata:
      title           : Chapter 20
    Stream #0:0(eng): Video: h264 (High)
      yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], PAR 1:1 DAR 16:9
      23.98 fps, 1k tbn
    Metadata:
      BPS-eng         : 24255284
      DURATION-eng    : 02:49:03.925458333
      NUMBER_OF_FRAMES-eng: 243211
      NUMBER_OF_BYTES-eng: 30755472723
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.4 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-03-05 01:03:04
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(eng): Audio: dts (DTS-HD MA)
      48000 Hz, 5.1, fltp, 1536 kb/s (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 3693052
      DURATION-eng    : 02:49:03.936000000
      NUMBER_OF_FRAMES-eng: 950994
      NUMBER_OF_BYTES-eng: 4682760972
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.4 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-03-05 01:03:04
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[15:35:30] scan: decoding previews for title 1
[15:35:30] scan: audio 0x1: dca, rate=48000Hz, bitrate=1536000 English (DTS-HD MA) (5.1 ch)
[15:35:37] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 138/138/0/0, aspect 16:9, PAR 1:1
[15:35:37] scan: supported video decoders: avcodec qsv
[15:35:37] libhb: scan thread found 1 valid title(s)
[15:35:37] starting job
[15:35:37] job configuration:
[15:35:37]  * source
[15:35:37]    + F:\Rips\Interstellar (2014).mkv
[15:35:37]    + title 1, chapter(s) 1 to 20
[15:35:37]    + container: matroska,webm
[15:35:37]  * destination
[15:35:37]    + D:\Movies\Interstellar\Interstellar (2014).mp4
[15:35:37]    + container: MPEG-4 (libavformat)
[15:35:37]      + chapter markers
[15:35:37]  * video track
[15:35:37]    + decoder: h264
[15:35:37]    + filters
[15:35:37]      + Framerate Shaper (mode=1)
[15:35:37]        + frame rate: 23.976 fps -> constant 23.976 fps
[15:35:37]      + Crop and Scale (width=1920:height=804:crop-top=138:crop-bottom=138:crop-left=0:crop-right=0)
[15:35:37]        + source: 1920 * 1080, crop (138/138/0/0): 1920 * 804, scale: 1920 * 804
[15:35:37]    + Output geometry
[15:35:37]      + storage dimensions: 1920 x 804
[15:35:37]      + pixel aspect ratio: 1 : 1
[15:35:37]      + display dimensions: 1920 x 804
[15:35:37]    + encoder: H.264 (Intel Media SDK)
[15:35:37]      + preset:  balanced
[15:35:37]      + options: level=4.0:rc-lookahead=50:vbv-bufsize=31250:vbv-maxrate=25000:ref=4:bframes=4:b-adapt=2:direct=auto:me=umh:subme=10:analyse=all:trellis=2
[15:35:37]      + profile: high
[15:35:37]      + level:   4.0
[15:35:37]      + quality: 20.00 (QP)
[15:35:37] sync: expecting 243210 video frames
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key level
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key rc-lookahead
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key subme
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key direct
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key bframes
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key analyse
[15:35:37] encqsvInit: hb_qsv_param_parse: bad value 2 for key b-adapt
[15:35:37] encqsvInit: hb_qsv_param_parse: bad key me
[15:35:37] encqsvInit: hb_qsv_param_parse: unsupported option trellis
[15:35:37] encqsvInit: using encode-only path
[15:35:37] encqsvInit: H.264/AVC High profile @ level 4.0
[15:35:37] encqsvInit: TargetUsage 2 AsyncDepth 3
[15:35:37] encqsvInit: GopRefDist 4 GopPicSize 32 NumRefFrame 4
[15:35:37] encqsvInit: BFramesMax 3
[15:35:37] encqsvInit: RateControlMethod CQP with QPI 20 QPP 22 QPB 24
[15:35:37] sync: first pts video is 0
[15:35:37] sync: "Chapter 1" (1) at frame 1 time 0
[15:35:37] qsv_enc_init: using 'hardware (1)' implementation, API: 1.11
[15:39:28] sync: "Chapter 2" (2) at frame 13796 time 51782981
[15:42:42] sync: "Chapter 3" (3) at frame 24752 time 92909066
[15:44:21] sync: "Chapter 4" (4) at frame 35982 time 135063678
[15:46:17] sync: "Chapter 5" (5) at frame 51434 time 193066623
[15:47:26] sync: "Chapter 6" (6) at frame 60824 time 228314336
[15:48:54] sync: "Chapter 7" (7) at frame 72399 time 271763992
[15:49:46] sync: "Chapter 8" (8) at frame 78829 time 295900605
[15:50:32] sync: "Chapter 9" (9) at frame 84863 time 318550732
Error code -17,	hb_qsv_wait_on_sync	602 
maxim_d33
Bright Spark User
Posts: 175
Joined: Mon Mar 21, 2011 12:02 pm

Re: Handbrake hangs during QSV encode

Post by maxim_d33 »

can you please try nightly build and share you full log,
what GPU drivers do you use?
deimos_phobos
New User
Posts: 1
Joined: Tue Mar 07, 2017 5:06 pm

Re: Handbrake hangs during QSV encode

Post by deimos_phobos »

I see a similar error while encoding wtv files from WMC. Hangs with QSV enabled, works fine without.

Code: Select all

HandBrake 1.0.3 (2017022500) - 64bit
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz
Ram: 16244 MB, 
GPU Information:
  Intel(R) HD Graphics 4400 - 10.18.14.4578
  NVIDIA GeForce GTX 560 - 21.21.13.7595
Screen: 1920x1080
Temp Dir: C:\Users\MediaCenter.HOMESERVER\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\MediaCenter.HOMESERVER\AppData\Roaming\HandBrake Team\HandBrake\1.0.3.0

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


# Starting Encode ...

[11:49:06] hb_init: starting libhb thread
[11:49:06] 1 job(s) to process
[11:49:06] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      },
      {
        "DRC": 0.0,
        "Encoder": 1073743872,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "File": "K:\\TV\\Seinfeld Kube 2017 03 02 19 30 00-1.m4v",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 131072
  },
  "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": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "L:\\Recorded TV\\Seinfeld_KUBE_2017_03_02_19_30_00.wtv"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 256,
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "balanced",
    "Profile": "auto",
    "Quality": 20.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": true,
      "AsyncDepth": 0
    }
  }
}
[11:49:06] CPU: Intel(R) Core(TM) i3-4150 CPU @ 3.50GHz
[11:49:06]  - Intel microarchitecture Haswell
[11:49:06]  - logical processor count: 4
[11:49:06] Intel Quick Sync Video support: yes
[11:49:06]  - Intel Media SDK hardware: API 1.17 (minimum: 1.3)
[11:49:06]  - H.264 encoder: yes
[11:49:06]     - preferred implementation: hardware (any)
[11:49:06]     - capabilities (hardware):  breftype vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[11:49:06]  - H.265 encoder: no
[11:49:06] hb_scan: path=L:\Recorded TV\Seinfeld_KUBE_2017_03_02_19_30_00.wtv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image L:\Recorded TV\Seinfeld_KUBE_2017_03_02_19_30_00.wtv
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[11:49:06] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
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
[11:49:06] dvd: not a dvd - trying as a stream/file instead
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e290a0] Invalid frame dimensions 0x0.
Input #0, wtv, from 'L:\Recorded TV\Seinfeld_KUBE_2017_03_02_19_30_00.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Seinfeld
    WM/SubTitle     : The Showerhead
    WM/SubTitleDescription: Elaine fails a drug test---twice---and loses her job; Jerry talks about his Uncle Leo on "The Tonight Show." Jay Leno has a cameo. Leo: Len Lesser. Helen: Liz Sheridan. Morty: Barney Martin. Frank: Jerry Stiller.
    genre           : comedy;other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : Jerry Seinfeld/Jason Alexander/Julia Louis-Dreyfus/Michael Richards/Liz Sheridan/Barney Martin/John O'Hurley/Jerry Stiller/Len Lesser/Estelle Harris/Jay Leno;Andy Ackerman;;
    service_provider: KUBE
    service_name    : KUBE HDTV
    WM/MediaNetworkAffiliation: IND
    WM/MediaOriginalChannel: 57
    WM/MediaOriginalChannelSubNumber: 1
    WM/MediaOriginalBroadcastDateTime: 1996-02-15T06:00:00Z
    WM/MediaOriginalRunTime: 19780774833
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: true
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: false
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2017-03-03 01:30:01
    WM/WMRVSeriesUID: !MCSeries!48133659
    WM/WMRVServiceID: !MCService!195990411
    WM/WMRVProgramID: !MCProgram!309459823
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: 4294966996
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: true
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 19780842855
    WM/WMRVEndTime  : 2017-03-03 02:03:00
    WM/WMRVBitrate  : 9.366809
    WM/WMRVKeepUntil: 4294967295
    WM/WMRVActualSoftPrePadding: 298
    WM/WMRVActualSoftPostPadding: 180
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationDate:
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 352
    WM/MediaThumbHeight: 198
    WM/MediaThumbStride: 1056
    WM/MediaThumbRet: 0
    WM/MediaThumbRatingSystem: 9
    WM/MediaThumbRatingLevel: 10
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 16
    WM/MediaThumbAspectRatioY: 9
    WM/MediaThumbTimeStamp: 4643270311490341778
    WM/MediaThumbType: 3
  Duration: 00:32:57.91, start: 1.417963, bitrate: 7082 kb/s
    Stream #0:0[0x8f](eng): Audio: ac3
      48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:1[0x90]: Video: mpeg2video (Main)
      yuv420p, tv, bt709/bt709/bt709
      1280x720 [PAR 1:1 DAR 16:9], 19392 kb/s
      59.94 fps, 10000k tbn
    Stream #0:2[0x91]: Subtitle: dvb_teletext
    Stream #0:3[0xffffffff]: Attachment: mjpeg
    Metadata:
      title           : TV Thumbnail
[11:49:06] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17007
[11:49:06] scan: decoding previews for title 1
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e2b320] Invalid frame dimensions 0x0.
[11:49:06] scan: audio 0x0: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch)
[11:49:06] scan: 10 previews, 1280x720, 59.940 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[11:49:06] libhb: scan thread found 1 valid title(s)
[11:49:06] Skipping subtitle scan.  No suitable subtitle tracks.
[11:49:06] starting job
[11:49:06] decomb filter thread started for segment 0
[11:49:06] decomb filter thread started for segment 3
[11:49:06] decomb check thread started for segment 0
[11:49:06] decomb filter thread started for segment 1
[11:49:06] decomb filter thread started for segment 2
[11:49:06] decomb check thread started for segment 3
[11:49:06] mask filter thread started for segment 0
[11:49:06] decomb check thread started for segment 1
[11:49:06] mask filter thread started for segment 3
[11:49:06] decomb check thread started for segment 2
[11:49:06] mask filter thread started for segment 1
[11:49:06] mask erode thread started for segment 0
[11:49:06] mask filter thread started for segment 2
[11:49:06] mask erode thread started for segment 1
[11:49:06] mask erode thread started for segment 2
[11:49:06] mask erode thread started for segment 3
[11:49:06] mask dilate thread started for segment 0
[11:49:06] mask dilate thread started for segment 1
[11:49:06] mask dilate thread started for segment 2
[11:49:06] mask dilate thread started for segment 3
[11:49:06] yadif thread started for segment 0
[11:49:06] yadif thread started for segment 1
[11:49:06] yadif thread started for segment 3
[11:49:06] yadif thread started for segment 2
[11:49:06] work: track 1, dithering not supported by codec
[11:49:06] work: only 1 chapter, disabling chapter markers
[11:49:06] job configuration:
[11:49:06]  * source
[11:49:06]    + L:\Recorded TV\Seinfeld_KUBE_2017_03_02_19_30_00.wtv
[11:49:06]    + title 1, chapter(s) 1 to 1
[11:49:06]    + container: wtv
[11:49:06]    + data rate: 7082 kbps
[11:49:06]  * destination
[11:49:06]    + K:\TV\Seinfeld Kube 2017 03 02 19 30 00-1.m4v
[11:49:06]    + container: MPEG-4 (libavformat)
[11:49:06]  * video track
[11:49:06]    + decoder: mpeg2video
[11:49:06]      + bitrate 19392 kbps
[11:49:06]    + filters
[11:49:06]      + 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:49:06]      + Decomb (mode=39)
[11:49:06]      + Framerate Shaper (mode=1)
[11:49:06]        + frame rate: 59.940 fps -> constant 59.940 fps
[11:49:06]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[11:49:06]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[11:49:06]    + Output geometry
[11:49:06]      + storage dimensions: 1280 x 720
[11:49:06]      + pixel aspect ratio: 1 : 1
[11:49:06]      + display dimensions: 1280 x 720
[11:49:06]    + encoder: H.264 (Intel Media SDK)
[11:49:06]      + preset:  balanced
[11:49:06]      + profile: auto
[11:49:06]      + level:   auto
[11:49:06]      + quality: 20.00 (QP)
[11:49:06]  * audio track 1
[11:49:06]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x0)
[11:49:06]      + bitrate: 192 kbps, samplerate: 48000 Hz
[11:49:06]    + mixdown: Stereo
[11:49:06]    + encoder: AAC (libavcodec)
[11:49:06]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:49:06]  * audio track 2
[11:49:06]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x0)
[11:49:06]      + bitrate: 192 kbps, samplerate: 48000 Hz
[11:49:06]    + AC3 Passthru
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[mpeg2video @ 0000000029e29940] Invalid frame dimensions 0x0.
[11:49:06] sync: expecting 118556 video frames
[11:49:06] encqsvInit: using encode-only path
[11:49:06] encqsvInit: H.264/AVC High profile @ level 3.2
[11:49:06] encqsvInit: TargetUsage 4 AsyncDepth 0
[11:49:06] encqsvInit: GopRefDist 4 GopPicSize 32 NumRefFrame 2
[11:49:06] encqsvInit: BFramesMax 3 BRefType pyramid
[11:49:06] encqsvInit: AdaptiveI unknown (auto) AdaptiveB unknown (auto)
[11:49:06] encqsvInit: RateControlMethod CQP with QPI 20 QPP 22 QPB 24
[11:49:06] encqsvInit: ExtBRC unknown (auto)
[11:49:06] encqsvInit: MBBRC unknown (auto)
[11:49:06] encqsvInit: Trellis unknown (auto)
[11:49:06] sync: first pts video is 66052
[11:49:06] sync: "Chapter 1" (1) at frame 1 time 66052
[11:49:06] sync: video time went backwards 16 ms, dropped 1 frames. PTS 70556
[11:49:07] sync: first pts audio 0x0 is 0
[11:49:07] sync: first pts audio 0x0 is 0
[11:49:07] qsv_enc_init: using 'hardware (2)' implementation, API: 1.17
[11:49:07] compute_init_delay: invalid delay 0 (PTS: 0, DTS: 0)

# Encode Stopped

[11:50:14] work: average encoding speed for job is 43.441036 fps
[11:50:14] comb detect: heavy 165 | light 834 | uncombed 1900 | total 2899
[11:50:14] decomb: deinterlaced 164 | blended 833 | unfiltered 1897 | total 2894
[11:50:14] vfr: 2929 frames output, 0 dropped and 43 duped for CFR/PFR
[11:50:14] vfr: lost time: 0 (0 frames)
[11:50:14] vfr: gained time: 0 (0 frames) (0 not accounted for)
[11:50:14] ac3-decoder done: 1555 frames, 0 decoder errors
[11:50:14] ac3-decoder done: 1555 frames, 0 decoder errors
[11:50:14] mpeg2video-decoder done: 2967 frames, 0 decoder errors
[11:50:14] sync: got 2914 frames, 118556 expected
[11:50:14] sync: framerate min 59.920 fps, max 59.960 fps, avg 59.940 fps
[11:50:14] mux: track 0, 2913 frames, 35159601 bytes, 5764.02 kbps, fifo 2048
[11:50:14] mux: track 1, 2286 frames, 976240 bytes, 160.04 kbps, fifo 1024
[11:50:14] mux: track 2, 1525 frames, 1171200 bytes, 192.00 kbps, fifo 1024
[11:50:14] libhb: work result = 1

# Encode Completed ...
bradbradbradbr
Posts: 7
Joined: Sun Mar 05, 2017 10:14 pm

Re: Handbrake hangs during QSV encode

Post by bradbradbradbr »

The nightly build seems to have worked. I just ran about 10-12 or so encodes and it only did it to me once. I reran that one and it worked fine.
numberfive
Posts: 2
Joined: Thu Apr 20, 2017 7:14 am

Re: Handbrake hangs during QSV encode

Post by numberfive »

I have the same problem and it did not go away with 1.0.7 version.
I've switched from i5-3470 to i5-3570K in the same time I've updated from beta to stable 1.0.0, so I cannot tell which one could be the root cause.
But it is exactly the same, random hangs during QSV encode, and no problems with the CPU encoding.

Please describe the problem in as much detail as possible:
Same as OP
What are the steps to reproduce this problem:
Same as OP
What version of HandBrake you are running:
1.0.7
What operating system and version and you running (e.g. OSX 10.11, Windows 7, Ubuntu 14):
Windows 8.1 x64
Where did you download HandBrake from? handbrake.fr or somewhere else?
Handbrake.fr
If there was any error, exception or crash report displayed, please copy it and paste it here:
No report, just hangs, while GUI remain responsive and I can cancel the pending operation.
Please include the scan or encode log:
Error code -17, hb_qsv_wait_on_sync 602

Code: Select all

HandBrake 1.0.7 (2017040900) - 64bit
OS: Microsoft Windows NT 6.3.9600.0 - 64bit
CPU: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
Ram: 16260 MB, 
GPU Information:
  Intel(R) HD Graphics 4000 - 10.18.10.4425
  NVIDIA GeForce GTX 1060 3GB - 22.21.13.8165
Screen: 1920x1080
Temp Dir: c:\Windows\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\User\AppData\Roaming\HandBrake Team\HandBrake\1.0.7.0

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


# Starting Encode ...

[09:23:35] hb_init: starting libhb thread
[09:23:35] 1 job(s) to process
[09:23:35] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      },
      {
        "DRC": 0.0,
        "Encoder": 1073743872,
        "Gain": 0.0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "File": "M:\\Studio.mkv",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": 131072
  },
  "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": "158",
          "crop-top": "0",
          "height": "720",
          "width": "1122"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "M:\\Studio.mkv"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": 256,
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "speed",
    "Profile": "auto",
    "Quality": 21.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": true,
      "AsyncDepth": 0
    }
  }
}
[09:23:35] CPU: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
[09:23:35]  - Intel microarchitecture Ivy Bridge
[09:23:35]  - logical processor count: 4
[09:23:35] Intel Quick Sync Video support: yes
[09:23:35]  - Intel Media SDK hardware: API 1.11 (minimum: 1.3)
[09:23:35]  - H.264 encoder: yes
[09:23:35]     - preferred implementation: hardware (any)
[09:23:35]     - capabilities (hardware):  vsinfo opt1 opt2+extbrc+ib_adapt+nmpslice
[09:23:35]  - H.265 encoder: no
[09:23:35] hb_scan: path=M:\\Studio.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:274: failed opening UDF image M:\\Studio.mkv
src/libbluray/disc/disc.c:352: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:352: error opening file BDMV\BACKUP\index.bdmv
[09:23:35] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
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
[09:23:35] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'M:\\Studio.mkv':
  Duration: 00:44:01.09, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High)
      yuv420p, 1280x720 [PAR 1:1 DAR 16:9], PAR 1:1 DAR 16:9
      23.98 fps, 1k tbn (default)
    Metadata:
      BPS             : 2468913
      BPS-eng         : 2468913
      DURATION        : 00:44:00.075000000
      DURATION-eng    : 00:44:00.075000000
      NUMBER_OF_FRAMES: 63296
      NUMBER_OF_FRAMES-eng: 63296
      NUMBER_OF_BYTES : 814764723
      NUMBER_OF_BYTES-eng: 814764723
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-04-19 18:07:25
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-19 18:07:25
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1: Audio: ac3
      48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      BPS             : 191999
      BPS-eng         : 191999
      DURATION        : 00:44:01.091000000
      DURATION-eng    : 00:44:01.091000000
      NUMBER_OF_FRAMES: 82534
      NUMBER_OF_FRAMES-eng: 82534
      NUMBER_OF_BYTES : 63386112
      NUMBER_OF_BYTES-eng: 63386112
      _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-04-19 18:07:25
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-19 18:07:25
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[09:23:35] scan: decoding previews for title 1
[09:23:35] scan: audio 0x1: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[09:23:35] scan: 10 previews, 1280x720, 23.976 fps, autocrop = 0/0/0/158, aspect 16:9, PAR 1:1
[09:23:35] scan: supported video decoders: avcodec qsv
[09:23:35] libhb: scan thread found 1 valid title(s)
[09:23:35] Skipping subtitle scan.  No suitable subtitle tracks.
[09:23:35] starting job
[09:23:35] decomb filter thread started for segment 0
[09:23:35] decomb filter thread started for segment 1
[09:23:35] decomb filter thread started for segment 2
[09:23:35] decomb filter thread started for segment 3
[09:23:35] decomb check thread started for segment 0
[09:23:35] decomb check thread started for segment 1
[09:23:35] decomb check thread started for segment 2
[09:23:35] decomb check thread started for segment 3
[09:23:35] mask filter thread started for segment 0
[09:23:35] mask filter thread started for segment 1
[09:23:35] mask filter thread started for segment 2
[09:23:35] mask filter thread started for segment 3
[09:23:35] mask erode thread started for segment 0
[09:23:35] mask erode thread started for segment 1
[09:23:35] mask erode thread started for segment 2
[09:23:35] mask erode thread started for segment 3
[09:23:35] mask dilate thread started for segment 0
[09:23:35] mask dilate thread started for segment 1
[09:23:35] mask dilate thread started for segment 2
[09:23:35] mask dilate thread started for segment 3
[09:23:35] yadif thread started for segment 0
[09:23:35] yadif thread started for segment 1
[09:23:35] yadif thread started for segment 2
[09:23:35] yadif thread started for segment 3
[09:23:35] work: track 1, dithering not supported by codec
[09:23:35] work: only 1 chapter, disabling chapter markers
[09:23:35] job configuration:
[09:23:35]  * source
[09:23:35]    + M:\\Studio.mkv
[09:23:35]    + title 1, chapter(s) 1 to 1
[09:23:35]    + container: matroska,webm
[09:23:35]  * destination
[09:23:35]    + M:\Converted\studio-1.m4v
[09:23:35]    + container: MPEG-4 (libavformat)
[09:23:35]  * video track
[09:23:35]    + decoder: h264_qsv
[09:23:35]    + filters
[09:23:35]      + 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)
[09:23:35]      + Decomb (mode=39)
[09:23:35]      + Framerate Shaper (mode=1)
[09:23:35]        + frame rate: 23.976 fps -> constant 23.976 fps
[09:23:35]      + Crop and Scale (width=1122:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=158)
[09:23:35]        + source: 1280 * 720, crop (0/0/0/158): 1122 * 720, scale: 1122 * 720
[09:23:35]    + Output geometry
[09:23:35]      + storage dimensions: 1122 x 720
[09:23:35]      + pixel aspect ratio: 1 : 1
[09:23:35]      + display dimensions: 1122 x 720
[09:23:35]    + encoder: H.264 (Intel Media SDK)
[09:23:35]      + preset:  speed
[09:23:35]      + profile: auto
[09:23:35]      + level:   auto
[09:23:35]      + quality: 21.00 (QP)
[09:23:35]  * audio track 1
[09:23:35]    + decoder: Unknown (AC3) (2.0 ch) (track 1, id 0x1)
[09:23:35]      + bitrate: 192 kbps, samplerate: 48000 Hz
[09:23:35]    + mixdown: Stereo
[09:23:35]    + encoder: AAC (libavcodec)
[09:23:35]      + bitrate: 160 kbps, samplerate: 48000 Hz
[09:23:35]  * audio track 2
[09:23:35]    + decoder: Unknown (AC3) (2.0 ch) (track 1, id 0x1)
[09:23:35]      + bitrate: 192 kbps, samplerate: 48000 Hz
[09:23:35]    + AC3 Passthru
[09:23:35] sync: expecting 63322 video frames
[09:23:35] encqsvInit: using encode-only path
[09:23:35] encqsvInit: H.264/AVC High profile @ level 3.1
[09:23:35] encqsvInit: TargetUsage 4 AsyncDepth 4
[09:23:35] encqsvInit: GopRefDist 4 GopPicSize 32 NumRefFrame 2
[09:23:35] encqsvInit: BFramesMax 3
[09:23:35] encqsvInit: RateControlMethod CQP with QPI 21 QPP 23 QPB 25
[09:23:35] sync: first pts video is 0
[09:23:35] sync: "Chapter 1" (1) at frame 1 time 0
[09:23:35] sync: first pts audio 0x1 is 0
[09:23:35] sync: first pts audio 0x1 is 0
[09:23:35] qsv_enc_init: using 'hardware (2)' implementation, API: 1.11

Error code -17,	hb_qsv_wait_on_sync	602
User avatar
s55
HandBrake Team
Posts: 10347
Joined: Sun Dec 24, 2006 1:05 pm

Re: Handbrake hangs during QSV encode

Post by s55 »

numberfive
Posts: 2
Joined: Thu Apr 20, 2017 7:14 am

Re: [GitHub #660] Handbrake hangs during QSV encode

Post by numberfive »

Tracking say's it is GPU driver problem, while it isn't, it was reproduced on 3,4 and 7 gen GPUs.
And I personally never updated my iGPU drivers, and the only change was the newer version of HB.
0.10 still works perfectly
User avatar
s55
HandBrake Team
Posts: 10347
Joined: Sun Dec 24, 2006 1:05 pm

Re: [GitHub #660] Handbrake hangs during QSV encode

Post by s55 »

It's not a new driver problem as far as I know. It's the fact we are now using it in a different (but still correct) way that's triggered this.

The series of CPU is irrelevant.
Post Reply