Filthy Frank: "Pinku Dragon"


The effect was created by first extracting the foreground in Flowblade video editor [the FFmpeg version of this process was demonstraited previously¹]


In the animation, the Flowblade window is shown. The blur amount of a filter on the mask is being altered, which demonstraits the mask area growing and shrinking, and the edges of the mask get fuzzier.

Each cut-out frame was then sequentially merged, and overlayed on a background frame, creating the final animation. However, this was not the original goal of the process. If it were, it may have been easier to create using ImageMagick's stacking functionality²

[ Demonstrating the full procedure involved in foreground extraction using Flowblade may appear in a future blog post ]
¹ see also: https://oioiiooixiii.blogspot.com/2016/09/ffmpeg-extract-foreground-moving.html
² see also: https://oioiiooixiii.blogspot.com/2017/01/long-exposure-photography-compared-to.html
source video: https://www.youtube.com/watch?v=S6bQibFNs2E
original upload: (Twitter) August 5, 2016

Deceptive 2002 'Denny' Euro conversion calculator



Bash: Youtube-dl script which adds channel-id to video filenames

#!/bin/bash
################################################################################
# Download YouTube video, adding 'channel ID' to downloaded video filename¹
# - Arguments: YouTube URL
# source: htpps://oioiiooixiii.blogspot.com
# version: 2017.08.05.22.50.15
################################################################################

# Checks if video already exists in folder (checks YouTube ID in filename)
[ -f *"${1##*=}.mp4"* ] \
   && echo "*** FILE ALREADY EXISTS - ${1##*=} ***" \
   && exit

# Download html source of YouTube video webpage
html="$(wget -qO- "$1")"

# Extract YouTube channel ID from html source
channelID="$(grep channelId <<<"$html" \
            | tr \" \\n \
            | grep -E UC[-_A-Za-z0-9]{21}[AQgw])"

# Download best (MP4) version of YouTube video
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' \
            --add-metadata \
            "$1"

# Get filename of video created by youtube-dl
filename="$(find . -maxdepth 1 -name "*${1##*=}.mp4" \
            | cut -d\/ -f2)"

# Rename filename
echo "Renaming file to: ${channelID}_${filename}"
mv "$filename" "${channelID}_${filename}"

### NOTES ######################################################################

# ¹2017, May 21: Waiting for this to be implemented in youtube-dl
# youtube-dl -v -f137+140 -o '%(channel_id)s-%(title)s-%(id)s.%(ext)s'
# https://github.com/rg3/youtube-dl/issues/9676
download: ytdl.sh
context: https://github.com/rg3/youtube-dl/issues/9676

【中森明菜】:『少女A』(Akina Nakamori: "Girl A") - 1982, November 25th


source video: https://www.youtube.com/watch?v=kO2meEexNsE

FFmpeg: 144 (16x9) grid of random Limmy Vine videos


It would have been nice to complete this all in one FFmpeg command (building such a command is a relatively trivial 'for loop' affair¹) but the level of file IO made this impossible (for my setup at least). Perhaps with smaller file sizes and fewer videos, it would be less impractical.

# Some basic Bash/FFmpeg notes on the procedures involved: 

# Select random 144 videos from current folder ('sort -R' or 'shuf')
find ./ -name "*.mp4" | sort -R | head -n 144

# Generate 144 '-i' input text for FFmpeg (files being Bash function parameters)
echo '-i "${'{1..144}'}"'
# Or use 'eval' for run-time creation of FFmpeg command
eval "ffmpeg $(echo '-i "${'{1..144}'}"')"

# VIDEO - 10 separate FFmpeg instances

# Create 9 rows of 16 videos with 'hstack', then use these as input for 'vstack'
[0:v][1:v]...[15:v]hstack=16[row1];
[row1][row2]...[row9]vstack=9
# [n:v] Input sources can be omitted from stack filters if all '-i' files used

# AUDIO - 1 FFmpeg instance

# Mix 144 audio tracks into one output (truncate with ':duration=first' option)
amix=inputs=144

# If needed, normalise audio volume in two passes - first analyse audio
-af "volumedetect"
# Then increase volume based on 'max' value, such that 0dB not exceeded 
-af "volume=27dB"

# Mux video and audio into one file
ffmpeg -i video.file -i audio.file -map 0:0 -map 1:0 out.file

# Addendum: Some other thoughts in reflection: Perhaps piping the files to a FFmpeg instance with a 'grid' filter might simplify things, or loading the files, one by one, inside the filtergraph via 'movie=' might be worth investigating. 
¹ See related: https://oioiiooixiii.blogspot.com/2017/01/ffmpeg-generate-image-of-tiled-results.html
context: https://en.wikipedia.org/wiki/Limmy
source videos: https://vine.co/Limmy