Category Archives: Movies

Add effect to movie using bash

mkdir -p videoframessource videoframes
ffmpeg -r 60 -i sweden.mp4 videoframessource/%05d.png
cd videoframessource
ls *png | while read file ; do ../convert2comic $file ; echo -n "." ;done ; echo ""
ffmpeg -f image2 -r 60  -i videoframes/%05d.png  -vcodec libx264 final.mp4
#!/bin/bash
# convert script .. call me convert2comic
convert -quiet $1 +repage -depth 8 -selective-blur 0x5+10% ./tmp1
convert ./tmp1 -level 0x80% -colorspace gray -posterize 6 -depth 8 -colorspace sRGB ./tmp2
convert ./tmp1 '(' ./tmp2 -blur 0x1 ')' '(' -clone 0 -clone 1 -compose over -compose multiply -composite -modulate 100,150,100 ')' '(' -clone 0 -colorspace gray ')' '(' -clone 3 -negate -blur 0x2 ')' '(' -c
lone 3 -clone 4 -compose over -compose colordodge -composite -evaluate pow 4 -threshold 90% -median 1 ')' -delete 0,1,3,4 -compose over -compose multiply -composite ../videoframes/$1
# Another nice effect
convert frame.png \( +clone -negate -blur 0x6 \) -compose ColorDodge -composite -modulate 100,0,100 out.png

FFmpeg tricks

Mp4 to gif (resize, cut and convert)

startsecond=0
duration=3
ffmpeg -ss $startsecond -t $duration -i 'input.mp4' -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif

Gif to MP4

ffmpeg -i kanban.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" gifkanban.mp4

Converting MP4 for Davinci MOV

ffmpeg -i input.mp4 -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le -f mov output.mov

And back from Davinci to MP4

ffmpeg -i render.mov -c:v libx264 -pix_fmt yuv420p -crf 16 -force_key_frames 'expr:gte(t,n_forced/2)' -bf 2 -vf yadif -use_editlist 0 -movflags +faststart -c:a aac -q:a 1 -ac 2 -ar 48000 -f mp4 out.mp4

QTVR to png (note number of frames)

ffmpeg -i ../test.mov %02d.png
ffmpeg -i %02d.png -vf "tile=1x24,transpose=1" mh.png

Nikon MOV to mp4 (no reencoding)

ffmpeg -i input.mov -c copy -movflags +faststart  output.mp4

Nikon MOV to mp4 (problems with audio?
“Could not find tag for codec pcm_s16le in stream #1, codec not currently supported in container”

ffmpeg -i input.mov -c copy -c:a aac -b:a 128k -movflags +faststart  output.mp4
Maybe add -strict experimental 

MPG to MP4 (Not happy with this one)

ffmpeg -i vhs-rip.mpg"  -c:v libx264 -crf 10 -strict -2 1993-luv.mp4

FLV to MP4

ffmpeg -i filename.flv -c:v libx264 -crf 19 -strict experimental filename.mp4

Lossless cut with ffmpeg

ffmpeg  -ss 00:$2 -t 00:$3 -i $1 -vcodec copy -an cut_$1  
# an = no sound
# use -acodec copy for same codec as original audio

Timelapse JPG to MP4

ffmpeg -f image2 -r 24 -start_number 8296 -i "750_%04d.JPG"  -vcodec libx264 -profile:v high444 -refs 16 -crf 0 -preset ultrafast -vf scale=1920:1080 b.mp4

png to gif from a list

#cat png.list
file off.png
duration 1
file 20.png
duration 1
file 40.png
duration 1
file 60.png
duration 1
file 80.png
duration 1
file 90.png
duration 1
file 100.png
duration 1

# ffmpeg -f concat -i png.list -loop 0 hexlight.gif


Rotate mp4 clockwise/anticlockwise

ffmpeg -i VID20230110132531.mp4 -filter:v transpose=2 -c:v libx264 -preset veryfast -crf 22 -c:a copy -metadata:s:v rotate="" test.mp4

Concat video together

ffmpeg -f concat -i inputs.txt -c copy merge.mp4
inputs.txt
file start.mp4
file end.mp4


Error “width/height not divisible by 2 (1301×933)”

ffmpeg -i input.mp4 -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4

Dvd/DV/Mpg etcetera overviews

I made two scripts, which take a movie, find out its lenght divide by 9. And generates a image montage of snapshots at certain times in the movie. ( A movie of 90 minutes, gets a snapshot every 10 minutes )

Example of snapshots of a movie

Below takes images as above and convert them into animated gifs. All movies in a path or directory structure gets a index page containing all animated gifs.

Example of generated directory index

I’ll post something about my media sorter also.
A ajax website using drag drop viewing/sorting images (png/gifs/jpgs) and movies.

#!/bin/bash
# Uses montage, ffmpeg, convert and mediainfo
rm thumbs/*
rm montage/*
(
set -x
numberofframes=9
find  -type f | egrep -i "flv$|mov$|mkv$|avi$|mpg$|mp4$|VTS_01_1.VOB$|wmv$" |  while read filez; do
        crunchpath=$(echo $filez | sed "s,/,,g" |  sed "s, ,,g" |tr -cd '[:alnum:]' ).gif
        crunchback=$crunchpath
        echo $crunchpath
        if [ -f thumbs/$crunchpath ] ; then
                echo "$file exists"
                else
	mkdir /tmp/thumbs/ 2>/dev/null
	mkdir thumbs 2>/dev/null
	mkdir montage 2>/dev/null
        rm -f /tmp/thumbs/*png
sec=0
                totaltime1=$( mediainfo -f "$filez" | grep ^Dura  | awk '{print $3}' |grep -v "\:" | tail -1 )
                totaltime2=$( mediainfo -f "$filez" | grep ^Dura  | awk '{print $4}' |grep -v "\:" | tail -1 )
totaltime1a=$(echo $totaltime1| tr -d 'a-z')
echo $totaltime1 | grep h && sec=$((3600 * $totaltime1a))
echo $totaltime1 | grep mn && sec=$((60 * $totaltime1a))
echo $totaltime1 | grep s && sec=$totaltime1a
echo "sec : $sec"
echo $totaltime2 | grep -v ms | grep  s && sec=$[ $sec + $(echo $totaltime2 | tr -d 'a-z')]
echo "sec : $sec"
                width=$( mediainfo -f "$filez" | grep "Width"| grep pixels | awk '{ print $3 }' )
                height=$( mediainfo -f "$filez" | grep "Height"| grep pixels | awk '{ print $3 }' )
        if [ "$sec" == "" ] ; then sec=1 ; fi
                timer=$[ $sec / $numberofframes ]
                        echo  "converting step "
                        echo  "timer is $timer"
mark=0
                for f in `seq -w 1 $numberofframes` ; do
                        echo  "$f,$timer"
			echo $[$f*$timer]
                        ffmpeg -ss $[$f*$timer] -i "$filez" -vframes 1 /tmp/thumbs/$f.png 1>/dev/null 2>/dev/null </dev/null
if [ $f -eq 8 ] ; then cp /tmp/thumbs/8.png /tmp/thumbs9.png ;fi
newsizer=$(echo -n $widther ; echo -n "x" ; echo -n $sizeh)
if [ $sizeh -gt $sizew ] ; then mv /tmp/thumbs/$f.png /tmp/ff.png ; convert -resize $newsizer\! /tmp/ff.png /tmp/thumbs/$f.png ; echo aangepast ; echo $newsizer ; mark=1; fi
                done
                        echo " "
                        echo "generating $crunchpath"
	newwidth=$[ $width / 2 ]
	newheight=$[ $height / 2 ]
	newsize=$(echo -n $newwidth ; echo -n "x" ; echo -n $newheight)
	newsize2=$(echo -n $width ; echo -n "x" ; echo -n $newheight)
	echo $newsize
if [ $mark == 0 ] ; then        convert -delay 100 -resize $newsize\! /tmp/thumbs/*.png thumbs/$crunchpath </dev/null ; else
convert -delay 100 -resize $newsize2\! /tmp/thumbs/*.png thumbs/$crunchpath </dev/null 
fi
montage /tmp/thumbs/*png  -geometry +3+3 -tile 3x3 montage/$crunchpath.jpg
	echo "<img src=\"$crunchpath\">" >> thumbs/_index.html
        fi
done
) > /tmp/thumb.log

Movie genre’s

We are movieholic’s. Watching everything. Sometimes we thing “why the F did we watch that” other times it’s a pretty unknown jewel.

We loved “De kijk van Koolhoven” a dutch tv serie about movies, by our dutch director Martin van Koolhoven.
He explained why he liked certain movies. Tarantino did simular but couldn’t find much about that

We started watching the top 250 IMDB movies a few years ago. Comming a long way, and has been a treat.

Below a list of top movies i could thing of in serveral genre’s.
Nowhere complete, and probably forgot better ones

Action

  • 3 days of the condor
  • Snowpiercer
  • Maze runner
  • Inferno
  • Bourne series
  • Enter the Dragon
  • Fugitive
  • John Wick

Animation

  • Akira
  • Ghost in the shell
  • 9
  • 5cm per second
  • Tintin (2011)
  • Beowulf
  • Coco
  • Song of the sea

Comedy

  • guest house paradiso
  • Life of brian
  • “100-year old man who climbed out of the window”
  • Blues brothers
  • “Dont look now we’re being shot at”
  • Groundhog day
  • The man who sues god
  • Mash attacks
  • Modern times
  • Great Dictator
  • Airplane

Crime

  • 12 Angry men
  • The sting
  • The Mule
  • Oceans series
  • “No Country for Old Men”

Drama

  • Roma
  • A beautiful mind
  • Bicycle thieves
  • Cast away
  • Cinema Paradiso
  • Green book
  • Kite runner
  • Man on the moon
  • Seven samurai
  • American Sniper
  • Wadjda

Dutch

  • Amsterdamed
  • De Lift
  • The Johnsons
  • “Schippers van de Kameleon”
  • Michiel de Ruijter

Fantasy

  • The BFG
  • Hobbit
  • Lotr
  • Labyrinth
  • “The Imaginarium of Doctor Parnassus”
  • Time bandits
  • City of lost children

Film Noir

  • Double indemnity
  • Touch of evil
  • Sin City
  • M

Horror

  • Alien
  • Saw
  • The Platform
  • Underwater
  • Them
  • The Thing
  • Troll hunter?
  • Braindead

IT-Related

  • Antitrust
  • Hackers
  • Tron
  • Matrix
  • Source code
  • Swordfish
  • Takedown
  • War games

Mindfuck

  • Looper
  • Memento
  • Oldboy
  • Vertigo
  • The Prestige
  • Primer
  • Time lapse

Pre-1940

  • The general
  • Metropolis
  • Modern times
  • Gold Rush
  • M

SciFy

  • Bladerunner
  • Metropolis (silent)
  • Attraction
  • Inception
  • Interstellar
  • Martian
  • Terminator
  • Avatar
  • Arrival (2016)
  • Incredible shrinking man
  • Them (1954)

Fun to watch

  • 4Latas

War

  • Live is beautiful
  • Great escape
  • Dunkirk
  • The pianist
  • T-34
  • Oorlogswinter
  • Schindler’s list
  • Das boot
  • Downfall
  • Inglourious basterds
  • The imitation game
  • Ballad of a Soldier (1959)
  • Escape from Sobibor (1987)
  • painted bird (2019)

Weird

  • Funky Forrest
  • Existence
  • Delicatessen
  • Meet the feebles
  • “Requiem for a dream”
  • Swiss army man
  • Tenet
  • A clockwork orange
  • “Curious case of Benjamin Button”
  • The Lobster
  • Zardoz

Western

  • Revenant
  • Brimstone
  • Hang m high
  • Good bad and the Ugly
  • Magnificent Seven (1960)

Woman Power

  • Jackie Brown
  • Hidden figures
  • Color Purple
  • Moana / Brave
  • Roma
  • Alien
  • The Piano
  • Girl with the Dragon Tattoo
  • A League of Their Own
  • 9 to 5
  • Kill bill

List for Maryse

  • Zwartboek
  • Red sea ding resort
  • The pianist
  • Schindler’s list
  • Zwartboek
  • Son of Saul
  • Boy in the striped pyjama’s
  • Waltz With Bashir
  • La vita è bella

Indian movies

  • Taare Zameen Par (2007) – Like stars on earth (is a tearjerker)
  • 3 Idiots (2009)
  • Slumdog millionaire (Techinally a british movie)
  • Dangal (2016)

Kodi movies and metadata

UPDATE: 20220307

I’m using Kodi for a long time now, but never was really satisfied with the results of automatically scraping metadata.

Movie names had to be just right, and changing some metadata was hard.

A while ago i made a NFO generator for own movies, digitized 8mm material, mobile movies etc.

So for movies/tv shows i started using Tinymediamanager for metadata management. You have more controll over your NFO files.
Don’t forget to add media sources to Kodi, selecting the ‘local NFO scraper’ option.

I’m using TVDB scraper in TMM, and trakt to mark seen.
But that way i’m missing IMDB top 250.

Fix:

  • Scrape metadata for selected movies
  • Choose IMDB as the Metadata scraper
  • Remember to DESELECT ALL metadata options with the exceptions of Rating , to keep your existing metadata.
TinyMediaManager Scraper page

UPDATE:
Problems with premiered date/release date showing up as movie date in kodi? Here is my fix.

find . -type f -name '*.nfo' -print -exec sed -i -e '/<premiered>/d' {} \;

Best of Einaudi (lying down)

Music by Ludovico Einaudi, pianist Jeroen van Veen.
And you could lie down in the big “Werkspoorkathedraal” in Utrecht.

Ludovico Maria Enrico Einaudi (Italian: born 23 November 1955) is an Italian pianist and composer. Trained at the Conservatorio Verdi in Milan, Einaudi began his career as a classical composer, later incorporating other styles and genres such as pop, rock, folk, and world music.

Einaudi has composed the scores for a number of films and television productions, including This Is England, The Intouchables, I’m Still Here, the TV miniseries Doctor Zhivago, and Acquario (1996), Nomadland and The Father.

He has also released a number of solo albums for piano and other instruments, notably I Giorni in 2001, Nightbook in 2009, and In a Time Lapse in 2013.

Coline plays some of Einaudi on keyboard, and we play I Giorni with our Folkband.

Update 2023

Looking for the building in Revenge of the Ninja

When I was young I studied several Martial Arts.
Ninjutsu was one of them.

( Monique had a workshop from Masaaki “okay lets play” Hatsumi )

One of the two places i studied Ninpo

Ninjutsu (忍術), sometimes used interchangeably with the modern term ninpō (忍法), is the martial art strategy and tactics practised by the ninja.

I alway liked the movie “Revenge of the Ninja”.
I like Sho Kosugi
More info: https://www.youtube.com/watch?v=SclkTYTawmI

Well .. didn´t want to go to bed. Lets try to find the building where they are fighting on the roof.


Found it!