docker-handbrake
docker-handbrake copied to clipboard
Aspect Ratio Differences
Hi,
when using the same custom preset for the docker and the GUI and the same input file I get different results.
The input file is 1920X1080 and if I use my custom preset (which I also use on other machines) I get an output of 1280X694 which is expected.
If I drop the file in the watch folder I get an output of 1280X1080 which obviously looks pretty weird!
Any idea why there should be a difference?
here is the log from the incorrect formatting via the watch folder
------- CONVERSION OUTPUT Fri Feb 23 11:27:35 UTC 2018 ------- [11:27:35] hb_init: starting libhb thread [11:27:35] thread 7f304693aae8 started ("libhb") HandBrake 1.0.7 (2018021400) - Linux x86_64 - https://handbrake.fr 4 CPUs detected Opening /watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv... [11:27:35] CPU: Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz [11:27:35] - Intel microarchitecture Broadwell [11:27:35] - logical processor count: 4 [11:27:35] hb_scan: path=/watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv, title_index=1 udfread ERROR: ECMA 167 Volume Recognition failed disc.c:317: failed opening UDF image /watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv disc.c:418: error opening file BDMV/index.bdmv disc.c:418: error opening file BDMV/BACKUP/index.bdmv [11:27:35] bd: not a bd - trying as a stream/file instead libdvdnav: Using dvdnav version 5.0.1 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:27:35] dvd: not a dvd - trying as a stream/file instead Input #0, matroska,webm, from '/watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv': Metadata: title : Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g encoder : libebml v1.3.5 + libmatroska v1.4.8 creation_time : 2018-02-23T11:25:58.000000Z Duration: 00:01:00.07, start: 0.000000, bitrate: 4092 kb/s Chapter #0:0: start 0.000000, end 60.068000 Metadata: title : (01)00:00:00:000 Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 1920x1040 [SAR 1:1 DAR 24:13], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default) Metadata: BPS : 3641623 BPS-eng : 3641623 DURATION : 00:01:00.060000000 DURATION-eng : 00:01:00.060000000 NUMBER_OF_FRAMES: 1440 NUMBER_OF_FRAMES-eng: 1440 NUMBER_OF_BYTES : 27339485 NUMBER_OF_BYTES-eng: 27339485 _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit _STATISTICS_WRITING_DATE_UTC: 2018-02-23 11:25:58 _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-23 11:25:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default) Metadata: BPS : 448000 BPS-eng : 448000 DURATION : 00:01:00.064000000 DURATION-eng : 00:01:00.064000000 NUMBER_OF_FRAMES: 1877 NUMBER_OF_FRAMES-eng: 1877 NUMBER_OF_BYTES : 3363584 NUMBER_OF_BYTES-eng: 3363584 _STATISTICS_WRITING_APP: mkvmerge v20.0.0 ('I Am The Sun') 64-bit _STATISTICS_WRITING_APP-eng: mkvmerge v20.0.0 ('I Am The Sun') 64-bit _STATISTICS_WRITING_DATE_UTC: 2018-02-23 11:25:58 _STATISTICS_WRITING_DATE_UTC-eng: 2018-02-23 11:25:58 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES [11:27:35] scan: decoding previews for title 1 [11:27:35] scan: audio 0x1: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
Scanning title 1 of 1, preview 3, 30.00 % Scanning title 1 of 1, preview 6, 60.00 % Scanning title 1 of 1, preview 8, 80.00 %[11:27:36] scan: 10 previews, 1920x1040, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
Scanning title 1 of 1, preview 10, 100.00 %[11:27:36] libhb: scan thread found 1 valid title(s)
- Using preset: myhd720P
- title 1:
- stream: /watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv
- duration: 00:01:00
- size: 1920x1040, pixel aspect: 1/1, display aspect: 1.85, 23.976 fps
- autocrop: 0/0/0/0
- support opencl: no
- chapters:
- 1: cells 0->0, 0 blocks, duration 00:01:00
- audio tracks:
- 1, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 448000bps
- subtitle tracks:
[11:27:36] 1 job(s) to process
[11:27:36] json job:
{
"Audio": {
"AudioList": [
{
"Bitrate": 0,
"DRC": 0.0,
"Encoder": "copy:ac3",
"Mixdown": "none",
"PresetEncoder": "copy",
"Quality": -3.0,
"Samplerate": 0,
"Track": 0
}
],
"CopyMask": [
"copy:mp3",
"copy:aac",
"copy:ac3",
"copy:dts",
"copy:dtshd",
"copy:eac3",
"copy:truehd"
],
"FallbackEncoder": "ac3"
},
"Destination": {
"ChapterList": [
{
"Name": "(01)00:00:00:000"
}
],
"ChapterMarkers": false,
"File": "/output/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv",
"Mp4Options": {
"IpodAtom": false,
"Mp4Optimize": false
},
"Mux": "mkv"
},
"Filters": {
"FilterList": [
{
"ID": 6,
"Settings": {
"mode": 1
}
},
{
"ID": 11,
"Settings": {
"crop-bottom": 0,
"crop-left": 0,
"crop-right": 0,
"crop-top": 0,
"height": 1040,
"width": 1280
}
}
]
},
"Metadata": {
"Name": "Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g"
},
"PAR": {
"Den": 1,
"Num": 1
},
"SequenceID": 0,
"Source": {
"Angle": 0,
"Path": "/watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv",
"Range": {
"End": 1,
"Start": 1,
"Type": "chapter"
},
"Title": 1
},
"Subtitle": {
"Search": {
"Burn": true,
"Default": false,
"Enable": false,
"Forced": false
},
"SubtitleList": []
},
"Video": {
"ColorMatrixCode": 0,
"Encoder": "x265",
"Level": "",
"OpenCL": false,
"Options": "",
"Preset": "fast",
"Profile": "auto",
"QSV": {
"AsyncDepth": 4,
"Decode": true
},
"Quality": 21.0,
"Tune": "",
"Turbo": false,
"TwoPass": false
}
}
[11:27:36] starting job
[11:27:36] job configuration:
[11:27:36] * source
[11:27:36] + /watch/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv
[11:27:36] + title 1, chapter(s) 1 to 1
[11:27:36] + container: matroska,webm
[11:27:36] + data rate: 4092 kbps
[11:27:36] * destination
[11:27:36] + /output/Mr. Brooks 2007 BluRay 10Bit 1080p DD5.1 H265-d3g (1)-002.mkv
[11:27:36] + container: Matroska (libavformat)
[11:27:36] * video track
[11:27:36] + decoder: hevc
[11:27:36] + filters
[11:27:36] + Framerate Shaper (mode=1)
[11:27:36] + frame rate: 23.976 fps -> constant 23.976 fps
[11:27:36] + Crop and Scale (width=1280:height=1040:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[11:27:36] + source: 1920 * 1040, crop (0/0/0/0): 1920 * 1040, scale: 1280 * 1040
[11:27:36] + Output geometry
[11:27:36] + storage dimensions: 1280 x 1040
[11:27:36] + pixel aspect ratio: 1 : 1
[11:27:36] + display dimensions: 1280 x 1040
[11:27:36] + encoder: H.265 (libx265)
[11:27:36] + preset: fast
[11:27:36] + profile: auto
[11:27:36] + quality: 21.00 (RF)
[11:27:36] * audio track 1
[11:27:36] + decoder: English (AC3) (5.1 ch) (track 1, id 0x1)
[11:27:36] + bitrate: 448 kbps, samplerate: 48000 Hz
[11:27:36] + AC3 Passthru
[11:27:36] sync: expecting 1440 video frames
x265 [info]: HEVC encoder version 2.3
x265 [info]: build info [Linux][GCC 6.3.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 2 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-21.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
[11:27:36] sync: first pts video is 0
[11:27:36] sync: "(01)00:00:00:000" (1) at frame 1 time 0
[11:27:36] sync: first pts audio 0x1 is 360
[11:28:49] reader: done. 1 scr changes
[11:28:53] work: average encoding speed for job is 18.976942 fps
[11:28:53] vfr: 1440 frames output, 0 dropped and 0 duped for CFR/PFR
[11:28:53] vfr: lost time: 0 (0 frames)
[11:28:53] vfr: gained time: 0 (0 frames) (0 not accounted for)
[11:28:53] ac3-decoder done: 1877 frames, 0 decoder errors
[11:28:53] hevc-decoder done: 1440 frames, 0 decoder errors
[11:28:53] sync: got 1440 frames, 1440 expected
[11:28:53] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
x265 [info]: frame I: 9, Avg QP:17.34 kb/s: 7674.12
x265 [info]: frame P: 286, Avg QP:20.42 kb/s: 2821.82
x265 [info]: frame B: 1145, Avg QP:25.34 kb/s: 366.66
x265 [info]: Weighted P-Frames: Y:12.2% UV:1.7% x265 [info]: consecutive B-frames: 2.4% 0.3% 0.3% 0.7% 96.3%
encoded 1440 frames in 77.47s (18.59 fps), 899.96 kb/s, Avg QP:24.32 [11:28:53] mux: track 0, 1440 frames, 6762183 bytes, 900.10 kbps, fifo 2048 [11:28:53] mux: track 1, 1877 frames, 3363584 bytes, 447.72 kbps, fifo 2048 [11:28:53] libhb: work result = 0
Encode done! HandBrake has exited.
I have been doing some experimenting with this...
I have changed my custom present 3-4 times and removed the docker and reloaded but I still always get 1280X1084
I have also tried customizing an existing preset which although I get 1280X720 nothing I can do will make the sound passthrough (like I can make happen on my custom preset) it ALWAYS encodes even though I have removed encoding audio.. any help would be greatly appreciated! its all so close to being perfect!
For the aspect ratio, do you have the same behaviour for all your files or only a specific one?
Can you provide some screenshots showing your audio preset settings?
Hi,
I get the same issue on all files I have tried.
I am using my custom preset (in the log you can see it is called myhd720P
The Sound is doing exactly what it should which is passing through.
The docker works as expected but only if I use the GUI but it is via the watch folder is where the height goes wrong.
here are 2 files for example
Mr Brooks Original Aspect 1920X1040 GUI automatically correctly guesses the output 1280X694 but via the watch folder I get 1280X1080
Dr Zhivago Original Aspect 1920X800 GUI automatically correctly guesses the output 1280X534 but via the watch folder I get 1280X694
Hopefully this may be of help... it is a folder containing 2 encodes of the same file, one was done via the GUI and the other via the Watch Folder, I have included also the logs for each encode.. The GUI correctly chooses 594 as the height and the Watch folder chooses incorrectly 694 as the height. Same file, same preset. Hope you can help me :-) https://1drv.ms/f/s!AjnJhtmhYMJlhqYt1WhXLwAZCQT5Rg
Are you using the latest version of the container image? If yes, can you try with the previous version (1.11.2) to see if you have the same behaviour?
I am using the latest as I just followed this instructions on this page, how do I specify a version?
In your docker run
command, just use jlesage/handbrake:v1.11.2
instead of jlesage/handbrake
for the repository.
Hi, I removed the old image and reloaded with 1.11.2 but now I get 1280X720??? I have uploaded the conversion log into the onedrive folder (https://1drv.ms/f/s!AjnJhtmhYMJlhqYt1WhXLwAZCQT5Rg) and also a screenshot of the handbrake GUI that proves the preset auto selects the aspect ratio from 1920X800 to 1280X534 as it should do but for whatever reason the watch folder is not able to select the correct height despite being the same preset?
Thanks for all your time on this...
Did you get distorted image or it encoded black bars?
Also, if you use one of the default preset (like Fast 720p30
) without changing any setting, do you get the same result?
Hi, the video results are in the onedrive folder I shared, you will see it is distorted using my custom preset myhd720p but only when using the watch folder, the preset works when using the GUI
I just tried using the default fast 720p30 and although it outputs 1280X720 instead of 1280X594 like my preset does it looks great! (Does this mean it is encoding the black bars?)
I think the video I was talking about is not on OneDrive. I was talking about the video you got with version 1.11.2: it has a different resolution of 1280x720, while the one with the latest version had a resolution of 1280X694.
My apologies, I have now added myhd720p custom preset result & the veryfast720p30 result to onedrive..
Is the video for veryfast720p30 the right one? You said that it has a resolution of 1280x720, but the one on OneDrive has 1920x800.
Again! Apologies!
I accidentally uploaded the source.. the encode is there now :-)
Sorry I didn't had time to look at this... Trying to push some fixes for HandBrake.
However, since the veryfast720p30
preset is working better, did you compared with your preset to see the differences?
Also, I was not able to confirm if the auto-crop feature is something that should be working with the CLI... It doesn't seems to have an argument for this feature and I don't know if it will pick up the option in the preset file. Do you have more details in this regard?
Hi,
Sorry for my delay too I have been unwell..
The difference between veryfast720p30 and my own is that on my preset Anamorphic is disabled on my preset and enabled on veryfast720p30 I have however tried disabling it on my preset with no difference :-(
As for CLI I have never used it.. I am just using the preset that I have on several machines where the encoding works perfectly and trying to apply it to your docker. I am sure it must be possible to do through CLI as the GUI I would imaging just uses the same parameters as CLI it is just prettier/easier?
That's what I would assume... But that's obviously not the case.
Can you also upload a part of the original movie and your preset file (found under ghb/presets.json
in your appdata folder)?
Hi, All uploaded, if you load the file segment into the GUI using my preset you will see that handbrake automatically chooses 1280X534 which is what I am trying to achieve.
Many Thanks Again!
Do you still have issue with this? For me, it seems that enabling anamorphic (to loose) fixed the problem.
Hello, I think the same problem got me here. If I use the GUI with a custom preset it keeps the aspect ratio (720x406 in my case), if I use the watch folder it doesn't and makes the video 720x480. The preset seems ok, "PictureKeepRatio" is set to true.
How can I make Handbrake keep aspect ratio when using watch folders?
Thank you!
"PictureAutoCrop": true,
"PictureBottomCrop": 0,
"PictureCombDetectCustom": "",
"PictureCombDetectPreset": "default",
"PictureDARWidth": 0,
"PictureDeblock": 0,
"PictureDeblockCustom": "qp=0:mode=2",
"PictureDeinterlaceCustom": "",
"PictureDeinterlaceFilter": "decomb",
"PictureDeinterlacePreset": "default",
"PictureDenoiseCustom": "",
"PictureDenoiseFilter": "off",
"PictureDenoisePreset": "",
"PictureDenoiseTune": "none",
"PictureDetelecine": "off",
"PictureDetelecineCustom": "",
"PictureForceHeight": 0,
"PictureForceWidth": 0,
"PictureHeight": 480,
"PictureItuPAR": false,
"PictureKeepRatio": true,
"PictureLeftCrop": 0,
"PictureLooseCrop": false,
"PictureModulus": 2,
"PicturePAR": "off",
"PicturePARHeight": 1,
"PicturePARWidth": 1,
"PictureRightCrop": 0,
"PictureRotate": "disable=1",
"PictureSharpenCustom": "",
"PictureSharpenFilter": "off",
"PictureSharpenPreset": "",
"PictureSharpenTune": "",
"PictureTopCrop": 0,
"PictureWidth": 720,
Did you try to enable anamorphic and set it to loose?
"PicturePAR": "loose"
It worked! Thank you!
Hi! I'm super grateful for this job. Thank you very much jlesage for your effort and your time. Fortunately I had this inconvenience a few hours ago and found the problem. It turns out, that HB's graphical interface saves profiles with the last configuration applied with the video that was used to generate the profile or with the default values that are applied when you don't load a video and save a profile. In my experiments, I found it viable to save the profiles using the following settings:
Anamorphic: loose Resolution: Width: 0 | Height: 720px Aspect Ratio: 1:1
Then, when the profile is saved, you must manually edit these values in the profile file "profile.json" with a text editor so that they are as follows:
"PicturePAR": "loose", "PicturePARHeight": 0, "PicturePARWidth: 0, "PictureWidth: 0,
Thus, the CLI will automatically decide the aspect ratio and horizontal resolution and the video will be well formed in players that do not support anamorphic video. It would be great to apply a parameter in the RUN file to omit these parameters on demand, perhaps with an environment variable? Any algorithm? I don't know, I leave it to you. Greetings!