Is it possible to write Python code that gets a video file (mpg, avi, wmv, mov, etc) and a time interval (e.g. from 5_min-10_secs-11_ms to 10-min_15-secs-40_ms) and create a small video from this interval?
I know this is possible with ffmpeg, mencoder and other programs, but I’d like to do this in Python code.
Googling for “python library to edit video file” lead me right back to SO:
Best video manipulation library for Python?
Looking for python video editing/processing capabilities that will work with Google App Engine
In addition to getting this kind of functionality from a library, I often use a system call (os.system or subprocess) to call mencoder or ffmpeg. You could write a function to do this, in pythonesque pseudo code:
Ofcourse you need to choose a way of running tge systemcall and you need to learn some ffmpeg syntax.
EDIT (based on comments) Assuming the syntax of mmpeg is like:
The call would look like:
and the system call bit would look like (note I use os.system):
note that this code is also pseuodo python code and I have not tested it…the code is purely instructional.