aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--_includes/webring.html4
-rw-r--r--_posts/2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md41
-rw-r--r--assets/notes/trigraphs.gifbin0 -> 1293557 bytes
4 files changed, 44 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0ddaac3..efd898a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ MAKEFLAGS+=-j3
3dev: watch server 3dev: watch server
4 4
5webring: 5webring:
6 ruby bin/webring.py 6 ruby bin/webring.rb
7 7
8watch: 8watch:
9 jekyll b --watch 9 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 @@
43 <div>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...</div> 43 <div>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...</div>
44 </li> 44 </li>
45 <li> 45 <li>
46 <a href="https://utcc.utoronto.ca/~cks/space/blog/tech/FirewallsAndMACs" target="_blank" rel="noopener">Network firewalls and Ethernet addresses</a> 46 <a href="https://utcc.utoronto.ca/~cks/space/blog/sysadmin/OurVaryingPhysicalSecurityLevels" target="_blank" rel="noopener">Our varying levels of what you could charitably call &#39;physical security&#39;</a>
47 47
48 <a href="https://utcc.utoronto.ca/~cks/space/blog/" target="_blank" rel="noopener">Chris&#39;s Wiki :: blog</a> 48 <a href="https://utcc.utoronto.ca/~cks/space/blog/" target="_blank" rel="noopener">Chris&#39;s Wiki :: blog</a>
49 <div>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...</div> 49 <div>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 ...</div>
50 </li> 50 </li>
51 <li> 51 <li>
52 <a href="https://szymonkaliski.com/writing/2023-10-02-building-a-diy-pen-plotter/" target="_blank" rel="noopener">Building a DIY Pen Plotter</a> 52 <a href="https://szymonkaliski.com/writing/2023-10-02-building-a-diy-pen-plotter/" target="_blank" rel="noopener">Building a DIY Pen Plotter</a>
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 @@
1---
2title: "Using ffmpeg to combine videos side by side"
3permalink: /using-ffmpeg-to-combine-video-side-by-side.html
4date: 2023-11-04T09:04:28+02:00
5layout: post
6type: note
7draft: false
8---
9
10I had a 4 webm videos (each 492x451) that I wanted to combine to be played side
11by side and I tried [iMovie](https://support.apple.com/imovie) and
12[Kdenlive](https://kdenlive.org/) and failed to do it in an easy way. I needed
13this for Github readme file so it also needed to be a GIF.
14
15The following is the [ffmpeg](https://ffmpeg.org/) version of it.
16
17```sh
18ffmpeg -y \
19 -i 01.webm \
20 -i 02.webm \
21 -i 03.webm \
22 -i 04.webm \
23 -filter_complex "\
24 [0:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a0]; \
25 [1:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a1]; \
26 [2:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a2]; \
27 [3:v] trim=duration=8, setpts=PTS-STARTPTS, scale=492x451, fps=6 [a3]; \
28 [a0][a1][a2][a3] xstack=inputs=4:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0, scale=1000:-1 [v]" \
29 -map "[v]" \
30 -crf 23 \
31 -preset veryfast \
32 trigraphs.gif
33```
34
35- This will produce `trigraphs.gif` that is also scaled to max 1000px in width
36 (refer to `scale=1000:-1`).
37- The important part for 4x1 stack is `xstack=inputs=4:layout=0_0|w0_0|w0+w1_0|w0+w1+w2_0`.
38- This will also cap frame rate to 6 (refer to `fps=6`) since that is enough and
39 this makes playback of GIFs smoother in a browser.
40
41![Result](./assets/notes/trigraphs.gif)
diff --git a/assets/notes/trigraphs.gif b/assets/notes/trigraphs.gif
new file mode 100644
index 0000000..f579b9d
--- /dev/null
+++ b/assets/notes/trigraphs.gif
Binary files differ