Handbrake suddenly slow

martindp

Commendable
Oct 4, 2016
4
0
1,510
I have been using Handbrake for about 3 months or so now to copy my DVD collection to my NAS drive. Up until very recently it has been averaging between 90-120fps when ripping, and each 40-odd minute TV episode has taken about 8mins to rip. Now, in the last few days, it has become really slow for no discernible reason. The fps has dropped down to something ridiculous like between 8-22fps, and each episode is taking about 45mins to an hour to rip.

Nothing had changed in terms of hardware or software configuration of my computer to explain the sudden drop. I've upgraded to the newest version of Handbrake, with no improvement. I've also tried some basic troubleshooting to try and find the problem:-

1) Tried a different disk in Handbrake (i.e. I was in the middle of ripping Star Trek Voyager when the problem started, so I changed disks and tried Friends instead) I'm not sure why I thought that would work either, but I was trying to count everything out.

2) Ripped a different type of disk - did an audio rip in a different piece of software and that worked no problem, fast as ever. So, I'm happy to take that as meaning there's no issue with my disk drive.

3) Checked the communication between computer and NAS and transfer speeds are quick as they have ever been. Plus I also tried a rip to a local hard drive to make sure it wasn't network issues, and Handbrake is just as slow ripping locally. I've restarted both the computer and the NAS, with no improvement.

4) Tried a different piece of software this morning (Winxdvd ripper) and even that is only copying at 60fps or so which, compared with the speeds I was getting from Handbrake before, is still quite slow in my view...considering the website says Winxdvd will rip an entire film in 5 mins, this morning's trial was taking 5 mins to rip a 5 min section of a disk. I am only using the free version of Winxdvd at the minute and I think I read somewhere that the free version doesn't use all the CPU cores (although I can't find that again now) I have no problem in coughing up for a license for it if it's going to solve the problem, but if it's going to be just as slow as Handbrake it'd just be a waste of money.

Sorry to go on for so long but I'm stumped now, not sure what else I can try. Many thanks for any help anyone is able to provide.
 
Sounds like your handbrake encoding settings have changed to a slower/higher quality setting...

post the 'mediainfo' output from an older rip that was fast and one from the slow to compare.

Also I use makemkv for my ripping ;) not opensource but good freeware and works woth bluray
 

martindp

Commendable
Oct 4, 2016
4
0
1,510
Hi, I was hoping I'd be able to upload the encode log files as txt to save space, but can't seem to do it. So here goes...

Here's the output log for a fast rip...

Reading chapter markers from file C:\Users\marti_000\AppData\Local\Temp\s04e25-2-chapters.csv
[19:20:22] 1 job(s) to process
[19:20:22] starting job
[19:20:22] sync: expecting 66050 video frames
[19:20:22] job configuration:
[19:20:22] * source
[19:20:22] + E:\
[19:20:22] + title 2, chapter(s) 1 to 8
[19:20:22] * destination
[19:20:22] + X:\TV Shows\Star Trek Voyager (1995)\Season 4\s04e25.m4v
[19:20:22] + container: MPEG-4 (libavformat)
[19:20:22] + chapter markers
[19:20:22] * video track
[19:20:22] + decoder: mpeg2video
[19:20:22] + bitrate 7900 kbps
[19:20:22] + filters
[19:20:22] + Framerate Shaper (0:27000000:1080000)
[19:20:22] + frame rate: same as source (around 25.000 fps)
[19:20:22] + Crop and Scale (710:578:2:2:10:6)
[19:20:22] + source: 720 * 576, crop (2/2/10/6): 704 * 572, scale: 710 * 578
[19:20:22] + loose anamorphic
[19:20:22] + storage dimensions: 710 * 578, mod 2
[19:20:22] + pixel aspect ratio: 3855 / 3607
[19:20:22] + display dimensions: 758 * 578
[19:20:22] + encoder: H.264 (libx264)
[19:20:22] + preset: veryfast
[19:20:22] + profile: main
[19:20:22] + level: 4.0
[19:20:22] + quality: 20.00 (RF)
[19:20:22] * audio track 1
[19:20:22] + decoder: English (AC3) (5.1 ch) (track 1, id 0x80bd)
[19:20:22] + bitrate: 448 kbps, samplerate: 48000 Hz
[19:20:22] + mixdown: Dolby Pro Logic II
[19:20:22] + encoder: AAC (libavcodec)
[19:20:22] + bitrate: 160 kbps, samplerate: 48000 Hz
libdvdnav: Using dvdnav version 5.0.1
libdvdnav: DVD disk reports itself with Region mask 0x00f50000. Regions: 2 4
libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient
libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000130
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000158
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00003083
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x000030e2
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x000160e4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x001f120b
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x001f1210
libdvdread: Elapsed time 0
libdvdread: Found 3 VTS's
libdvdread: Elapsed time 0
libdvdnav: DVD disk reports itself with Region mask 0x00f50000. Regions:[19:20:23] encx264: encoding at constant RF 20.000000
2 4
[19:20:23] encx264: unparsed options: level=4.0:ref=1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10
x264 [info]: using SAR=3855/3607
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
x264 [info]: profile Main, level 4.0
[19:20:23] reader: first SCR 146 id 0xe0 DTS 22254
[19:20:23] mpeg2video: "Chapter 1" (1) at frame 0 time 3600
[19:20:23] sync: first pts is 3600
[19:21:38] mpeg2video: "Chapter 2" (2) at frame 6575 time 23673600
[19:23:06] mpeg2video: "Chapter 3" (3) at frame 16392 time 59014800
[19:24:59] mpeg2video: "Chapter 4" (4) at frame 26103 time 93974400
[19:26:58] mpeg2video: "Chapter 5" (5) at frame 34594 time 124542000
[19:28:23] mpeg2video: "Chapter 6" (6) at frame 42169 time 151812000
[19:29:45] mpeg2video: "Chapter 7" (7) at frame 49989 time 179964000
[19:31:17] mpeg2video: "Chapter 8" (8) at frame 57207 time 205948800
[19:32:48] reader: done. 1 scr changes
[19:33:13] work: average encoding speed for job is 88.665817 fps
[19:33:13] sync: got 66050 frames, 66050 expected
[19:33:14] render: lost time: 0 (0 frames)
[19:33:14] render: gained time: 0 (0 frames) (0 not accounted for)
[19:33:14] mpeg2video-decoder done: 66050 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:566 Avg QP:16.41 size: 22302
x264 [info]: frame P:28771 Avg QP:19.53 size: 5826
x264 [info]: frame B:36713 Avg QP:20.13 size: 1319
x264 [info]: consecutive B-frames: 14.6% 29.3% 13.7% 42.4%
x264 [info]: mb I I16..4: 50.6% 0.0% 49.4%
x264 [info]: mb P I16..4: 18.5% 0.0% 1.3% P16..4: 31.3% 13.1% 5.3% 0.0% 0.0% skip:30.5%
x264 [info]: mb B I16..4: 1.4% 0.0% 0.0% B16..8: 12.8% 3.4% 0.2% direct: 8.9% skip:73.3% L0:35.4% L1:51.4% BI:13.2%
x264 [info]: coded y,uvDC,uvAC intra: 20.0% 42.2% 7.0% inter: 7.5% 12.8% 0.3%
x264 [info]: i16 v,h,dc,p: 50% 27% 16% 6%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 35% 17% 3% 4% 4% 4% 3% 3%
x264 [info]: i8c dc,h,v,p: 61% 18% 18% 3%
x264 [info]: Weighted P-Frames: Y:2.5% UV:1.6%
x264 [info]: kb/s:692.37
[19:33:14] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[19:33:14] mux: track 0, 66050 frames, 228630732 bytes, 692.30 kbps, fifo 4096
[19:33:14] mux: track 1, 123842 frames, 52915462 bytes, 160.23 kbps, fifo 8192
[19:33:14] libhb: work result = 0
Encode done!
HandBrake has exited.

and then for a slow one...

Reading chapter markers from file C:\Users\marti_000\AppData\Local\Temp\s05e25-1-chapters.csv
[12:11:36] 1 job(s) to process
[12:11:36] starting job
[12:11:36] sync: expecting 66106 video frames
[12:11:36] job configuration:
[12:11:36] * source
[12:11:36] + E:\
[12:11:36] + title 1, chapter(s) 1 to 8
[12:11:36] * destination
[12:11:36] + X:\TV Shows\Star Trek Voyager (1995)\Season 5\s05e25.m4v
[12:11:36] + container: MPEG-4 (libavformat)
[12:11:36] + chapter markers
[12:11:36] * video track
[12:11:36] + decoder: mpeg2video
[12:11:36] + bitrate 9800 kbps
[12:11:36] + filters
[12:11:36] + Framerate Shaper (0:27000000:1080000)
[12:11:36] + frame rate: same as source (around 25.000 fps)
[12:11:36] + Crop and Scale (710:578:2:2:10:6)
[12:11:36] + source: 720 * 576, crop (2/2/10/6): 704 * 572, scale: 710 * 578
[12:11:36] + loose anamorphic
[12:11:36] + storage dimensions: 710 * 578, mod 2
[12:11:36] + pixel aspect ratio: 3855 / 3607
[12:11:36] + display dimensions: 758 * 578
[12:11:36] + encoder: H.264 (libx264)
[12:11:36] + preset: veryfast
[12:11:36] + profile: main
[12:11:36] + level: 4.0
[12:11:36] + quality: 20.00 (RF)
[12:11:36] * audio track 1
[12:11:36] + decoder: English (AC3) (5.1 ch) (track 2, id 0x81bd)
[12:11:36] + bitrate: 384 kbps, samplerate: 48000 Hz
[12:11:36] + mixdown: Dolby Pro Logic II
[12:11:36] + encoder: AAC (libavcodec)
[12:11:36] + bitrate: 160 kbps, samplerate: 48000 Hz
libdvdnav: Using dvdnav version 5.0.1
libdvdnav: DVD disk reports itself with Region mask 0x00f50000. Regions: 2 4
libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient
libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000163
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x0000022d
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00017ca7
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x000ff967
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x000ff9b4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x001e6cdf
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x001e6d2c
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_0.VOB at 0x00241be1
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_1.VOB at 0x00241c2e
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_05_0.VOB at 0x0028a3b2
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_05_1.VOB at 0x0028a3ff
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_06_0.VOB at 0x002cdced
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_06_1.VOB at 0x002cdd3a
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_07_0.VOB at 0x002eb375
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_07_1.VOB at 0x002eb3c2
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_08_0.VOB at 0x002f2e7c
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_08_1.VOB at 0x002f2ec9
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_09_0.VOB at 0x002fb2b6
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_09_1.VOB at 0x002fb303
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_10_0.VOB at 0x0032fbdd
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_10_1.VOB at 0x0032fc2a
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_11_0.VOB at 0x00352bfa
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_11_1.VOB at 0x00352c47
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_12_0.VOB at 0x003a473f
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_12_1.VOB at 0x003a478c
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_13_0.VOB at 0x003af854
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_13_1.VOB at 0x003af8a1
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_14_0.VOB at 0x003b62aa
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_14_1.VOB at 0x003b62f7
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_15_0.VOB at 0x003c836a
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_15_1.VOB at 0x003c83b7
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_16_0.VOB at 0x003cf252
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_16_1.VOB at 0x003cf29f
libdvdread: Elapsed time 0
libdvdread: Found 16 VTS's
libdvdread: Elapsed time 0
libdvdnav: DVD disk reports itself with Region mask 0x00f50000. Regions: 2 4
[12:11:37] encx264: encoding at constant RF 20.000000
[12:11:37] encx264: unparsed options: level=4.0:ref=1:8x8dct=0:weightp=1:subme=2:mixed-refs=0:trellis=0:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=10
x264 [info]: using SAR=3855/3607
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
x264 [info]: profile Main, level 4.0
[12:11:38] reader: first SCR 146 id 0xe0 DTS 21600
[12:11:38] mpeg2video: "Chapter 1" (1) at frame 0 time 3600
[12:11:38] sync: first pts is 3600
[12:17:29] mpeg2video: "Chapter 2" (2) at frame 10343 time 37238400
[12:21:14] mpeg2video: "Chapter 3" (3) at frame 16745 time 60285600
[12:26:12] mpeg2video: "Chapter 4" (4) at frame 24822 time 89362800
[12:30:55] mpeg2video: "Chapter 5" (5) at frame 33329 time 119988000
[12:35:50] mpeg2video: "Chapter 6" (6) at frame 40829 time 146988000
[12:41:08] mpeg2video: "Chapter 7" (7) at frame 50302 time 181090800
[12:45:50] mpeg2video: "Chapter 8" (8) at frame 58034 time 208926000
[12:50:28] reader: done. 1 scr changes
[12:51:55] work: average encoding speed for job is 28.368301 fps
[12:51:56] sync: got 66106 frames, 66106 expected
[12:51:56] render: lost time: 0 (0 frames)
[12:51:56] render: gained time: 0 (0 frames) (0 not accounted for)
[12:51:56] mpeg2video-decoder done: 66106 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:588 Avg QP:16.67 size: 28343
x264 [info]: frame P:26741 Avg QP:19.99 size: 6809
x264 [info]: frame B:38777 Avg QP:21.12 size: 1356
x264 [info]: consecutive B-frames: 10.1% 30.9% 12.2% 46.8%
x264 [info]: mb I I16..4: 45.7% 0.0% 54.3%
x264 [info]: mb P I16..4: 13.6% 0.0% 1.7% P16..4: 32.0% 13.5% 6.1% 0.0% 0.0% skip:33.1%
x264 [info]: mb B I16..4: 0.8% 0.0% 0.1% B16..8: 11.1% 3.2% 0.3% direct: 8.1% skip:76.4% L0:31.4% L1:50.7% BI:17.9%
x264 [info]: coded y,uvDC,uvAC intra: 31.3% 55.9% 22.8% inter: 8.0% 14.0% 0.8%
x264 [info]: i16 v,h,dc,p: 48% 27% 17% 8%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 35% 16% 4% 4% 4% 4% 4% 3%
x264 [info]: i8c dc,h,v,p: 54% 21% 22% 4%
x264 [info]: Weighted P-Frames: Y:2.6% UV:1.9%
x264 [info]: kb/s:760.42
[12:51:56] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[12:52:06] mux: track 0, 66106 frames, 251315987 bytes, 760.34 kbps, fifo 4096
[12:52:06] mux: track 1, 123947 frames, 52979499 bytes, 160.29 kbps, fifo 8192
[12:52:06] libhb: work result = 0
Encode done!
HandBrake has exited.

I hope I've included enough there. If not, let me know. I've had limited contact with MakeMKV to be honest, I only used it briefly to rip what few Blu-rays I had. Are MKV file sizes comparable to MP4/M4V providing the quality settings are around the same?
 
Ok and if you.go back and rerip star trek is it slow or fast?

Also Yes mp4 and mkv are just 'containers' and infact mkv is a superior (for various reasons) format. Makemkv has option to reencode or leave original video/ausio streams.

Btw it is best to use something like pastebin.com or similar service

Also curious what mediainfo says about the files because handbrake does appear to use same encoding settings. Does your cpu usage stay high during slow encoding? x264 on very fast preset should be much faster than 20fps... Maybe it's only restricted on one core/thread or something
https://mediaarea.net/en/MediaInfo

The next thing I would do is to start using x264 directly (or through ffmpeg) and look to see if same behavior exists.

Maybe also try an ubuntu/linux live usb, install handbrake, and see if same behavior exists.
 

martindp

Commendable
Oct 4, 2016
4
0
1,510
Hi, I've tried today to go back to episodes of Star Trek that ripped quickly - and they rip just as quickly as the first time I ripped them, which is odd. I've also managed to get Handbrake to rip an episode of Friends as quickly as it was ripping before, but now there seems to be another issue (or a development of the current one? I don't know) - I put the disk in the drive, fire up Handbrake, and tell it to scan the source disk. It spends about 30 seconds looking at it then tells me there's nothing on the disk? The title list comes up empty.

If I scan the disk in MakeMKV first, then re-scan in Handbrake, then it works fine.

Here is the mediainfo output for two episodes previously ripped

A fast one - http://pastebin.com/8zMXpPEN
A slow one - http://pastebin.com/G9BEtJLr

The CPU usage is normally steady around 45-56% when Handbrake is encoding and it's been the same whether it is ripping quickly, or slowly.
 
I would report this to the handbrake developers in their forum or on IRC since it seems to be a disc specific issue.

Again though I dont ever use handbrake. Just rip with makemkv, then optionally reencode with ffmpeg/x264

Btw your cpu usage should be near 100% while encoding so definitely you are experiencing a bottle neck from your dvd drive speed
 

martindp

Commendable
Oct 4, 2016
4
0
1,510
Thanks for all your help :) I'm starting to wonder, though, if it might be hardware failure on the part of the DVD drive after all because even now I've got it ripping at a decent speed again, the ripped video files are shocking quality, all stuttery and unwatchable. I'll give a couple of your other suggestions a try when i get some spare time like the live boot of Linux and see if that works but if it does end up being the drive at least they're not bank-breakers any more :)
 

Richard_231

Prominent
Apr 4, 2017
1
0
510
Very similar to the original issue posted here, about a month or so ago my version of handbrake started ripping painfully slowly. Previously DVDs were ripping in about half the time of the feature itself, so generally about 45 mins to an hour. However, now it takes between 3 and 5 hours to rip an average length movie. I'm sure originally I tried tweaking the rip settings but as I didn't really know what I was doing I just used the "Normal" preset. Looking at the mediainfo output I can't identify any significant differences between a pre and post problem video. I've done all I can think of to ensure that the DVD drive is working properly, but nothing seems to make any difference.

Ripping does start off reasonably quickly at anywhere between 50 and 100 FPS, but after a while it will slow down, sometimes to less than 1 FPS. I would imagine that CPU usage elsewhere can have some impact on it, but even when I just leave it to do it's thing it still slows right down and ripping consistently takes twice as long as the actual movie duration.

I'm stumped! I'm fairly proficient at user level interaction with computers but when it comes to changing setting and doing stuff behind the scenes, I'm less confident/knowledgeable. So any help or advice would be greatly appreciated!