Last active
November 2, 2020 23:52
-
-
Save M4cs/983f79573ccbd7c8dd6af86f30048a92 to your computer and use it in GitHub Desktop.
How to right-click to compress files w/ FFMPEG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
SET subject=%* | |
for %%a in (%*) do set subject=%%a | |
python C:\\Users\\Max\\ffmpeg-compress\\compress.py %subject% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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