diff --git a/flake.lock b/flake.lock index 9abd850..886e55b 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -20,16 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727122398, - "narHash": "sha256-o8VBeCWHBxGd4kVMceIayf5GApqTavJbTa44Xcg5Rrk=", + "lastModified": 1707347730, + "narHash": "sha256-0etC/exQIaqC9vliKhc3eZE2Mm2wgLa0tj93ZF/egvM=", "owner": "NixOs", "repo": "nixpkgs", - "rev": "30439d93eb8b19861ccbe3e581abf97bdc91b093", + "rev": "6832d0d99649db3d65a0e15fa51471537b2c56a6", "type": "github" }, "original": { "owner": "NixOs", - "ref": "nixos-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } @@ -59,11 +59,11 @@ "themes": { "flake": false, "locked": { - "lastModified": 1727424359, - "narHash": "sha256-KFQm2wb8EbeRr2R6WKmDE/b9G0XWb7Wk8FzqPk9oLOk=", + "lastModified": 1707594839, + "narHash": "sha256-VeoBv8LfsTLGSoGpiNlC8gd79xd4InG+bAC6TkBCSHw=", "owner": "EternalWanderer", "repo": "themes", - "rev": "11b7a363dd47bfa418c97b82aa3d7a9951e9eb1c", + "rev": "53560c95d3bd33362e5552cb9efeaf8234724868", "type": "gitlab" }, "original": { diff --git a/flake.nix b/flake.nix index 759ae76..139c49c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { description = "Voidcruiser website"; inputs = { - nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOs/nixpkgs/nixos-23.11"; flake-utils.url = "github:numtide/flake-utils"; themes = { url = "gitlab:EternalWanderer/themes"; diff --git a/src/content/rambles/distortions.md b/src/content/rambles/distortions.md deleted file mode 100644 index de01d65..0000000 --- a/src/content/rambles/distortions.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: "Distortions" -date: "2024-09-26T17:14:09+02:00" -author: "$HUMANOID" -tags: ["ffmpeg", "imagemagick"] -description: I've been messing around with various tools to create some rather nasty looking and sounding things. ---- - -# Festering Ideas - -{{< start-details summary="Epilepsy warning" >}} -{{< img src="/images/distortions/butchered.gif" alt="A gif with flickering text saying 'butchered'" >}} -{{< end-details >}} - -I've always liked glitchy looking images and videos. I just never bothered -creating my own. That is until I came across the -[`frei0r`](https://dyne.org/software/frei0r/) library by the -[Dyne](https://dyne.org) project. Here I found the `glitch0r` effect and messed -around with it for a bit in Kdenlive. However, as a terminal terminal user, -using a graphical interface didn't feel right. So I figured out how to use the -`frei0r` effects with `ffmpeg`.[^1] Now I could script the butchering of a bunch of -files at once! - -Among the effects in `frei0r`, I also found `scanline0r` and a bunch of other -effect, but wasn't quite happy with the fact that the scanlines in question seem -to be stuck at one resolution. Some time later (a few years), I heard someone -complain about professional footage being interlaced and it looking like shit as -a result. Upon closer inspection it had been the kind of ugly mess I'd been -hoping to create with the `scanline0r` filter. So I got around to figure out how -to interlace video using `ffmpeg` and butchered some videos further. - -## First Manifestations - -Here's a demonstration of what I managed to do so far using Big Buck Bunny as an -example: - -{{< video src="/videos/distortions/rabbit_original.mp4" type="video/mp4" width="500" -caption="Original clip from Big Buck Bunny">}} - -This snippet was chopped up using `ffmpeg` using the following command: -```sh -ffmpeg -ss 00:01:17 -i big_buck_bunny_720p_h264.mov -to 00:00:11.75 rabbit_original.mp4 -``` - -{{< start-details summary="Epilepsy warning" >}} - -{{< video src="/videos/distortions/rabbit_mangled.mp4" type="video/mp4" width="500" caption="My butchered version">}} - -{{< end-details >}} - -```sh -ffmpeg -ss 00:01:17 -i big_buck_bunny_720p_h264.mov -vf 'frei0r=filter_name=glitch0r:filter_params=0.05|0.8|.02|1,rgbashift=rh=6:bh=-4,interlace=scan=tff:lowpass=complex,format=yuva420p' -to 00:00:11.75 rabbit_mangled.mp4 -``` -The full original video can be found on [the Big Buck Bunny website](https://peach.blender.org/) - -# Magick - -In the mean time, I had been messing around with imagemagick as well. Using it -to create pictures of words of phrases when I felt like it. Usually I would use -something like the following to that end: -```sh -magick -font $(magick -list font | grep Font: | awk '{print $2}' | fzf) -pointsize 288 -fill white -stroke black -strokewidth 5 -background transparent label:"*Insert text here*" example.png -``` -{{< img src="/images/distortions/example.png" caption="The font used is Iosevka" alt="Here I used the Iosevka font to create an image with the text *Insert text here*">}} - -# Black Magick - -So the other day, I thought it would be interesting to see if I could make some -text using imagemagick and then feed it to `ffmpeg` to create a gif with an -interesting glitch effect. - -### Initial text - -Some text made with imagemagick because its the easiest way I know to create a -simple image with text. - -```sh -magick -font Iosevka -pointsize 300 -fill cyan -background transparent label:"Glitch" glitch.png -``` -{{< img src="/images/distortions/glitch.png" alt="An image with cyan text saying 'Glitch'" >}} - -> *Note*: The `pointsize` here is relevant as `ffmpeg` will complain if the image -> has a pixel count not divisible by 2. 300 works with Iosevka, if it doesn't -> work with your font of choice, try a few sizes until you find one that does. - -### With glitch0r and some - -```sh -ffmpeg -loop 1 -i glitch.png -vf 'frei0r=filter_name=glitch0r:filter_params=0.05|0.8|.02|1' -t 10 glitch.gif -``` -{{< img src="/images/distortions/glitch.gif" caption="" alt="The same image as above but with generated/artificial interference using the glitch0r effect from the frei0r library" >}} - -### Mangled results with imagemagick - -Initial results looked quite interesting. Then I thought it'd be funny to -convert this gif to an apng -- animated png. This resulted in the gif being -butchered in a really interesting way due to something in imagemagick being -broken; when converting the gif to an apng using `ffmpeg`, it will come out on -the other end in a state you'd expect. - -{{< start-details summary="Epilepsy warning" >}} -{{< img src="/images/distortions/glitch_butchered.gif" alt="A variant of the same image as before, but horrible broken due to the aforementioned bug in imagemagick" >}} -{{< end-details >}} - -```sh -magick glitch.gif APNG:glitch_animated.png -``` -> *Note*: You have to supply the fileformat in prefix form as apng isn't the -> standard format for the 'png' file extension. - -After creating the apng I decided to convert it back to a gif in order to save -some space as the apng was 11M. - -```sh -magick APNG:glitch_animated.png glitch_butchered.gif -``` - -I experimented a bit with both `ffmpeg` and imagemagick to see what the best -results would be. `ffmpeg` is significantly faster with the default settings but -has a slightly large filesize. - -```sh -$ ls -lh glitch_* --rw------- 1 yog-sothoth users 11M Sep 26 18:57 glitch_animated.png --rw-r--r-- 1 yog-sothoth users 5,1M Sep 27 09:48 glitch_ffmpeg.gif --rw-r--r-- 1 yog-sothoth users 4,2M Sep 27 09:49 glitch_magick.gif -``` - -> *Note*: No, I have no idea why the apng has a umask of `077`. Imagemagick just -> spat it out like that. - -# Conclusion - -I hadn't seen anyone butcher visuals quite like this before, so I thought I'd -write a post about it with the idea that someone else might find it interesting. - -So, go out there and butcher some visuals! - -[^1]: For many of the frei0r effects I used Kdenlive to figure out their parameters. - And for a list of available filters, I checked the `ffmpeg-filters(1)` manpage and - looked for `frei0r`. Under the `filter_name` section, there are a few paths - listed where ffmpeg checks for `frei0r` filters. diff --git a/src/static/images/distortions/butchered.gif b/src/static/images/distortions/butchered.gif deleted file mode 100644 index a5cb955..0000000 Binary files a/src/static/images/distortions/butchered.gif and /dev/null differ diff --git a/src/static/images/distortions/example.png b/src/static/images/distortions/example.png deleted file mode 100644 index 0d0893c..0000000 Binary files a/src/static/images/distortions/example.png and /dev/null differ diff --git a/src/static/images/distortions/glitch.gif b/src/static/images/distortions/glitch.gif deleted file mode 100644 index 86f4467..0000000 Binary files a/src/static/images/distortions/glitch.gif and /dev/null differ diff --git a/src/static/images/distortions/glitch.png b/src/static/images/distortions/glitch.png deleted file mode 100644 index 0529038..0000000 Binary files a/src/static/images/distortions/glitch.png and /dev/null differ diff --git a/src/static/images/distortions/glitch_animated.png b/src/static/images/distortions/glitch_animated.png deleted file mode 100644 index 58d55df..0000000 Binary files a/src/static/images/distortions/glitch_animated.png and /dev/null differ diff --git a/src/static/images/distortions/glitch_butchered.gif b/src/static/images/distortions/glitch_butchered.gif deleted file mode 100644 index da14f5b..0000000 Binary files a/src/static/images/distortions/glitch_butchered.gif and /dev/null differ diff --git a/src/static/images/distortions/glitch_ffmpeg.gif b/src/static/images/distortions/glitch_ffmpeg.gif deleted file mode 100644 index a46b72d..0000000 Binary files a/src/static/images/distortions/glitch_ffmpeg.gif and /dev/null differ diff --git a/src/static/images/distortions/glitch_ffmpeg.png b/src/static/images/distortions/glitch_ffmpeg.png deleted file mode 100644 index 5997215..0000000 Binary files a/src/static/images/distortions/glitch_ffmpeg.png and /dev/null differ diff --git a/src/static/images/distortions/glitch_magick.gif b/src/static/images/distortions/glitch_magick.gif deleted file mode 100644 index da14f5b..0000000 Binary files a/src/static/images/distortions/glitch_magick.gif and /dev/null differ diff --git a/src/static/videos/distortions/rabbit_mangled.mp4 b/src/static/videos/distortions/rabbit_mangled.mp4 deleted file mode 100644 index b2bcd62..0000000 Binary files a/src/static/videos/distortions/rabbit_mangled.mp4 and /dev/null differ diff --git a/src/static/videos/distortions/rabbit_original.mp4 b/src/static/videos/distortions/rabbit_original.mp4 deleted file mode 100644 index b2f407c..0000000 Binary files a/src/static/videos/distortions/rabbit_original.mp4 and /dev/null differ diff --git a/src/themes b/src/themes index 11b7a36..53560c9 160000 --- a/src/themes +++ b/src/themes @@ -1 +1 @@ -Subproject commit 11b7a363dd47bfa418c97b82aa3d7a9951e9eb1c +Subproject commit 53560c95d3bd33362e5552cb9efeaf8234724868