(Rolling Down) Katamari Drive

2 minute read Enclosure Published

Using FFMpeg to combine CC-licensed works.

Inspired by a chiptune topic on ZeroNet I downloaded one of the songs shared using youtube-dl but wasn't satisfied with the quality of the video encoding. The song on the other hand was great. And thankfully the author's website was still up so I could download the original MP3 and creating a new video.

I spent a few hours learning FFMpeg from the comfort of the chair behind my Invisible Arch. The manpages for FFMpeg include tons of diagrams and examples so cobbling something together wasn't as hard as I'd expected. Once I was satisfied with the result I transitioned over to my 2019 Mac to share the video…

Womp womp! No sound on macOS and no video in Telegram.

Not sure if I did something wrong but here's how I created the video:

  1. Find an original MP3 of your favorite chiptune.
  2. Find a cool video to compliment it.
  3. Use ffmpeg to create the finished product.

The ffmpeg work was done in 3 steps:

  1. Loop 8s video enough times to exceed length of 275s song:

    # 275s / 8s = 34.375
    ffmpeg -stream_loop 35 \
      -i the_drive_by_visualdon_WIDE.mp4 drive35.mp4
    
  2. Mux audio and video files, clipping to shorter of the two:

    # copy codecs into MP4 container and trim length
    ffmpeg -i drive35.mp4 -i fod_Rollingdownthestreet.mp3 \
      -c copy -map 0:v:0 -map 1:a:0 -shortest muxed.mp4
    
  3. Finally, add a start and end fade to the video:

    # fade based on total frames and framerate
    ffmpeg -y -i muxed.mp4 \
      -vf fade=in:0:48,fade=out:6572:48 \
      -acodec copy katamari-drive.mp4
    
Tip: Decrease filesize by about 70% at the expense of some lossiness by placing -map 0 -c:v libx265 before the output filename in step 1.

I placed the MP4 container under OSBD which means no attribution is required and no license needs to be carried around in addition to the original works. The art may be used under the grants made by their respective copyright holders:

Audio:
Title: “Rolling Down the Street (In My Katamari)”
Copyright: Stephen Hemstritch-Johnston
License: CC BY-NC-ND
Visuals:
Title: The Drive
Copyright: visualdon
License: CC BY-NC-like crayon license

If you like the video you can find many more made by @visualdon on their website. And if you like 8-bit music visit FearOfDark's Music Bank for more.

Advertisement
Ledger Nano X - The secure hardware wallet