0

How can I convert the below code to python? I'm having issues doing so..

ffmpeg -i /Users/Aaron/lol.mp4 -filter:v "crop=9/16*ih:ih" /Users/Aaron/Desktop/lol1.mp4

Thank you so much for any assistance!

1 Answer 1

2

You could have a subprocess call:

import subprocess

def crop(input_file, output_file, x, y):
    subprocess.call(['ffmpeg', '-i', input_file, '-filter:v', 'crop={}/{}*iw:ih'.format(x, y), output_file])

crop('/Users/Aaron/lol.mp4', '/Users/Aaron/Desktop/lol1.mp4', 9, 16)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.