Create Batch File to use same settings for many recording files?

HandBrake for Mac support
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
iCloud
Posts: 5
Joined: Sat Feb 18, 2023 3:53 am

Create Batch File to use same settings for many recording files?

Post by iCloud »

Description of problem or question:

I am working on a planning a project that will take MKV files that I had made from a collection of DVDs - to convert them into files that I can play easily on my iPhone/iPad/Mac and via Plex on my Apple TV. Each episode/title is already a separate file.

In the past, I have had to configure each and every file one by one, and have had to manually reset each setting that I want to use.

Is there a way to do this in batch? Either via the GUI or Command Line?


Steps to reproduce the problem (If Applicable):




HandBrake version (e.g., 1.0.0):

1.6.1


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

MacOS 13.2.1 (22D68)


HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

[22:59:01] macgui: Handbrake Version: 1.6.1 (2023012200)
[22:59:01] Compile-time hardening features are enabled
[22:59:03] macgui: built-in presets updated
[22:59:03] macgui: Error domain: HBKitErrorDomain
[22:59:03] macgui: Error code: 1
[22:59:03] macgui: Error description: Failed to decode _job
[22:59:03] macgui: Error debug description: Error Domain=HBKitErrorDomain Code=1 "Failed to decode _job" UserInfo={NSLocalizedDescription=Failed to decode _job}
[22:59:03] hb_init: starting libhb thread
[22:59:03] thread 70000fcc2000 started ("libhb")
[22:59:03] macgui: Error domain: NSCocoaErrorDomain
[22:59:03] macgui: Error code: 259
[22:59:03] macgui: Error description: The file couldn’t be opened because it isn’t in the correct format.
[22:59:03] macgui: Error debug description: Error Domain=NSCocoaErrorDomain Code=259 "The file couldn’t be opened because it isn’t in the correct format."
[22:59:33] macgui: ScanCore scanning titles with a duration of 10 seconds or more
[22:59:33] CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
[22:59:33]  - Intel microarchitecture Kaby Lake
[22:59:33]  - logical processor count: 8
[22:59:33] hb_scan: path=/Users/gmh/Movies/EMERGENCY/S6D3/C4_t03.mkv, title_index=0
[22:59:33] thread 70000fa33000 started ("scan")
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /Users/gmh/Movies/EMERGENCY/S6D3/C4_t03.mkv
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
[22:59:33] bd: not a bd - trying as a stream/file instead
libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[22:59:33] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/Users/gmh/Movies/EMERGENCY/S6D3/C4_t03.mkv':
  Metadata:
    encoder         : libmakemkv v1.17.3 (1.3.10/1.5.2) darwin(x64-release)
    creation_time   : 2023-02-18T02:55:12.000000Z
  Duration: 00:47:23.41, start: 0.000000, bitrate: 5676 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 507.039867
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 507.039867, end 1799.164033
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 1799.164033, end 2088.953533
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 2088.953533, end 2843.407233
      Metadata:
        title           : Chapter 04
  Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn
    Metadata:
      BPS-eng         : 5473005
      DURATION-eng    : 00:47:23.407233333
      NUMBER_OF_FRAMES-eng: 68174
      NUMBER_OF_BYTES-eng: 1945247760
      SOURCE_ID-eng   : 0100E0
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2023-02-18 02:55:12
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Side data:
      cpb: bitrate max/min/avg: 9800000/0/0 buffer size: 1835008 vbv_delay: N/A
  Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      title           : Stereo
      BPS-eng         : 192000
      DURATION-eng    : 00:47:23.392000000
      NUMBER_OF_FRAMES-eng: 88856
      NUMBER_OF_BYTES-eng: 68241408
      SOURCE_ID-eng   : 0180BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2023-02-18 02:55:12
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:2(eng): Subtitle: dvd_subtitle, 720x480 (default)
    Metadata:
      BPS-eng         : 6935
      DURATION-eng    : 00:46:24.080255555
      NUMBER_OF_FRAMES-eng: 870
      NUMBER_OF_BYTES-eng: 2413564
      SOURCE_ID-eng   : 0120BD
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.17.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2023-02-18 02:55:12
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[22:59:33] Found ffmpeg 4 chapters, container=matroska,webm
[22:59:33] Added chapter 1, name='Chapter 1', dur=45633587, (00:08:27)
[22:59:33] Added chapter 2, name='Chapter 2', dur=116291175, (00:21:32)
[22:59:33] Added chapter 3, name='Chapter 3', dur=26081055, (00:04:50)
[22:59:33] Added chapter 4, name='Chapter 4', dur=67900813, (00:12:34)
[22:59:33] scan: decoding previews for title 1
[22:59:33] scan: preview 1
[22:59:33] fifo_close: trashing 0 buffer(s)
[22:59:33] scan: audio 0x1: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[22:59:33] scan: preview 2
[22:59:33] scan: preview 3
[22:59:33] scan: preview 4
[22:59:33] scan: preview 5
[22:59:33] scan: preview 6
[22:59:33] scan: preview 7
[22:59:33] scan: preview 8
[22:59:33] scan: preview 9
[22:59:33] scan: preview 10
[22:59:33] scan: preview 11
[22:59:34] scan: preview 12
[22:59:34] scan: preview 13
[22:59:34] scan: preview 14
[22:59:34] scan: preview 15
[22:59:34] scan: preview 16
[22:59:34] scan: preview 17
[22:59:34] scan: preview 18
[22:59:34] scan: preview 19
[22:59:34] scan: preview 20
[22:59:34] Pulldown detected, setting fps to 23.976
[22:59:34] crop: [0] 0/2/0/0
[22:59:34] crop: [1] 0/2/0/0
[22:59:34] crop: [2] 0/2/0/0
[22:59:34] crop: [3] 0/2/0/0
[22:59:34] crop: [4] 0/2/0/0
[22:59:34] crop: [5] 0/2/0/0
[22:59:34] crop: [6] 0/2/0/0
[22:59:34] crop: [7] 0/2/0/0
[22:59:34] crop: [8] 0/2/0/0
[22:59:34] crop: [9] 0/2/0/0
[22:59:34] crop: [10] 0/2/0/0
[22:59:34] crop: [11] 0/2/0/0
[22:59:34] crop: [12] 0/2/0/0
[22:59:34] crop: [13] 0/2/0/0
[22:59:34] crop: [14] 0/2/0/0
[22:59:34] crop: [15] 0/2/0/0
[22:59:34] crop: [16] 0/2/0/0
[22:59:34] crop: [17] 0/2/0/0
[22:59:34] crop: [18] 0/2/0/0
[22:59:34] crop: less_than_median_frame_count: 0,
[22:59:34] scan: 20 previews, 720x480, 23.976 fps, autocrop = 0/2/0/0, aspect 4:3, PAR 8:9, color profile: 6-1-6, chroma location: left
[22:59:34] Freed 1 buffers of size 1024
[22:59:34] Freed 1 buffers of size 8192
[22:59:34] Freed 1 buffers of size 16384
[22:59:34] Freed 1 buffers of size 32768
[22:59:34] Freed 1 buffers of size 65536
[22:59:34] Freed 1 buffers of size 131072
[22:59:34] Freed 2 buffers of size 1048576
[22:59:34] Allocated 2352128 bytes of buffers on this pass and Freed 2352128 bytes, 0 bytes leaked
[22:59:34] thread 70000fa33000 exited ("scan")
[22:59:34] thread 70000fa33000 joined ("scan")
[22:59:34] libhb: scan thread found 1 valid title(s)
[22:59:34] macgui: ScanCore scan done
[22:59:34] thread 7000105f8000 started ("yadif_filter_segment")
[22:59:34] thread 70001067b000 started ("yadif_filter_segment")
[22:59:34] thread 7000106fe000 started ("yadif_filter_segment")
[22:59:34] thread 700010781000 started ("yadif_filter_segment")
[22:59:34] thread 700010804000 started ("yadif_filter_segment")
[22:59:34] thread 700010887000 started ("yadif_filter_segment")
[22:59:34] thread 70001090a000 started ("yadif_filter_segment")
[22:59:34] thread 70001098d000 started ("yadif_filter_segment")
[22:59:34] thread 7000105f8000 exited ("yadif_filter_segment")
[22:59:34] thread 70001067b000 exited ("yadif_filter_segment")
[22:59:34] thread 7000106fe000 exited ("yadif_filter_segment")
[22:59:34] thread 700010804000 exited ("yadif_filter_segment")
[22:59:34] thread 700010781000 exited ("yadif_filter_segment")
[22:59:34] thread 700010887000 exited ("yadif_filter_segment")
[22:59:34] thread 70001090a000 exited ("yadif_filter_segment")
[22:59:34] thread 70001098d000 exited ("yadif_filter_segment")
[22:59:34] thread 7000105f8000 joined ("yadif_filter_segment")
[22:59:34] thread 70001067b000 joined ("yadif_filter_segment")
[22:59:34] thread 7000106fe000 joined ("yadif_filter_segment")
[22:59:34] thread 700010781000 joined ("yadif_filter_segment")
[22:59:34] thread 700010804000 joined ("yadif_filter_segment")
[22:59:34] thread 700010887000 joined ("yadif_filter_segment")
[22:59:34] thread 70001090a000 joined ("yadif_filter_segment")
[22:59:34] thread 70001098d000 joined ("yadif_filter_segment")
[22:59:34] fifo_close: trashing 0 buffer(s)
[22:59:34] fifo_close: trashing 0 buffer(s)
[22:59:34] fifo_close: trashing 1 buffer(s)

iCloud
Posts: 5
Joined: Sat Feb 18, 2023 3:53 am

Re: Create Batch File to use same settings for many recording files?

Post by iCloud »

Thank you. Is there a way to get the settings from the GUI to use in the Command Line Interface? This way I can do it once and just change the file names.
mduell
Veteran User
Posts: 7897
Joined: Sat Apr 21, 2007 8:54 pm

Re: Create Batch File to use same settings for many recording files?

Post by mduell »

You can save a preset, and then use that preset from the CLI.

Better to just pick the CLI options you want, IMO.
iCloud
Posts: 5
Joined: Sat Feb 18, 2023 3:53 am

Re: Create Batch File to use same settings for many recording files?

Post by iCloud »

I have a preset "G 720x480 Apple 1080p30 Surround B - Test" however, I cannot get it to save my Subtitles settings. Where I want the 0: English [VOBSUB] Subtitles not to be Burned In, But be the Default.

I exported the Preset to JSON so that I can show it here. Any suggestions? Is there a way to translate this in to the CLI? (sorry for all the questions, I am new to the CLI version of Handbrake, and just dont want to have to manage over 100 videos separately.)

Code: Select all

{
  "PresetList" : [
    {
      "AlignAVStart" : false,
      "AudioCopyMask" : [
        "copy:aac",
        "copy:ac3"
      ],
      "AudioEncoderFallback" : "ca_aac",
      "AudioLanguageList" : [

      ],
      "AudioList" : [
        {
          "AudioBitrate" : 160,
          "AudioEncoder" : "ca_aac",
          "AudioMixdown" : "stereo",
          "AudioSamplerate" : "auto",
          "AudioTrackDRCSlider" : 0,
          "AudioTrackGainSlider" : 0
        },
        {
          "AudioBitrate" : 640,
          "AudioEncoder" : "copy:ac3",
          "AudioMixdown" : "5point1",
          "AudioSamplerate" : "auto",
          "AudioTrackDRCSlider" : 0,
          "AudioTrackGainSlider" : 0
        }
      ],
      "AudioSecondaryEncoderMode" : true,
      "AudioTrackSelectionBehavior" : "first",
      "ChapterMarkers" : true,
      "ChildrenArray" : [

      ],
      "Default" : false,
      "FileFormat" : "av_mp4",
      "Folder" : false,
      "FolderOpen" : false,
      "InlineParameterSets" : false,
      "MetadataPassthrough" : true,
      "Mp4HttpOptimize" : false,
      "Mp4iPodCompatible" : false,
      "PictureAllowUpscaling" : false,
      "PictureAutoCrop" : false,
      "PictureBottomCrop" : 0,
      "PictureChromaSmoothCustom" : "",
      "PictureChromaSmoothPreset" : "off",
      "PictureChromaSmoothTune" : "none",
      "PictureColorspaceCustom" : "",
      "PictureColorspacePreset" : "off",
      "PictureCombDetectCustom" : "",
      "PictureCombDetectPreset" : "default",
      "PictureCropMode" : 2,
      "PictureDARWidth" : 640,
      "PictureDeblockCustom" : "strength=strong:thresh=20:blocksize=8",
      "PictureDeblockPreset" : "off",
      "PictureDeblockTune" : "medium",
      "PictureDeinterlaceCustom" : "",
      "PictureDeinterlaceFilter" : "decomb",
      "PictureDeinterlacePreset" : "default",
      "PictureDenoiseCustom" : "",
      "PictureDenoiseFilter" : "off",
      "PictureDenoisePreset" : "light",
      "PictureDenoiseTune" : "none",
      "PictureDetelecine" : "off",
      "PictureDetelecineCustom" : "",
      "PictureForceHeight" : 0,
      "PictureForceWidth" : 0,
      "PictureHeight" : 0,
      "PictureItuPAR" : false,
      "PictureKeepRatio" : true,
      "PictureLeftCrop" : 0,
      "PictureModulus" : 2,
      "PicturePadBottom" : 0,
      "PicturePadColor" : "black",
      "PicturePadLeft" : 0,
      "PicturePadMode" : "none",
      "PicturePadRight" : 0,
      "PicturePadTop" : 0,
      "PicturePAR" : "auto",
      "PicturePARHeight" : 9,
      "PicturePARWidth" : 8,
      "PictureRightCrop" : 0,
      "PictureRotate" : "angle=0:hflip=0",
      "PictureSharpenCustom" : "",
      "PictureSharpenFilter" : "off",
      "PictureSharpenPreset" : "medium",
      "PictureSharpenTune" : "none",
      "PictureTopCrop" : 0,
      "PictureUseMaximumSize" : true,
      "PictureWidth" : 0,
      "PresetDescription" : "",
      "PresetDisabled" : false,
      "PresetName" : "G 720x480 Apple 1080p30 Surround B - Test",
      "SubtitleAddCC" : true,
      "SubtitleAddForeignAudioSearch" : true,
      "SubtitleAddForeignAudioSubtitle" : false,
      "SubtitleBurnBDSub" : true,
      "SubtitleBurnBehavior" : "foreign",
      "SubtitleBurnDVDSub" : true,
      "SubtitleLanguageList" : [
        "eng"
      ],
      "SubtitleTrackSelectionBehavior" : "all",
      "Type" : 1,
      "UsesPictureFilters" : true,
      "VideoAvgBitrate" : 6000,
      "VideoColorMatrixCodeOverride" : 0,
      "VideoEncoder" : "vt_h264",
      "VideoFramerate" : "30",
      "VideoFramerateMode" : "pfr",
      "VideoGrayScale" : false,
      "VideoHWDecode" : 0,
      "VideoLevel" : "4.0",
      "VideoOptionExtra" : "",
      "VideoPreset" : "quality",
      "VideoProfile" : "high",
      "VideoQSVDecode" : false,
      "VideoQualitySlider" : 22,
      "VideoQualityType" : 1,
      "VideoScaler" : "swscale",
      "VideoTune" : "",
      "VideoTurboTwoPass" : false,
      "VideoTwoPass" : true,
      "x264Option" : "",
      "x264UseAdvancedOptions" : false
    }
  ],
  "VersionMajor" : 50,
  "VersionMicro" : 0,
  "VersionMinor" : 0
}
mduell
Veteran User
Posts: 7897
Joined: Sat Apr 21, 2007 8:54 pm

Re: Create Batch File to use same settings for many recording files?

Post by mduell »

You can't do that with those subs in that container.
Post Reply