Skip to content

Instantly share code, notes, and snippets.

View ctrlcctrlv's full-sized avatar
🛠️
happy hacking

Fredrick Brennan ctrlcctrlv

🛠️
happy hacking
View GitHub Profile
@ctrlcctrlv
ctrlcctrlv / hardsub.sh
Created July 29, 2014 18:35
Convert softsubbed MKV files into hardsubbed MP4 files for playback via Roku, low powered devices etc, keep all fonts intact.
#!/bin/sh
# HARDSUB.SH
# (c) 2014 Fredrick Brennan
#
# Usage notes:
# This script requires that ~/.fonts is in your fontconfig path.
# This script also requires mkvmerge, realpath and ffmpeg to be installed. Only supports SSA subs and MKV files.
# Also note that this script can take a long time to run.
# Run as `hardsub.sh FILE_NAME`
# You should be able to delete the following created files after it is done: done_subtitles.ass and the entire contents of ~/.fonts/MKV
#!/bin/bash
# Save $1 because `set` will overwrite it
QUEUE_TO_DELETE=$1;
# $1 is our job ID, $7 is our queue name
ATQ=`atq|awk '{print $1, $7}'`;
while read line
do