Skip to content

Instantly share code, notes, and snippets.

@dropitlikecross
dropitlikecross / compress_videos.py
Created January 18, 2022 09:24 — forked from asdfgeoff/compress_videos.py
Bulk compress phone videos using H.265 HEVC encoding 🔥 More info: https://geoffruddock.com/bulk-compress-videos-x265-with-ffmpeg/
import click
from pathlib import Path
from subprocess import call, check_output
from tqdm import tqdm
@click.command()
@click.argument('directory', type=click.Path(exists=True))
@click.option('--recursive', is_flag=True, help='Recursive')
@click.option('--file-ext', help='File format to process')
def main(directory, file_ext='mp4', recursive=False):
@dropitlikecross
dropitlikecross / ffmpeg_batch.sh
Created July 5, 2020 12:59
FFMPEG Bash Batch Conversion
#!/bin/bash
set -e # exit script of control-c is used
USAGE="Usage: convert_music.sh source_dir destination_dir"
# --- Options processing -------------------------------------------
if [ $# == 0 ] ; then
echo $USAGE
exit 1;
fi
# Convert relative path to absolute. Also remove trailing slash
SOURCE_DIR="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"