I'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.
Programmatic Video Editing with Python
21–30 of 44 posts
Re: Programmatic Video Editing with Python
#22Re: Programmatic Video Editing with Python
#23If you're interested in high performance video processing with Python and want something more than just a fancy ffmpeg wrapper, then I can highly recommend checking out Vapoursynth: https://www.vapoursynth.com/ It'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 the…
Re: Programmatic Video Editing with Python
#24Re: Programmatic Video Editing with Python
#25I was tinkering with moviepy over the weekend to add subtitles to my standup comedy routine. I used a hand edited simple ".srt" file. It was easy and fun to implement.
Here is the finished result, https://fb.watch/v/17oesJhB3/
Re: Programmatic Video Editing with Python
#26I love MoviePy! It's great when you have a lot of bits of audio, video, and text you need to glue together. I have used it to create some GPT-2-generated Peppa Pig cartoons ( https://www.youtube.com/watch?v=1TEwCA3KDtg ) -- stick the image, text, and speech together (aligned to the speech length), concat all the clips, and finally apply some fancy ffmpeg effects.
Re: Programmatic Video Editing with Python
#27I'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?
Unless no one can see.
Somewhat more seriously, don’t do it in anything other than one-off code once you’ve experimented enough to get the result you want unless you aren’t scared of the people who will yell at you about circular imports.
Re: Programmatic Video Editing with Python
#28Re: Programmatic Video Editing with Python
#29Re: Programmatic Video Editing with Python
#30The 3Blue1Brown YouTube channel (a well regarded channel that publishes visualizations of various mathematical and other processes) also uses Python to programmatically generate the videos: https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw