[ASK] How To Burn Subtitle ASS/SRT Like Hanbrake Nighly

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
vins
New User
Posts: 1
Joined: Wed Sep 18, 2019 2:54 pm

[ASK] How To Burn Subtitle ASS/SRT Like Hanbrake Nighly

Post by vins »

Dear all,

How to import subtitle like ASS or SRT and burn like Nightly Builds in CLI version
https://prnt.sc/pbzvyog

Handbrake Nightly Activity Log

Code: Select all

HandBrake Nightly 20190923171130-9336b9c-master (2019092301)
OS: Microsoft Windows NT 10.0.14393.0
CPU: Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz
Ram: 16383 MB, 
GPU Information:
  Microsoft Basic Display Adapter - 10.0.14393.0
Screen: 1366x768
Temp Dir: C:\Users\Administrator\AppData\Local\Temp\2\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\Administrator\AppData\Roaming\HandBrake\Nightly

-------------------------------------------


# Starting Encode ...

[06:03:20] base preset: 720mkv
[18:03:20] hb_init: starting libhb thread
[18:03:20] Starting work at: Fri Sep 27 18:03:20 2019
[18:03:20] 1 job(s) to process
[18:03:20] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 96,
        "DRC": 0.0,
        "Encoder": "av_aac",
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:ac3",
      "copy:dtshd",
      "copy:dts",
      "copy:eac3",
      "copy:flac",
      "copy:mp3",
      "copy:truehd"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "C:\\Users\\Administrator\\Desktop\\test.mkv",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": "mkv"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "40",
          "block-width": "16",
          "filter-mode": "2",
          "mode": "3",
          "motion-thresh": "1",
          "spatial-metric": "2",
          "spatial-thresh": "1"
        }
      },
      {
        "ID": 12,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "720",
          "width": "1280"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1",
          "rate": "27000000/900900"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "C:\\Users\\Administrator\\Desktop\\KSHMR x KAAZE - Devil Inside Me (feat. KARRA) [Official Lyric Video].mp4"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": [
      {
        "Burn": true,
        "Default": false,
        "Forced": false,
        "ID": 0,
        "Offset": 0,
        "Track": -1,
        "Import": {
          "Codeset": "UTF-8",
          "Filename": "C:\\Users\\Administrator\\Desktop\\subtitle.ass",
          "Language": "eng",
          "Format": "SSA"
        }
      }
    ]
  },
  "Video": {
    "Encoder": "x265",
    "Level": "auto",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "strong-intra-smoothing=0:rect=0",
    "Preset": "veryfast",
    "Profile": "auto",
    "Quality": 23.0,
    "Tune": "fastdecode",
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[18:03:20] CPU: Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz
[18:03:20]  - Intel microarchitecture Haswell
[18:03:20]  - logical processor count: 5
[18:03:20] Intel Quick Sync Video support: no
[18:03:20] hb_scan: path=C:\Users\Administrator\Desktop\KSHMR x KAAZE - Devil Inside Me (feat. KARRA) [Official Lyric Video].mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image C:\Users\Administrator\Desktop\KSHMR x KAAZE - Devil Inside Me (feat. KARRA) [Official Lyric Video].mp4
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[18:03:20] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
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
[18:03:20] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Administrator\Desktop\KSHMR x KAAZE - Devil Inside Me (feat. KARRA) [Official Lyric Video].mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2019-05-27T19:29:24.000000Z
  Duration: 00:03:20.55, start: 0.000000, bitrate: 2050 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 1920 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2019-05-27T19:29:24.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/27/2019.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2019-05-27T19:14:53.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 05/27/2019.
[18:03:20] scan: decoding previews for title 1
[18:03:20] scan: audio 0x1: aac, rate=44100Hz, bitrate=127999 Unknown (AAC LC) (2.0 ch) (127 kbps)
[18:03:21] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[18:03:21] scan: supported video decoders: avcodec qsv
[18:03:21] libhb: scan thread found 1 valid title(s)
D3D11CreateDevice returned error
D3D11CreateDevice returned error
D3D9: adapter that was found does not support QSV. It is required for zero-copy QSV path
[18:03:21] Skipping subtitle scan.  No suitable subtitle tracks.
[18:03:21] Starting Task: Encoding Pass
[18:03:21] [ass] Shaper: FriBidi 1.0.5 (SIMPLE) HarfBuzz-ng 2.6.1 (COMPLEX)
[18:03:21] [ass] Using font provider directwrite
[18:03:21] work: only 1 chapter, disabling chapter markers
[18:03:21] job configuration:
[18:03:21]  * source
[18:03:21]    + C:\Users\Administrator\Desktop\KSHMR x KAAZE - Devil Inside Me (feat. KARRA) [Official Lyric Video].mp4
[18:03:21]    + title 1, chapter(s) 1 to 1
[18:03:21]    + container: mov,mp4,m4a,3gp,3g2,mj2
[18:03:21]    + data rate: 2050 kbps
[18:03:21]  * destination
[18:03:21]    + C:\Users\Administrator\Desktop\test.mkv
[18:03:21]    + container: Matroska (libavformat)
[18:03:21]  * video track
[18:03:21]    + decoder: h264
[18:03:21]      + bitrate 1920 kbps
[18:03:21]    + filters
[18:03:21]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[18:03:21]      + Decomb (mode=39)
[18:03:21]      + Framerate Shaper (mode=1:rate=27000000/900900)
[18:03:21]        + frame rate: 23.976 fps -> constant 29.970 fps
[18:03:21]      + Subtitle renderer ()
[18:03:21]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[18:03:21]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1280 * 720
[18:03:21]    + Output geometry
[18:03:21]      + storage dimensions: 1280 x 720
[18:03:21]      + pixel aspect ratio: 1 : 1
[18:03:21]      + display dimensions: 1280 x 720
[18:03:21]    + encoder: H.265 (libx265)
[18:03:21]      + preset:  veryfast
[18:03:21]      + tune:    fastdecode
[18:03:21]      + options: strong-intra-smoothing=0:rect=0
[18:03:21]      + profile: auto
[18:03:21]      + level:   auto
[18:03:21]      + quality: 23.00 (RF)
[18:03:21]      + color profile: 1-1-1
[18:03:21]  * subtitle track 1, English [SSA] (track 0, id 0xff000000, Text) -> Render/Burn-in, offset: 0
[18:03:21]  * audio track 1
[18:03:21]    + decoder: Unknown (AAC LC) (2.0 ch) (127 kbps) (track 1, id 0x1)
[18:03:21]      + bitrate: 127 kbps, samplerate: 44100 Hz
[18:03:21]    + mixdown: Stereo
[18:03:21]    + dither: none
[18:03:21]    + encoder: AAC (libavcodec)
[18:03:21]      + bitrate: 96 kbps, samplerate: 44100 Hz
[18:03:21] sync: expecting 4808 video frames
x265 [info]: HEVC encoder version 3.1.2+1-76650bab70f9
x265 [info]: build info [Windows][GCC 8.3.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 5 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(12 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 / 1 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 30 / 300 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 0 / 0
x265 [info]: References / ref-limit  cu / depth  : 2 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-23.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip signhide tmvp fast-intra
x265 [info]: tools: lslices=4
[18:03:21] sync: first pts video is 0
[18:03:21] sync: "Chapter 1" (1) at frame 1 time 0
[18:03:21] sync: first pts audio 0x1 is 2042
[18:04:30] sync: first pts subtitle 0xff000000 is 5490000
[18:04:32] [ass] fontselect: (Arial, 400, 0) -> ArialMT, 0, ArialMT
[18:07:14] reader: done. 1 scr changes
[18:07:17] work: average encoding speed for job is 20.287132 fps
[18:07:17] comb detect: heavy 54 | light 50 | uncombed 4703 | total 4807
[18:07:17] decomb: deinterlaced 54 | blended 50 | unfiltered 4703 | total 4807
[18:07:17] vfr: 6008 frames output, 0 dropped and 1201 duped for CFR/PFR
[18:07:17] vfr: lost time: 0 (0 frames)
[18:07:17] vfr: gained time: 0 (0 frames) (0 not accounted for)
[18:07:17] aac-decoder done: 8637 frames, 0 decoder errors
[18:07:17] h264-decoder done: 4807 frames, 0 decoder errors
[18:07:17] sync: got 4807 frames, 4808 expected
[18:07:17] sync: framerate min 23.976 fps, max 23.976 fps, avg 23.976 fps
x265 [info]: frame I:     32, Avg QP:22.76  kb/s: 4490.30
x265 [info]: frame P:   1196, Avg QP:24.36  kb/s: 2168.13
x265 [info]: frame B:   4780, Avg QP:29.26  kb/s: 788.91
x265 [info]: consecutive B-frames: 2.2% 0.2% 0.2% 0.7% 96.6%
encoded 6008 frames in 236.19s (25.44 fps), 1083.18 kb/s, Avg QP:28.25
[18:07:17] mux: track 0, 6008 frames, 27166757 bytes, 1083.42 kbps, fifo 4096
[18:07:17] mux: track 1, 8638 frames, 2351504 bytes, 93.78 kbps, fifo 8192
[18:07:17] Finished work at: Fri Sep 27 18:07:17 2019
[18:07:17] libhb: work result = 0

# Encode Completed ...
Burn Subtitle Code

Code: Select all

    "SubtitleList": [
      {
        "Burn": true,
        "Default": false,
        "Forced": false,
        "ID": 0,
        "Offset": 0,
        "Track": -1,
        "Import": {
          "Codeset": "UTF-8",
          "Filename": "C:\\Users\\Administrator\\Desktop\\subtitle.ass",
          "Language": "eng",
          "Format": "SSA"
        }
      }
    ]
I need command line to import/add and burn subtitle like handbrake nightly do

Thank you
Woodstock
Veteran User
Posts: 4619
Joined: Tue Aug 27, 2013 6:39 am

Re: [ASK] How To Burn Subtitle ASS/SRT Like Hanbrake Nighly

Post by Woodstock »

Code: Select all

--ssa-file "C:\\Users\\Administrator\\Desktop\\subtitle.ass" --ssa-codeset UTF-8 --ssa-burn
The above assumes that the ASS file is in UTF-8, as most are nowadays.

At present, any special fonts required by the ASS file must already be present and registered on the computer.
Post Reply