Skip to content

Instantly share code, notes, and snippets.

@lisamelton
lisamelton / hb-av1-transcode.rb
Last active February 27, 2023 00:42
Cross-platform Ruby script to transcode essential media tracks into a smaller, more portable format while remaining high enough quality to be mistaken for the original.
#!/usr/bin/env ruby
#
# hb-av1-transcode.rb
#
# Copyright (c) 2019-2023 Don Melton
#
require 'English'
require 'fileutils'
require 'json'
@lisamelton
lisamelton / manuscript.latex
Last active May 23, 2022 14:46
LaTeX template for Pandoc to create PDFs in standard manuscript format with both short story and novel layouts.
%
% manuscript.latex
%
% Copyright (c) 2022 Don Melton
%
% LaTeX template for Pandoc to create PDFs in standard manuscript format
% with both short story and novel layouts.
%
% Version: 2022052301
%
@lisamelton
lisamelton / classic-transcode.rb
Last active October 12, 2022 21:53
Cross-platform Ruby script to transcode or copy essential media tracks into a smaller, more portable format while remaining high enough quality to be mistaken for the original.
#!/usr/bin/env ruby
#
# classic-transcode.rb
#
# Copyright (c) 2019-2022 Don Melton
#
require 'English'
require 'fileutils'
require 'json'
@lisamelton
lisamelton / special-transcode.rb
Last active November 9, 2022 22:35
Ruby script for Windows and Linux to transcode or copy essential media tracks into a smaller, more portable format while remaining high enough quality to be mistaken for the original.
#!/usr/bin/env ruby
#
# special-transcode.rb
#
# Copyright (c) 2019-2022 Don Melton
#
require 'English'
require 'fileutils'
require 'json'
@lisamelton
lisamelton / commentary-tracks.sh
Created March 21, 2019 22:39
Bash script to scan input video for commentary tracks and output `transcode-video` options to add those tracks.
#!/bin/bash
#
# commentary-tracks.sh
#
# Copyright (c) 2013-2019 Don Melton
#
die() {
echo "$(basename "$0"): $1" >&2
exit ${2:-1}
@lisamelton
lisamelton / experimental-x264-avbr-transcode-video.sh
Created February 2, 2019 02:33
A wrapper script for `transcode-video` with an experimental average variable bitrate (AVBR) ratecontrol system for the x264 encoder.
#!/bin/bash
#
# experimental-x264-avbr-transcode-video.sh
#
# Copyright (c) 2013-2019 Don Melton
#
die() {
echo "$(basename "$0"): $1" >&2
exit ${2:-1}
@lisamelton
lisamelton / prune-handbrake-log.sh
Created July 5, 2018 15:55
A script to filter out overwritten `HandBrakeCLI` progress information from a `.log` file created `transcode-video`.
#!/bin/bash
#
# prune-handbrake-log.sh
#
# Copyright (c) 2018 Don Melton
#
if (($# == 1)); then
cat "$1" | ruby -e "print STDIN.read.gsub(/^.*\r(.)/, '\1')"
fi
@lisamelton
lisamelton / experimental-simple-transcode-video.sh
Created June 27, 2018 21:07
A wrapper script for `transcode-video` with an experimental simple constrained ratecontrol system.
#!/bin/bash
#
# experimental-simple-transcode-video.sh
#
# Copyright (c) 2013-2018 Don Melton
#
die() {
echo "$(basename "$0"): $1" >&2
exit ${2:-1}
@lisamelton
lisamelton / experimental-abr-transcode-video.sh
Last active November 29, 2017 22:48
A wrapper script for `transcode-video` with an experimental average bitrate (ABR) ratecontrol system.
#!/bin/bash
#
# experimental-abr-transcode-video.sh
#
# Copyright (c) 2013-2017 Don Melton
#
die() {
echo "$(basename "$0"): $1" >&2
exit ${2:-1}
@lisamelton
lisamelton / gist:f7f002ee20a534faf1f1
Last active October 17, 2021 13:58
Output from `transcode-video --help`
Transcode video file or disc image directory into format and size similar to
popular online downloads. Works best with Blu-ray or DVD rip.
Automatically determines target video bitrate, number of audio tracks, etc.
WITHOUT ANY command line options.
Usage: transcode-video [OPTION]... [FILE|DIRECTORY]...
Input options:
--scan list title(s) and tracks in video media and exit