jlesage / docker-handbrake

Docker container for HandBrake
MIT License
836 stars 96 forks source link

CPU on 35-40% with H265 encoding, 100% at h264 #165

Open Binnetie opened 3 years ago

Binnetie commented 3 years ago

First of all, great job to make it possible to run Handbrake in a Docker container!

I'm busy to convert a few old SD series from DVD9 to H265. My new NAS (Synology DS920+) can do this job, so a can use my laptop for other things. I installed Handbrake in a Docker en started a few converts. My CPU load is around 35-40%, so a encode takes around 2 hours (SD video file is 25 minutes) on slow preset in Handbrake.

H265 h264 cpu

When a change the CPU priority in Docker it doesn't change anything. First i set it to medium, then to high. The CPU goes from 35-40% to 40-50% in h265.

When i choose for H264 my cpu load is 100% h265 cpu

I would like a higher load on my CPU for H265, so it takes no 2 hours to convert a video file with a duration of 25 minutes). What can i do to fix this?

Binnetie commented 3 years ago

I've attached logfiles from 2 encodes with the same episode. One in H265 with a cpu load of 40-45% en one in H264 with 100% load.

OPPASSEN Deel 6 DVD 1 x264 2021-01-27 11-15-10.log OPPASSEN Deel 6 DVD 1 x265 10bit 2021-01-27 09-06-43.log

jlesage commented 3 years ago

I don't think this is an issue with container. You would probably have the same behaviour by running HandBrake on a standard Linux setup. I've done some quick search in the past and I've find a lot of discussion about HandBrake not using all the cores. It seems to be more evident with x265. I've seen some comments telling that you need to encode 4K videos with x265 to get full cpu usage...

maci2100 commented 3 years ago

Hi, Since ive updated the Container, i have the same issue

Kraveylicious commented 3 years ago

I've got the same issue as well, .264 using 100% and .265 hovering around 30% on my Synology using the latest Handbrake image. Current version of Handbrake on macOS (native, not docker) runs both .264 and .265 at 100%.

jlesage commented 3 years ago

@maci2100, do you know at which image version you start seeing the behaviour change ?

I guess we should try running HandBrake "natively" on Linux to see if we have the same behaviour...

andonovski commented 3 years ago

Just for info, I am running latest docker image (should be 1.23.0) on a Linux host which is a VM with 3 virtual CPUs assigned. I don't have this issue, never had it. When I encode in x265 I see all 3 virtual CPUs at 100%.

nothing2obvi commented 3 years ago

Just wanted to add I'm having the same issue as OP. Using latest docker image on Mac host.

maci2100 commented 3 years ago

@jlesage the last working build is 1.17.1

all versions above only uses less then 50% of the cpu

Kraveylicious commented 3 years ago

@jlesage can confirm as well, 1.17.1 works with full CPU utilization on H.265.

scriptchecker commented 3 years ago

I tried using 1.17 with no success but I did raise a feature request to allow multiple encodes at the same time which would solve my use of only using 30% of CPU........

rp1989 commented 3 years ago

I am also having the same issue on latest build 1.24.1. When using a custom x265 preset the CPU usage just doesn't go above 35%. I tried using the default preset 'H265 MKV 1080p30' and the CPU usage is maximum as set. Can you please look into this? Seems to only be an issue with CPU limit when using a custom preset.

rp1989 commented 3 years ago

I am also having the same issue on latest build 1.24.1. When using a custom x265 preset the CPU usage just doesn't go above 35%. I tried using the default preset 'H265 MKV 1080p30' and the CPU usage is maximum as set. Can you please look into this? Seems to only be an issue with CPU limit when using a custom preset.

Hello, Any update on this at all please?

Binnetie commented 3 years ago

I have no update. I use a custom preset. An 2-pass encode takes around 65 hours.

Binnetie commented 2 years ago

Is there any update? Encoding from a blu-ray to X265 takes a lot of time. Are there newer versions of the container that doesn't have the problem?

jlesage commented 1 year ago

Can you try the latest image ? The latest version of HandBrake seems better to max out all CPU cores when encoding :)

NamruEU commented 1 year ago

I have the same issue with the latest docker version 23.10.1 (d14a0665a26).

NamruEU commented 11 months ago

Currently running Handbrake docker container version 23.11.2 (654d24b8adc) including Handbrake 1.6.1 but the problem is still there.

scepterus commented 10 months ago

Same here, I never had this issue with handbrake on Windows native.

superboo07 commented 1 month ago

Same issue as others are having here