FFmpeg by example

https://ffmpegbyexample.com
https://news.ycombinator.com/item?id=42695547

Change one color to another in an image

A fodler full of bmp images that have the ‘wrong’ version of red, that is 880015 and i’d like the red to be ff0000.

mogrify -fuzz 10% -fill "#ff0000" -opaque "#880015" *.bmp

Note: mogrify will overwrite the originals, so work on a copy. Only tested on NON-antialiased images where colors are pure.

XDCAM or not

1. First try

mediainfo file.mxf | grep 'Commercial' | uniq | awk '{ print $4,$5 }'

could return

XDCAM HD422

or not.

2. Cleaner

mediainfo --Inform="General;%Format_Commercial_IfAny%" file.mxf

3. Multiple fields?

It appears only single field can be requested at one run, unless you specify custom template (untested):

custom.txt

General;%Format_Commercial%
Video;%Width%

cli

mediainfo --Inform=file://custom.txt file.mxf

Flow gets golden globe

The animation of Flow — Blender Conference 2024
https://www.youtube.com/watch?v=fxz6p-QATfs

Trailer
https://www.youtube.com/watch?v=82WW9dVbglI

Hacker news
https://news.ycombinator.com/item?id=42620656

flow

Can css get some random number based on url or ...

No, but js can said the gpt.

ChatGPT

You can extract the URL or filename in JavaScript, generate a random or deterministic number based on it, and dynamically update the CSS property.

<style>
  .random-bg {
    background-image: url('your-image.jpg');
    background-position: 0 0; /* Default position */
  }
</style>

<div class="random-bg"></div>

<script>
  const element = document.querySelector('.random-bg');
  const url = window.location.href; // Get the full URL
  const seed = Array.from(url).reduce((sum, char) => sum + char.charCodeAt(0), 0); // Simple seed based on char codes
  const randomOffset = seed % 100; // Generate a pseudo-random offset (0-99px)
  element.style.backgroundPosition = `${randomOffset}px ${randomOffset}px`;
</script>

Fruit unicode

🍇 Grapes
🍈 Melon
🍉 Watermelon
🍊 Tangerine
🍋 Lemon
🍌 Banana
🍍 Pineapple
🥭 Mango
🍎 Red Apple
🍏 Green
🍐 Pear
🍑 Peach
🍒 Cherries
🍓 Strawberry
🥝 Kiwi
🍅 Tomato
🥥 Coconut

SFTPgo with nginx as reverse proxy

sftplogo

Situtation: nginx running and already using few virtual hosts.
Want: File sharing service similar to wetransfer, only interested in web browser drag/drop at the moment.

Install SFTPgo as instructed by their page, it should bind to 127.0.0.1:8080 by default?

Add a new virtual host to nginx that may look like this (mostly generated using chatgpt):

server {
    server_name myfiles.duckdns.org;

    # Redirect HTTP to HTTPS
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name myfiles.duckdns.org;

    # file upload limit?
    client_max_body_size 5G;

    ssl_certificate /etc/letsencrypt/live/myfiles.duckdns.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/myfiles.duckdns.org/privkey.pem;

    # SFTPGo Web Interface (if applicable)
    location / {
        # reverse proxy
        proxy_pass http://127.0.0.1:8080;  # Replace with your SFTPGo Web UI port or backend API endpoint
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Additional configurations such as timeouts, logging, etc.
}

Certbot must be used before that (since https is forced):

sudo certbot -d myfiles.duckdns.org -m user@user.com --agree-tos --noninteractive --nginx --redirect