mirror of
https://github.com/skoobasteeve/skoobasteeve.github.io.2.git
synced 2026-03-20 07:58:57 +00:00
Compare commits
5 Commits
5069405ad6
...
dv-mkv-fli
| Author | SHA1 | Date | |
|---|---|---|---|
|
83c0547605
|
|||
|
d2cdaa024d
|
|||
|
|
b53db5ea29 | ||
|
974e6abc64
|
|||
|
1677407e63
|
@@ -10,13 +10,16 @@ comments: true
|
||||
|
||||
{:class="img-responsive" .align-center}
|
||||
|
||||
{: .notice--info}
|
||||
***UPDATE 2023-10-15**: Kalendar's name has changed to "Merkuro Calendar". Still a great app!*
|
||||
|
||||
2022 was a great year for my Python skills. I had some unique problems to solve in my day job that got me over the hump of learning the language, and finally I was able to write comfortably without Googling syntax every five minutes. Quickly my team's Github repo filled up with borderline-unnecessary one-off scripts to solve all sorts of niche problems in our environment. Due to the nature of being a system administrator at a SaaS-heavy company, most of these scripts deal with third-party APIs: moving data from "service a" to "service b", pulling information about "service c" and correlating it with "service d", etc. These types of scripts are fun to write because they have narrow scopes and easily achievable goals, and I find completing them to be immensely satisfying.
|
||||
|
||||
Filled with confidence in my Python skills, I set out to embark on my first GUI project: a desktop to-do application with CalDAV sync. This is an app I feel has been missing on Linux, something akin to Apple Reminders where I can use my own backend for sync. To get started, I built a local-only terminal client, bought a book to start learning PyQt, and I sat down today to write the first of a series of blog posts where I would document the project. I got to the part of the blog post where I confidently say that there are "currently no working Linux desktop apps with this functionality". Then I thought, *maybe I should Google this once more and confirm there really is nothing out there*. Well, shit.
|
||||
|
||||
## Enter Kalendar
|
||||
|
||||
The last time I researched this space, there were no functional standalone to-do apps that supported CalDAV sync. The closest I could find was Thunderbird, my beloved email client, which is far more complex than what I was looking for. [Kalendar](https://apps.kde.org/kalendar/) didn't even pop up on my radar. Even today when I searched, I almost didn't find it. I ended up seeing it on the [Nextcloud Tasks Github page](https://github.com/nextcloud/tasks#apps-which-sync-with-nextcloud-tasks-using-caldav) in a list of compatible apps with sync. Within minutes, I had it installed and synced with my tasks in Nextcloud, and **wow**, this thing is good.
|
||||
The last time I researched this space, there were no functional standalone to-do apps that supported CalDAV sync. The closest I could find was Thunderbird, my beloved email client, which is far more complex than what I was looking for. [Kalendar](https://apps.kde.org/merkuro.calendar/) didn't even pop up on my radar. Even today when I searched, I almost didn't find it. I ended up seeing it on the [Nextcloud Tasks Github page](https://github.com/nextcloud/tasks#apps-which-sync-with-nextcloud-tasks-using-caldav) in a list of compatible apps with sync. Within minutes, I had it installed and synced with my tasks in Nextcloud, and **wow**, this thing is good.
|
||||
|
||||
Kalendar bills itself mainly as a new calendar app, but my task lists feel right at home here. The app opens instantly, and the task view is designed almost exactly as I envisioned for my own app; toggleable lists on the left and tasks on the right. Type on the bottom and hit enter to quickly create a new task and it syncs right up to Nextcloud. Right click on a task to easily set priority and due date, or add a subtask. I hate how good this is.
|
||||
|
||||
|
||||
108
_posts/2023-10-08-podman-auto-update.md
Normal file
108
_posts/2023-10-08-podman-auto-update.md
Normal file
@@ -0,0 +1,108 @@
|
||||
---
|
||||
layout: single
|
||||
title: "Easily Update Your Containers with Podman Auto-Update"
|
||||
date: 2023-10-08 16:00:00
|
||||
excerpt: "Use this handy built-in feature of Podman to update all your container images with a single command."
|
||||
categories: [Linux Administration]
|
||||
tags: linux nextcloud podman docker container update
|
||||
comments: true
|
||||
---
|
||||
|
||||
I've written previously about the joys of using Podman to manage your containers, including the benefits of using it over Docker, but one of my favorite quality-of-life features is the [podman auto-update](https://docs.podman.io/en/stable/markdown/podman-auto-update.1.html) command.
|
||||
|
||||
In short, it replaces the series of commands you would normally run to update containers, for example:
|
||||
|
||||
1. `podman pull nextcloud-fpm:27`
|
||||
2. `podman stop nextcloud-fpm`
|
||||
3. `podman rm nextcloud-fpm`
|
||||
4. `podman run [OPTIONS] nextcloud-fpm:27`
|
||||
5. Repeat for each container.
|
||||
|
||||
Not only does podman auto-update save you all these steps, it will also automatically roll back to the previous image version if there are errors starting the new version, giving you some peace of mind when updating important applications.
|
||||
|
||||
## Requirements
|
||||
* Podman installed
|
||||
* Containers [managed with systemd](https://docs.podman.io/en/stable/markdown/podman-generate-systemd.1.html)
|
||||
* Containers you want to update must use the `--label "io.containers.autoupdate=registry"` run option
|
||||
|
||||
## Instructions
|
||||
|
||||
Recreate your existing systemd-managed containers with the `--label "io.containers.autoupdate=registry"` option. To do this, just edit your container's service file to include the option. See the below partial example for my Nextcloud container:
|
||||
|
||||
``` systemd
|
||||
ExecStartPre=/bin/rm -f %t/%n.ctr-id
|
||||
ExecStart=/usr/bin/podman run \
|
||||
--cidfile=%t/%n.ctr-id \
|
||||
--cgroups=no-conmon \
|
||||
--rm \
|
||||
--pod-id-file %t/pod-nextcloud-pod.pod-id \
|
||||
--sdnotify=conmon \
|
||||
--replace \
|
||||
--detach \
|
||||
--env MYSQL_HOST=mariadb \
|
||||
--env MYSQL_DATABASE=nextcloud \
|
||||
--env MYSQL_USER=${MYSQL_USER} \
|
||||
--env MYSQL_PASSWORD=${MYSQL_PASSWORD} \
|
||||
--volume %h/.podman/nextcloud/nextcloud-config:/var/www/html:z \
|
||||
--volume /mnt/nextcloud-data/data:/var/www/html/data:z \
|
||||
--label "io.containers.autoupdate=registry" \
|
||||
--log-driver=journald \
|
||||
--name nextcloud-app docker.io/library/nextcloud:${NEXTCLOUD_VERSION}-fpm
|
||||
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
|
||||
```
|
||||
\
|
||||
Once you're done, reload the systemd daemon and restart the service.
|
||||
``` shell
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user restart container-nextcloud.service
|
||||
```
|
||||
\
|
||||
Next, run the auto-update command with the `--dry-run` option. With this option, you'll get a preview of which containers will be updated without the update taking place.
|
||||
|
||||
``` shell
|
||||
podman auto-update --dry-run
|
||||
|
||||
UNIT CONTAINER IMAGE POLICY UPDATED
|
||||
pod-nextcloud-pod.service 643fd5d3e2cb (nextcloud-app) docker.io/library/nextcloud:27-fpm registry pending
|
||||
pod-nextcloud-pod.service 71e48b691447 (mariadb) docker.io/library/mariadb:10 registry pending
|
||||
pod-nextcloud-pod.service 9ed555fecdfa (caddy) docker.io/library/caddy registry pending
|
||||
```
|
||||
|
||||
### Output explained
|
||||
* `podman auto-update` will show updates for every container that has the "io.containers.autoupdate=registry" label and do them all at once
|
||||
* The `UNIT` column shows the same "pod" service for each container. This is because my containers are all managed by a single Podman pod.
|
||||
* The `UPDATED` column shows "pending", which means there is an update available from the container registry.
|
||||
|
||||
\
|
||||
Once you're ready to update, run the command again without the `--dry-run` option.
|
||||
|
||||
``` shell
|
||||
podman auto-update
|
||||
```
|
||||
\
|
||||
Podman will begin pulling the images from the registry, which may take a few minutes depending on your connection speed. If it completes successfully, you'll get fresh output with the `UPDATED` column changed to `true`.
|
||||
|
||||
``` shell
|
||||
UNIT CONTAINER IMAGE POLICY UPDATED
|
||||
pod-nextcloud-pod.service 643fd5d3e2cb (nextcloud-app) docker.io/library/nextcloud:27-fpm registry true
|
||||
pod-nextcloud-pod.service 71e48b691447 (mariadb) docker.io/library/mariadb:10 registry true
|
||||
pod-nextcloud-pod.service 9ed555fecdfa (caddy) docker.io/library/caddy registry true
|
||||
```
|
||||
\
|
||||
During this process, the containers were restarted automatically with the latest image. You can verify this with `podman ps`.
|
||||
|
||||
``` shell
|
||||
podman ps
|
||||
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
0c5523997648 localhost/podman-pause:4.6.1-1692961071 2 minutes ago Up 2 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp 0e075fb7b67b-infra
|
||||
4ba992e83eeb docker.io/library/caddy:latest caddy run --confi... 2 minutes ago Up 2 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp caddy
|
||||
2a7d448b1b6b docker.io/library/nextcloud:27-fpm php-fpm 2 minutes ago Up About a minute 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp nextcloud-app
|
||||
9ec017721f16 docker.io/library/mariadb:10 --transaction-iso... 2 minutes ago Up 2 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp mariadb
|
||||
```
|
||||
\
|
||||
That's it! Your Podman containers were updated to the latest image version with a single command. This is a small feature, but one I've come to love in my time using Podman. If you get stuck, check out the project's [documentation for the auto-update command](https://docs.podman.io/en/stable/markdown/podman-auto-update.1.html). If you have broader questions about running Podman, I recommend reading my [series on building a reproducible Nextcloud server with Podman]({% link _posts/2023-08-27-nextcloud-podman.md %}).
|
||||
|
||||
Happy hacking!
|
||||
|
||||
|
||||
59
_posts/2024-09-07-fix-dv-mkv-flicker.md
Normal file
59
_posts/2024-09-07-fix-dv-mkv-flicker.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
layout: single
|
||||
title: "Fix \"flicker\" problem in Dolby Vision MKVs made with MakeMKV"
|
||||
date: 2024-09-07 12:00:00
|
||||
excerpt: "Resolve this rare but frustrating issue using open-source tools."
|
||||
categories: [Own Your Media]
|
||||
tags: makemkv dv dolbyvision blu-ray shield rip 4k
|
||||
comments: true
|
||||
---
|
||||

|
||||
|
||||
[➡ **Skip to solution**](#the-solution)
|
||||
|
||||
While I consume most of my media in my life like everyone else (an ever expanding list of ever more expensive streaming services), I also have a carefully curated collection of Blu-rays that I watch from time to time. Being who I am, purchasing a Blu-ray player and plugging it into my TV was never a valid option for viewing these. No, I needed a way to rip the discs to files, store them on my server, and access them through a media-center-like interface. After expending far more mental energy than necessary, I came up with the following method of watching my Blu-ray collection:
|
||||
|
||||
1. Rip discs to uncompressed MKV files using [MakeMKV](https://www.makemkv.com/) and a Blu-ray drive [patched for ripping UHD discs.](https://forum.makemkv.com/forum/viewtopic.php?t=19634)
|
||||
2. Copy them to a folder on my NAS available to the network via NFS.
|
||||
3. Play them on my TV using an Nvidia Shield TV Pro (2019) and Kodi.
|
||||
|
||||
### Notes on the Nvidia Shield and Kodi
|
||||
- The Shield Pro is one of the only Android TV devices that can properly recognize and play Dolby Vision MKV files encoded with Profile 7. No need to dig into what that means other than to say that it's a special type of DV that's only used in Blu-ray discs. Generally the only devices "licensed" to play DV Profile 7 are Blu-ray players.
|
||||
- Until recently, I had to use a special [patched version of Kodi](https://www.kodinerds.net/thread/69428-maven-s-kodi-builds-f%C3%BCr-android/) to play Dolby Vision MKVs, but as of Kodi 21, it's supported natively! This is awesome and generally works very well.
|
||||
|
||||
## The problem
|
||||
The other night when I started to watch my UHD copy of Saving Private Ryan, I noticed a strange "flickering" in the brighter spots of the image. This is especially noticeable in the opening scene in the cemetary where the sky is bright white. A quick [Kagi](https://kagi.com/) search of the problem led me to a few posts in the [MakeMKV forum](https://forum.makemkv.com/forum/viewtopic.php?p=135914) and [AVSForum](https://www.avsforum.com/threads/dune-hd-pro-vision-4k-solo.3180599/page-29) that also identified the issue, instantly making me feel better for not being crazy.
|
||||
|
||||
## Why?
|
||||
After digging around in forums, I learned that UHD Blu-rays can either apply Dolby Vision using MEL (minimum enhancement layer) or FEL (full enhancement layer). The latter is more problematic for non-standard players and ripped files MKVs, and it happens to be what was used for Saving Private Ryan. This is a rare issue because most DV Blu-rays use MEL.
|
||||
|
||||
## The solution
|
||||
The fix for this problem involves ripping the Blu-ray disc in MakeMKV's backup mode, making changes to the files, and repackaging them into an MKV. **Credit to MakeMKV Forum user adamthefilmfan** who [originally posted the solution](https://forum.makemkv.com/forum/viewtopic.php?t=32107). I've cleaned up the instructions a bit and adapted them to work on Linux, though they should also work on macOS.
|
||||
|
||||
1. Install prerequisites
|
||||
- [DGDemux](https://www.rationalqm.us/dgdemux/binaries/) - Unpackages or "demuxes" the `.mpls` file in the Blu-ray backup containing the film. Download the latest .zip file, extract it, and mark the `dgdemux` file as executable. I like to put files like this somewhere on my PATH, like `~/bin`.
|
||||
- [dovi_tool](https://github.com/quietvoid/dovi_tool) - Extracts the Dolby Vision metadata and re-applies it to the new file. Download the latest .tar.gz, extract it, and mark the `dovi_tool` file as executable. dgdemux also includes a dovi_tool binary in their .zip last time I checked, but it may not be the latest.
|
||||
- [MKVToolNix](https://mkvtoolnix.download/downloads.html) - Repackages or "remuxes" the modified Blu-ray files into a playable MKV. Follow the installation instructions for your platform on their website.
|
||||
2. Rip the disc via the MakeMKV backup function, being sure to check the "decrypt video" box.
|
||||
3. Open the movie playlist with of DGDemux.
|
||||
``` shell
|
||||
dgdemux -d ~/Videos/backup/SAVING\ PRIVATE\ RYAN
|
||||
```
|
||||
4. Locate the main film title in the list, then demux it. You'll get separate files for all audio and subtitle tracks (and chapters), as well as two separate video (.hevc) files. Rename the large video file to "BL.hevc" and the small one to "EL.hevc".
|
||||
``` shell
|
||||
dgdemux -i ~/Videos/backup/SAVING\ PRIVATE\ RYAN/BDMV/PLAYLIST/00800.mpls -o ~/Videos/demux/SPR/00800
|
||||
```
|
||||
5. Extract the Dolby Vision RPU from the EL.hevc using `dovi_tool`
|
||||
``` shell
|
||||
dovi_tool -m 2 extract-rpu -i ~/Videos/demux/SPR/EL.hevc -o ~/Videos/demux/SPR/RPU.bin
|
||||
```
|
||||
6. Inject the RPU into BL.hevc and save it out to a new file
|
||||
``` shell
|
||||
dovi_tool inject-rpu -i ~/Videos/demux/SPR/EL.hevc -r ~/Videos/demux/SPR/RPU.bin -o ~/Videos/demux/SPR/final.hevc
|
||||
```
|
||||
7. Open the MKVToolNix GUI and add all the files in the demux directory (video, audio, subtitles, and your hevc files)
|
||||
8. Remove EL.hevc, BL.hevc, and RPU.bin from the list. Make sure final.hevc is still included.
|
||||
9. Set a destination file and click "Start multiplexing".
|
||||

|
||||
|
||||
After a few minutes, you'll have a playable, flicker-free MKV file with Dolby Vision still intact. So far this is the only Blu-Ray in my collection I've had to do this for 🤞, but I'm glad to have a solution.
|
||||
BIN
assets/images/screenshots/mkvtoolnix-remux.png
Normal file
BIN
assets/images/screenshots/mkvtoolnix-remux.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 246 KiB |
BIN
assets/images/screenshots/saving_private_ryan_kodi.png
Normal file
BIN
assets/images/screenshots/saving_private_ryan_kodi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 723 KiB |
Reference in New Issue
Block a user