Hey DEV community! This is my first post, and I'm thrilled to share this with you!
The Dream
While streaming YouTube videos, I would often dream about becoming a YouTuber, as I'm sure many of us do. I feel like I have a wealth of knowledge I'd like to share with the world. Small tutorial videos, talking about how I develop my hobby projects, and providing developers some productivity tips. Just something, anything, even if on a small scale. But to do these things, ð I'd have to:
- Learn the fundamentals of video editing and how to use various editing software ð
- Spend a good portion of time editing my video projects ðĻâðŧ
- Do the usual, and often repetitive, drop-crop-trim process âïļ
- Switch from Ubuntu, my primary OS that I love, as most of the professional video editing software works only on Windows/MacOS ðĨ
- Spend a lot of time waiting for the final output to render âģ
- And many other reasons to push me away from my dream ð
I know, I know. All these things make me sound like a really lazy person. That's because I AM! ð So what do I do?
Moment of Inspiration ðĐïļ
"I know some dumb programming. Would I be able to automate this process?" I asked myself, and that was it. What did I have to lose? So I decided to try and automate this process.
Research ð
I've heard that ffmpeg is a good tool to process video frames. So I quickly browsed through the docs, and found that it's pretty straightforward even for a simpleton like me.
Core Feature ðĪ
If the input video is a 10 minutes footage, and if it has 1 minute of non-talking area (the area where no one is talking) after every 2 minutes,
I want to timelapse those areas to 15 seconds of footage. So the total video length becomes 7 minutes and 45 seconds.
Also, while running the timelapse, I want to replace the footage's raw audio with some cool BGM ðĨ.
So this was the core feature I wanted to implement in the thing, for which I had not decided a name at that point.
Initial Development âïļ
I created a shell script
to process a sample video I downloaded from YouTube. I wrote some basic stuff in it, like
- Adding intro
- Adding text to intro
- Trimming video parts
- Timelapse video parts
- Adding background music
- Adding watermark
- Adding end credits
It took me 3 days to write it all by hand. I just wanted to check if ffmpeg
has the potential to do what I want it to, and it really impressed me, going beyond my expectations.
Next thing I wanted to do was generate these ffmpeg
commands dynamically. ðĢ
Code Improvements âĻïļ
It took me around 5 days to code the entire program. Then I proceeded to make some code improvements and made all possible input variables dynamic, which means you can control pretty much anything in it: Timelapse speed, intro title, watermark title, minimum timelapse duration, you name it.
Here's the overview of the core stack:
- Language : Kotlin ð§
- Video Processing : ffmpeg ð
- Audio Processing : autosub ð§
- Command Line Parsing : commons-cli
At this stage, I also settled on a name for this project, auto-motion.
Now, let's run it! ð
Input ðđ
Input is a 6 minutes video from comma archive, captured by George Hotz in a recent hackathon they conducted.
Execution ðąïļ
It only took ~1 minute to edit and render the output, whereas a manual edit would have taken hours, perhaps even days, to accomplish it. ðĪ·
Output ðš
The output, reduced to 4 minutes 43 seconds, is here. It includes 7 time-lapses of different lengths.
I know the output is not as enjoyable as a manually edited one, but I believe I can improve this in due time ð. You'll see more dynamic and interesting output in the near future on my Youtube channel. If you like my work, please subscribe to be notified. ðĪ
Download ðĐ
You can view the source code as well as download the program from GitHub.
teamxenox / auto-motion
A tool to edit your lengthy screen records, automatically.
auto-motion (legacy)
A CLI program to edit your videos, instantly, with minimum input.
Dependencies ðĒ
Install ð
wget "https://raw.githubusercontent.com/theapache64/auto-motion/master/install.sh" -q --show-progress -O install.sh && sh install.sh && source ~/.bashrc
Usage ðĨ
usage: auto-motion -v input.mp4 [-H] -V <arg> [-BGM <arg>] [-ST <arg>]
[-VL <arg>] [-MTL <arg>] [-TLS <arg>] [-ID <arg>] [-CR <arg>] [-WM
<arg>] [-IT <arg>] [-CT <arg>] [-IST <arg>] [-CST <arg>] [-F <arg>]
[-HL <arg>] [-WMC <arg>] [-WMS <arg>] [-WMBG <arg>] [-WMBGO <arg>]
[-TFS <arg>] [-STFS <arg>] [-TC <arg>] [-STC <arg>] [-BG <arg>]
[-RSRT <arg>] [-DSRT] [-RFMPG] [-sf] [-KS]
A tool to edit your lengthy screen records, automatically. Version
v1.0.0-alpha01
-H,--help To print help text
-V,--video <arg> Video inputs (required at least
one)
-BGM,--background-music <arg> Background music for timelapse.
Default
'/home/theapache64/Documents/proje
cts/auto-motion/lab/lost_in_time.m
p3'
-ST,--sub-title <arg> Intro sub title
-VL,--video-lang <arg> Video language. Default 'en'
-MTL,--min-tl-src-len <arg> Minimum timelapse source length
(in
âĶIf you have some videos, download the code and run it on them to check out the output for fun. ðĪŠ
Thanks for reading!
I'm really happy I wrote this and I'm excited to share more with you all. If you liked the post, do share it with your friends. Feel free to post your suggestions for future posts! Thank you for reading this. Ciao!
P.S. Are you an Open-Source Enthusiast?
If you looking to build cool products in a collaborative environment and meet awesome people, I welcome you to join me in XenoX Multiverse ðĨ. Check out some of the stuff we made last year.
We are currently working on Caligator, one of the products we built last year which got great reception from you all and the good folks over at ProductHunt.
Article No Longer Available
Caligator got a lot of traction and feature requests from people. Help us fire this up and take Caligator to the next level. Join chat on Gitter.
Top comments (18)
Amazing project and article!!!! Which skills are needed to join Xenox.
Hi Hina. If you know basic HTML/CSS and javascript, you're good to go! You can browse our projects to see which one you'd like to contribute to. I see on your profile that you're a student currently trying to find a solid direction for yourself. That's great, we have many students among us, and our senior members love mentoring youngsters. If you'd like, I can connect you to one of them. Cheers! ð
Yes, i want to join. I know html5, css, JavaScript, nodejs very well. Also know python. Now, i am learning react. i am browsing Projects and will tell you on which i contribute.
That's awesome. We have an active Telegram group for Xenox Multiverse where all the action takes place. Let me know your Telegram handle if you'd like me to add you there. You can also start by adding your name here.
My telegram account name is HINA KHADIM. Ok i will add my name on github.ðð
Couldn't find you on Telegram. Drop me a text on @YouuTeee ð
Awesome project, great article ðĨðĨ
Thank you so much Basseem. ð
I really like this project, already done some test but i hate using automated video because i don't want face new issue. Any way i enjoyed so much here and i prefer using web to use this whole process by using new working kahoot hacks auto answer to finish every step in easy way.
I was streaming youtube videos but no luck, my dream is to become amazing youtuber, I feel need more tests to see what really work fine.
learn.acloud.guru/profile/quick-hi...
I decided to do the same, i will never give up and i will try the process until i found a solution.
my link: myget.org/feed/edgenuity-cheat/pac...
Cool project thanks for sharing
You're welcome :)
A really cool idea, and addresses what has been keeping me from doing videos.
Doing stuff like this programtically really speaks to me. Nice work!
First of all, sorry for the late reply. I really appreciate the time you took to read the blog. Thank you :)
You can install similar app to edit video with beautiful effects and quality on powerdirector mod apk app at techbigs.com/powerdirector.html
You can install similar app to edit video with beautiful effects and quality from apkworlds.com/
automotion is active action where all the editing process take more time, i wanna tryi soon as i can.
My links : foundation.app/@freeluckycrush