From b5b3af31e507e4cf53ab54a866b88e8331c22750 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sat, 4 Nov 2023 10:48:33 +0100 Subject: Added ffmpeg note --- Makefile | 2 +- _includes/webring.html | 4 +- ...4-using-ffmpeg-to-combine-video-side-by-side.md | 41 +++++++++++++++++++++ assets/notes/trigraphs.gif | Bin 0 -> 1293557 bytes 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 _posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md create mode 100644 assets/notes/trigraphs.gif diff --git a/Makefile b/Makefile index 0ddaac3..efd898a 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ MAKEFLAGS+=-j3 dev: watch server webring: - ruby bin/webring.py + ruby bin/webring.rb watch: jekyll b --watch diff --git a/_includes/webring.html b/_includes/webring.html index 2ef29b8..7eb5332 100644 --- a/_includes/webring.html +++ b/_includes/webring.html @@ -43,10 +43,10 @@
For over 10 years now, I run two self-built NAS (Network Storage) devices which serve media (currently via Jellyfin) and run daily backups of all my PCs and servers. In this article, I describe my goals, which hardware I picked for my new build (and why) and how I set it up. Design Goals I use my network storage device...
  • - Network firewalls and Ethernet addresses + Our varying levels of what you could charitably call 'physical security'Chris's Wiki :: blog -
    Over on the Fediverse I mentioned that on some networks we authorize machines by controlling what Ethernet addresses ('MACs') get what IP addresses. In response, I was asked a very good question about why not have the firewall work by Ethernet address instead of IP. A starting answer is that firewalls have traditionall...
    +
    As I mentioned way back when I discussed how rogue wireless access points are a bigger risk at universities, one of the unusual things about universities is that we usually don't have anywhere near as much physical security as, say, a typical company does. This is because in practice most university buildings are open ...
  • Building a DIY Pen Plotter diff --git a/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md b/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md new file mode 100644 index 0000000..23d14b7 --- /dev/null +++ b/_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md @@ -0,0 +1,41 @@ +--- +title: "Using ffmpeg to combine videos side by side" +permalink: /using-ffmpeg-to-combine-video-side-by-side.html +date: 2023-11-04T09:04:28+02:00 +layout: post +type: note +draft: false +--- + +I had a 4 webm videos (each 492x451) that I wanted to combine to be played side +by side and I tried [iMovie](https://support.apple.com/imovie) and +[Kdenlive](https://kdenlive.org/) and failed to do it in an easy way. I needed +this for Github readme file so it also needed to be a GIF. + +The following is the [ffmpeg](https://ffmpeg.org/) version of it. + +```sh +ffmpeg -y \ + -i 01.webm \ + -i 02.webm \ + -i 03.webm \ + -i 04.webm \ + -filter_complex "\ + [0:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a0]; \ + [1:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a1]; \ + [2:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a2]; \ + [3:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a3]; \ + [a0][a1][a2][a3] xstack=inputs=4:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0, scale=1000:-1 [v]" \ + -map "[v]" \ + -crf 23 \ + -preset veryfast \ + trigraphs.gif +``` + +- This will produce `trigraphs.gif` that is also scaled to max 1000px in width + (refer to `scale=1000:-1`). +- The important part for 4x1 stack is `xstack=inputs=4:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0`. +- This will also cap frame rate to 6 (refer to `fps=6`) since that is enough and + this makes playback of GIFs smoother in a browser. + +![Result](./assets/notes/trigraphs.gif) diff --git a/assets/notes/trigraphs.gif b/assets/notes/trigraphs.gif new file mode 100644 index 0000000..f579b9d Binary files /dev/null and b/assets/notes/trigraphs.gif differ -- cgit v1.2.3