S
S
StynuBlizz2017-07-04 22:40:06
Python
StynuBlizz, 2017-07-04 22:40:06

How to process video dynamically depending on its parameters?

The user uploads a video, and based on what kind of video it is (horizontal or vertical, and what aspect ratio it has), I process it in a certain way (processing is done using ffmpeg). Example of changeable parameters:

  • If the video is horizontal: Change resolution and save
  • If video is 1:1 aspect ratio: Resize and save
  • If the video is vertical (but not 1:!) : Set the aspect ratio to 4:5, change the resolution and save.
I need to figure out how to get information about the video in the code (python), and based on this, pass the appropriate ffmpeg command. Or is it done in some other way? For example, Instagram, how it determines how to process videos, because users upload videos with different aspect ratios, orientations, and so on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Paul Nice, 2017-07-05
@Paul_Nice

What's wrong with using something like this:
Then, already in python, the written logic must decide how to pull out what is needed from the answer and apply the encoding settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question