Skip to content

Instantly share code, notes, and snippets.

@M4cs
Last active November 2, 2020 23:52
How to right-click to compress files w/ FFMPEG
@echo OFF
SET subject=%*
for %%a in (%*) do set subject=%%a
python C:\\Users\\Max\\ffmpeg-compress\\compress.py %subject%
import sys
from subprocess import run, PIPE
from pathlib import Path
args = sys.argv[1:]
video_file = Path(' '.join(args))
run(['ffmpeg', '-i', video_file.name, '-vcodec', 'h264', '-acodec','aac', video_file.name.replace('.' + video_file.name.split('.')[-1], '-compressed.' + video_file.name.split('.')[-1])])
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\ffmpeg-compress]
@="Compress File w/ FFMPEG"
[HKEY_CLASSES_ROOT\*\shell\ffmpeg-compress\command]
@="\"C:\\Users\\Max\\compress.bat\" \"%1\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment