75lb / handbrake-js

Video encoding / transcoding / converting for node.js
Other
550 stars 69 forks source link

Use preset from the handbrake app #72

Closed Caligulaa closed 2 years ago

Caligulaa commented 2 years ago

Hi, i'm trying to setup a program to batch encode a large amount of files. I setup a preset in the handbrake app & exported as a json file. I've tried to spread the data from the json file in the options object with no luck. Is such a thing available with this library?

Other: HandbrakeCLI reported "unknown option", please report this issue: https://github.com/75lb/handbrake-js/issues/new

Thanks!

short sample of options im trying to use:

SubtitleBurnBDSub: false,
SubtitleBurnDVDSub: false,
SubtitleLanguageList: [ 'fra', 'eng', 'spa' ],
SubtitleTrackSelectionBehavior: 'all',
VideoAvgBitrate: 18000,
VideoColorMatrixCode: 0,
VideoEncoder: 'nvenc_h264',
VideoFramerate: '30',
VideoFramerateMode: 'pfr',
VideoGrayScale: false,
VideoScaler: 'swscale',
Caligulaa commented 2 years ago

Got it to work:

  const options = {
    input: file,
    output: base + "2low.mkv",
    "preset-import-gui": presets,
    preset: "yourcustompreset",
  };

presets is the json file that i exported from handbrake, make sure to use same version of handbrake gui that you have with handbrakejs.

:)