Created
February 12, 2016 15:01
-
-
Save mavhc/78b325cc76a1ecfe3952 to your computer and use it in GitHub Desktop.
This file contains 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
# put this file, and ffmpeg.exe in a folder, drop videos onto this file | |
# a version called filename-rotatedcounterclockwise.ext will be saved | |
# in the same folder as the original | |
import sys | |
import subprocess | |
import os | |
from pathlib import Path | |
i = sys.argv[1] | |
#print(i) | |
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) | |
ip = Path(i) | |
name = str(ip.stem) | |
name = name + "-rotatedcounterclockwise" + str(ip.suffix) | |
op = ip.with_name(name) | |
print(ip,op) | |
# change =2 to =1 for clockwise | |
print([__location__+'\\ffmpeg', '-i', str(ip),' -vf transpose=2 ',str(op)]) | |
subprocess.call([__location__+'\\ffmpeg', '-i', str(ip),'-vf', 'transpose=1',str(op)], shell=True) | |
a = input("Done, press Enter") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This file is public domain