this post was submitted on 05 Jan 2025
29 points (89.2% liked)

Programming Humor

2814 readers
3 users here now

Related Communities [email protected] [email protected] [email protected] [email protected]

Other Programming Communities [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]

founded 2 years ago
MODERATORS
 

I put way too much work into this for a shitpost. Did all the editing with ffmpeg for some stupid reason.

If you're interested...

## This is a lot easier since I'm not dealing with audio

# Download the source video
wget https://i.makeagif.com/media/7-26-2016/cjRcwx.mp4 -O homer-brain-float-away.mp4

# Scale up the tiny MP4 from the GIF site
ffmpeg -i homer-brain-float-away.mp4 -vf scale=960:540 homer.mp4

# I want to splice the bit of Flanders talking from the middle onto the beginning. Start at 6 seconds and copy 1.5 seconds of the source video into a new file.

ffmpeg -i homer.mp4 -ss 6 -t 1.5 homer2.mp4

# Concatenate the extracted bit onto the beginning 
ffmpeg -i homer2.mp4 -i homer.mp4 -filter_complex "[0:v] [1:v] concat=n=2:v=1 [v]" -map '[v]' homer3.mp4

# Create a .srt subtitle file with the dialog
cat <<EOF > homer3.srt
1
00:00:00,000 --> 00:00:03,000
     VENDOR:  
  SEO this, SEO that.

2
00:00:03,000 -->  00:00:06,400
     MY BRAIN: 
  Screw this, pal. 
  You're on your own.

3
00:00:06,700 --> 00:00:09,500
     VENDOR:
  And even more about
  SEO.

00:00:10,600 --> 00:00:11,999
     VENDOR:
    Thoughts? 
EOF

# Burn in the subtitles
ffmpeg -i homer3.mp4 -vf "subtitles=homer3.srt" -c:v libx264 -crf 20 homer_finished.mp4

# Convert the mp4 to a GIF
ffmpeg -i homer_finished.mp4 homer_finished.gif

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 1 month ago

SEO and centralisation to mega-sites has ruined the internet.