Convert bat with current settings to x265

Discussion of the HandBrake command line interface (CLI)
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
Diovarus
Posts: 3
Joined: Sat Apr 28, 2018 6:05 pm

Convert bat with current settings to x265

Post by Diovarus »

Description of problem or question:

Hi I use this code script in bat file for converting movies to mkv with q26 and x264.
Now i want to use the same settings for x265. Whats need to be replaced?
I'm not very good in coding just in puttings things to getter.
When done i want one bat file to make it or x264 of x265 with goto commands.

But the big question now is how to make it run in x265





HandBrake version (e.g., 1.0.0):
1.1.0

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

Code: Select all

@echo off

ECHO.
ECHO .................................................................
set /p moviename= " Filename: "

move "%moviename%".mkv Core\
cd Core

HandBrakeCLI -i "%moviename%".mkv -o "%moviename%-[26.x264].mkv" -w 1280 -E ffaac -B 96k -6 stereo -R 44.1 -e x264 -q 26 -x cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all


move "%moviename%".mkv ../Source
move "%moviename%"-[26.x264].mkv ../Finished

pause
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Convert bat with current settings to x265

Post by Woodstock »

Change "-e x264" to "-e x265" to start with.
Diovarus
Posts: 3
Joined: Sat Apr 28, 2018 6:05 pm

Re: Convert bat with current settings to x265

Post by Diovarus »

Woodstock wrote: Sat Apr 28, 2018 8:03 pm Change "-e x264" to "-e x265" to start with.
Sorry needed to say i tried that.
Get this error

[22:33:38] * audio track 1
[22:33:38] + decoder: English (AC3) (5.1 ch) (track 1, id 0x1)
[22:33:38] + bitrate: 384 kbps, samplerate: 48000 Hz
[22:33:38] + mixdown: Stereo
[22:33:38] + encoder: AAC (libavcodec)
[22:33:38] + bitrate: 96 kbps, samplerate: 44100 Hz
[22:33:38] sync: expecting 151489 video frames
[22:33:38] encx265: unknown option 'cabac'
[22:33:38] encx265: unknown option 'analyse'
[22:33:38] encx265: unknown option 'chroma-me'
[22:33:38] encx265: unknown option 'deadzone-inter'
[22:33:38] encx265: unknown option 'deadzone-intra'
[22:33:38] encx265: unknown option 'direct'
[22:33:38] encx265: bad argument 'weightp=2'
[22:33:38] encx265: unknown option 'chroma-qp-offset'
[22:33:38] encx265: unknown option 'sync-lookahead'
[22:33:38] encx265: bad argument 'psy-rd=1.00,0.15'
[22:33:38] encx265: unknown option 'trellis'
[22:33:38] encx265: unknown option 'partitions'
x265 [info]: HEVC encoder version 2.6
x265 [info]: build info [Windows][GCC 7.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [error]: subme must be less than or equal to X265_MAX_SUBPEL_LEVEL (7)
ERROR: encx265: x265_encoder_open failed.
ERROR: Failure to initialise thread 'H.265/HEVC encoder (libx265)'
[22:33:38] vfr: lost time: 0 (0 frames)
[22:33:38] vfr: gained time: 0 (0 frames) (0 not accounted for)
[22:33:38] ac3-decoder done: 0 frames, 0 decoder errors
[22:33:38] h264-decoder done: 0 frames, 0 decoder errors
[22:33:38] sync: got 0 frames, 151489 expected
Encoding: task 1 of 1, 0.00 %[22:33:39] libhb: work result = 3

Encode failed (error 3).
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Convert bat with current settings to x265

Post by s55 »

[22:33:38] encx265: unknown option 'cabac'
[22:33:38] encx265: unknown option 'analyse'
[22:33:38] encx265: unknown option 'chroma-me'
[22:33:38] encx265: unknown option 'deadzone-inter'
[22:33:38] encx265: unknown option 'deadzone-intra'
[22:33:38] encx265: unknown option 'direct'
[22:33:38] encx265: bad argument 'weightp=2'
[22:33:38] encx265: unknown option 'chroma-qp-offset'
[22:33:38] encx265: unknown option 'sync-lookahead'
[22:33:38] encx265: bad argument 'psy-rd=1.00,0.15'
[22:33:38] encx265: unknown option 'trellis'
[22:33:38] encx265: unknown option 'partitions'
You can't pass x264 options to x265. They are different encoders with different options/parameters.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Convert bat with current settings to x265

Post by mduell »

Delete your extra options "-x cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all"
Diovarus
Posts: 3
Joined: Sat Apr 28, 2018 6:05 pm

Re: Convert bat with current settings to x265

Post by Diovarus »

Removed the extra options and it is working.
Even faster processing then x264, 3hours faster then before.

Thanks all
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Convert bat with current settings to x265

Post by mduell »

Sure, because you were using slow x264 settings.
Post Reply