Edit your videos AUTOMATICALLY with this Python code!Yeah this is true, be careful editors!! Thanks Python.
Favio VázquezBlockedUnblockFollowFollowingApr 16The time has come! I’m creating courses for amazing companies like Business Science and Ciencia y Datos and I’m editing videos is a pain in the a**!! The software I’ll present you here is by the great Carykh.
The goal of the system is to edit the annoying silences in videos, the error we make, and almost every piece of something you’d like.
It won’t transform your video into a beautiful video, but at least it will allow you to save hours and hours of listening to yourself failing.
If you are not a video creator, but you consume videos on the internet this can help you watch them faster.
I remember when I was studying and I watched a lot of Stanford and MIT videos, it took me hours and a lot of the time the professor wasn’t even speaking.
So this can help with that too.
InstallationI tested the system on MatrixDS one of the best tools for launching a terminal and a Jupyter notebook for free and in seconds.
So you can reproduce that there.
The first thing you need to do is to clone the repo:carykh/jumpcutterAutomatically edits vidx.
Explanation here: https://www.
com/watch?v=DQ8orIurGxw – carykh/jumpcuttergithub.
comgit clone https://github.
gitThen install the requirements:cd jumpcutterpip install –user -r requirements.
txtYou’ll also need ffmpeg.
If you are in Ubuntu:sudo apt updatesudo apt install ffmpegIf you are in MatrixDS you’ll need to be root so:sudo suapt install ffmpegUsageNow the fun part! I created a simple video to test this out.
Here you can see the original video:What I did in MatrixDS was upload the video in the same folder of the cloned repo.
And then after running this command:python3 jumpcutter.
py –input_file auto_2.
mp4 –sounded_speed 1 –silent_speed 999999 –frame_margin 2I had my video edited in seconds.
SECONDS!!You can see the result here:THIS IS JUST AWESOME :)Right now there’s no much documentation about the software but the code is open source so you can go to the repo and see everything.
The basic command ispython jumpcutter.
py –input_file path/to/file.
mp4You can play with this options:optional arguments: -h, –help show this help message and exit –input_file INPUT_FILE the video file you want modified –url URL A youtube url to download and process –output_file OUTPUT_FILE the output file.
if not included, it'll just modify the input file name) –silent_threshold SILENT_THRESHOLD the volume amount that frames' audio needs to surpass to be consider "sounded".
It ranges from 0 (silence) to 1 (max volume) –sounded_speed SOUNDED_SPEED the speed that sounded (spoken) frames should be played at.
–silent_speed SILENT_SPEED the speed that silent frames should be played at.
999999 for jumpcutting.
–frame_margin FRAME_MARGIN some silent frames adjacent to sounded frames are included to provide context.
How many frames on either the side of speech should be included? That's this variable.
–sample_rate SAMPLE_RATE sample rate of the input and output videos –frame_rate FRAME_RATE frame rate of the input and output videos.
I try to find it out myself, but it doesn't always work.
–frame_quality FRAME_QUALITY quality of frames to be extracted from input video.
1 is highest, 31 is lowest, 3 is the default.
Yes! You can even pass a YouTube video link and it will download the original and also change the video creating a new one.
For that the command will look like this:python3 jumpcutter.
py –url https://youtu.
be/2MjlMpEzDA8 –sounded_speed 1 –silent_speed 999999 –frame_margin 2 –frame_rate 3And that’s it.
Btw, the code are just 203 lines of code! The power of Python these days amazes me.
Thanks for reading this.
If you have any questions please write me here:Favio Vazquez — Founder / Chief Data Scientist — Ciencia y Datos | LinkedInJoin LinkedIn ‼️‼️ Important Note: Due to Linkedin technical limitations, I can now only accept connection requests…www.
comHave fun learning :).. More details