

Edit your videos AUTOMATICALLY with this Python code!
source link: https://www.tuicool.com/articles/hit/nuMFjez
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The 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.
Installation
I 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:
git clone <a href="https://github.com/carykh/jumpcutter.git" data-href="https://github.com/carykh/jumpcutter.git" rel="nofollow noopener" target="_blank">https://github.com/carykh/jumpcutter.git</a>
Then install the requirements:
cd jumpcutter pip install --user -r requirements.txt
You’ll also need ffmpeg. If you are in Ubuntu:
sudo apt update sudo apt install ffmpeg
If you are in MatrixDS you’ll need to be root so:
sudo su apt install ffmpeg
Usage
Now 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 2
I 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 is
python jumpcutter.py --input_file path/to/file.mp4
You 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. (optional. 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. Typically 1. --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. optional... 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 <a href="https://youtu.be/2MjlMpEzDA8" data-href="https://youtu.be/2MjlMpEzDA8" rel="nofollow noopener" target="_blank">https://youtu.be/2MjlMpEzDA8</a> --sounded_speed 1 --silent_speed 999999 --frame_margin 2 --frame_rate 3
And that’s it.
Lovely work. Btw, the code are just 203 lines of code! The power of Python these days amazes me.
Recommend
-
27
jumpcutter Automatically edits videos. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw Some heads-up: It uses P...
-
5
One of the best ways to expand your video's reach is to describe it. Subtitles, as you likely know, are on-screen text that make video content more accessible to people. ...
-
8
TikTok is taking an automated approach to content moderation. The platform will now automatically remove videos that violate TikTok's Community Guidelines. ...
-
5
Top 40 Viral Videos of All TimeThere's a lot to be learned from viral video content. These top 40 videos give marketers insight and useful, practical takeaways.
-
7
Automatically Transforming And Optimizing Images And Videos On Your WordPress Website ...
-
5
Local YouTube to automatically link to places mentioned in videos Places Mentioned will be available on the Android and iOS You...
-
6
Premium ...
-
4
Edit videos quickly and creatively with Wondershare Filmora 12
-
6
All Posts Edit Videos with FFMPEG @SOLUTION· 2023-05-07 15:44 · 15 min read
-
9
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK