Categories
Audio and Video Blogging

Merging multi-file action cam videos (fast)

Gosh, it’s December already? This year is at the same time too long but with time flying too fast.

A one-off post unrelated to previous ones, to change the subject!

If you have an action camera and you shoot videos that go over 4 GB, then you know that the cam will split your footage in 4 GB chunks – and if you want to make a single video out of these, then you need to somehow merge the pieces into one.

My DJI Osmo Action camera is producing videos like that:

DJI_0062_001.MP4
DJI_0062_002.MP4
DJI_0062_003.MP4
...

Even if you have no need to edit the video at all, you probably end up working in some kind of video editor spending MANY hours exporting (or rendering, whatever is the word used in your software). Even with a decent GPUs capable of fast encoding this can take long time, growing exponentially with resolution. You can forget about rendering long 4K mp4 videos on a machine without a very capable GPU costing around €1000!

Guess what, I don’t have that, my main laptop doesn’t have any dedicated GPU at all – a 1 hour 4K video takes more than 24 hours to render! 😁

Ideally I need something that can “concatenate” videos without decoding and re-encoding, and the solutions exist. I’m on Windows and I’ve found these tools called MP4 Splitter and MP4 Joiner, but they were very unreliable with my files, crashing a lot and producing corrupted videos. Maybe Osmo Action is creating buggy files – I don’t know.

Even the most complex video and audio processing tasks can be done using this amazing tool call ffmpeg, it’s a real command line powerhouse able to do any kind of conversions on most audio and video formats. The command line interface is totally allright with me for my own usage, I don’t need a GUI for myself. So I did a bit of research and finally found what works well for my use case and this is the “quick and dirty” batch script I ended up with:

@echo ------------ STARTED ENCODING ---------------

set file-name=new_video

:: Create input File List
for %%i in (DJI*.mp4) do echo file '%%i'>> mylist.temp.txt

:: Concatenate input video files
ffmpeg -f concat -safe 0 -i mylist.temp.txt -c copy -hide_banner -loglevel warning -stats %file-name%.mp4

:: cleanup
rm mylist.temp.txt

@echo ------------ FINISHED ENCODING ---------------

As a prerequisite, you need:

  1. Install ffmpeg.exe and put it somewhere in user or system path. I already had one installed by “MP4Tools” https://www.mp4joiner.org/ so I used it but there are other prebuilt packages available.
  2. Put your video files to concatenate in a directory – they will be joined by the alphabetical order of their filenames
  3. Put the concat.bat in the same directory and just run it. When it finishes, you’ll have a new file “new_video.mp4” in the same directory, having roughly the total size of the original videos.

DJI_0062_001.MP4
DJI_0062_002.MP4
DJI_0062_003.MP4
new_video.mp4

...

On my i5 Lenovo T470 Notebook without GPU it takes about 30 minutes to process a 1-hour long 4K video which is so significantly faster than reencoding it in the video editor!

Keep hacking (•̀ᴗ•́)و ̑̑

Categories
Blogging Development

Yak Shaving is real!

In my quest for Electron.js app development mastery, I’ve discovered that my own company (Oracle) publishes own frontend javascript toolkit that’s opensource and it actually is looking nice and useful! Whole lot of prebaked components you can just copy and paste and data binding looks simple enough.

Welcome Oracle JET – Javascript Extention Toolkit: https://www.oracle.com/webfolder/technetwork/jet/index.html

Also has both Javascript and Type Script versions. Couldn’t find much examples for it’s usage in Electron apps but I don’t see what could prevent that. I guess mine will be the newest example when I finish it 🙂

Categories
Blogging Cloud Infrastructure Development

oci-bucket-gui

In parallel with regular work, I’ve spent the week since last blog post trying to discover resources for electron.js development newbees.

The situation is “interesting”! On one side lots of simple easy to put in place “hello world” samples, on the other side a number of very advanced open source projects (like VSCode) but not much in between! It’s kind of assumed that the developer interested by Electron already has extensive full stack or front-end experience using popular frameworks like React or Vue. I am not such developer 😅. Back end – yes a bit, but front end – not so much!

Am I abandoning this idea – hell no! I’m searching and I’m looking and I will find a way.

Keep hacking (•̀ᴗ•́)و ̑̑

Categories
Blogging Cloud Infrastructure Development

I’m back?

2020 wasn’t an easy year! Forgive me if I wasn’t particularly active since April, lot’s of things happened that weren’t conductive to prolific blogging 🙂

I have an idea finally that I’d like to develop – this may change the blog’s subject a bit. I’d like to learn a new language or a framework while developing something useful at the same time. This something will be a file manager / file transfer client for OCI Object Storage.

So far I’m thinking to develop it as a cross platform GUI application, most probably using ElectronJS. Another somewhat close variant would be a plugin for VSCode – this should be simpler to develop in theory but I’m not really looking for simplicity, for the moment I’d like to treat this as a learning project. My Java Script / Type Script aren’t great, what’s better than something real to build – the best way to learn for me!

Categories
Blogging

vim-quickui: turbo for your vim

You like and use vim; you liked old turbo IDEs made by Borland: this fun project may suite you well!

https://github.com/skywind3000/vim-quickui on Github is the place you didn’t know you needed so bad then!