What are some good / mature / performant libraries to programmatically achieve compositions of text, audio and image files, perhaps with a timeline in which these can be declared at various timestamps, and the output is a video file? Does this one do it?
Programmatic Video Editing with Python
11–20 of 44 posts
Re: Programmatic Video Editing with Python
#12What are some good / mature / performant libraries to programmatically achieve compositions of text, audio and image files, perhaps with a timeline in which these can be declared at various timestamps, and the output is a video file? Does this one do it?
Re: Programmatic Video Editing with Python
#13this looks great. I normally use Premiere Elements but the overhead for short compositing is too high and there's little automation (at least I don't know how) so something like this is great. The example of compositing using regions found with a template line drawing is intriguing.
Both have their own scripting language based on JavaScript and After Effects also uses plain JS.
There are also a number of paid plugins which provide varying levels of no-code automation. For example there is one which connects to Google Sheets and creates a new AE comp from each spreadsheet row, replacing text, images from URLs, changing dimensions of objects, etc. all based on the values of the spreadsheet cells.
Re: Programmatic Video Editing with Python
#14Have video templates then render them on the cloud filling the template placeholders with images, text, etc.
Re: Programmatic Video Editing with Python
#15Hm could this be used to make a clone of https://pirsonal.com/ ? Have video templates then render them on the cloud filling the template placeholders with images, text, etc.
It‘s more data driven motion graphics instead of non-linear video editing, but it looks like that‘s what pirsonal is doing pretty much.
Re: Programmatic Video Editing with Python
#16I've always thought "from lib import star" is somewhat of a anti-pattern. Personally I think that makes sense - because sometimes when I read code, I just have no idea where something comes from. But I've seen import star everywhere, couple of examples: Doc for this product FastAI's course Bing ads code base So I'm guessing it is more of accepted than I expected? What does HackerNews think?
For example, this is mymod.py:
import numpy as np
def f(x): return 2*x
And here it is imported: from mymod import *
f(10) # Works as expected.
np.sum([10, 20]) # Works, but shouldn't work.Re: Programmatic Video Editing with Python
#17I've always thought "from lib import star" is somewhat of a anti-pattern. Personally I think that makes sense - because sometimes when I read code, I just have no idea where something comes from. But I've seen import star everywhere, couple of examples: Doc for this product FastAI's course Bing ads code base So I'm guessing it is more of accepted than I expected? What does HackerNews think?
Side question: how do you prevent import statements from being imported by "from lib import star"? (Without explicitly mentioning all the stuff that is not import statements). For example, this is mymod.py: import numpy as np def f(x): return 2*x And here it is imported: from mymod import * f(10) # Works as expected. np.sum([10, 20]) # Works, but shouldn't work.
Docs: https://docs.python.org/3/tutorial/modules.html#importing-fr...
Re: Programmatic Video Editing with Python
#18Earlier quoted context omitted.
Side question: how do you prevent import statements from being imported by "from lib import star"? (Without explicitly mentioning all the stuff that is not import statements). For example, this is mymod.py: import numpy as np def f(x): return 2*x And here it is imported: from mymod import * f(10) # Works as expected. np.sum([10, 20]) # Works, but shouldn't work.
The best you can do (without doing crazy introspection) is to set `__all__` in `mymod`. It still requires listing everything you want to be exported from `mymod`, but at least you only need to do it once. Docs: https://docs.python.org/3/tutorial/modules.html#importing-fr...
Re: Programmatic Video Editing with Python
#19I've always thought "from lib import star" is somewhat of a anti-pattern. Personally I think that makes sense - because sometimes when I read code, I just have no idea where something comes from. But I've seen import star everywhere, couple of examples: Doc for this product FastAI's course Bing ads code base So I'm guessing it is more of accepted than I expected? What does HackerNews think?
Side question: how do you prevent import statements from being imported by "from lib import star"? (Without explicitly mentioning all the stuff that is not import statements). For example, this is mymod.py: import numpy as np def f(x): return 2*x And here it is imported: from mymod import * f(10) # Works as expected. np.sum([10, 20]) # Works, but shouldn't work.
The `from x import y` syntax is unaffected
Re: Programmatic Video Editing with Python
#20It's been around for ~9 years and has a relatively large community around it, most visibly found on the Doom9 forums: http://forum.doom9.org/forumdisplay.php?f=82
I'm personally still mostly using Avisynth these days since it's what I'm most familiar with, but I've also used Vapoursynth and it's definitely the one to learn if you want to get into programmatic video processing these days.