Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dattasaurabh82/4dc8e73bf540d9052b1611464990d09a to your computer and use it in GitHub Desktop.
Save dattasaurabh82/4dc8e73bf540d9052b1611464990d09a to your computer and use it in GitHub Desktop.
# The screenshots I took, have resolutions 144x144
# The screenshots I took, have dimensions 2990x2080

# I combined all the front images  and back images of PCB separately into 2 separate videos, each with framerate 8 
ffmpeg -r 8 -f image2 -s 144x144 -i picf%04d.png -vcodec libx264 -crf 15  -pix_fmt yuv420p wf.mp4
ffmpeg -r 8 -f image2 -s 144x144 -i picb%04d.png -vcodec libx264 -crf 15  -pix_fmt yuv420p wb.mp4
# changed the resolutions
ffmpeg -i wf.mp4 -vf scale=2990:2080 -preset slow -crf 18 wfrs.mp4
ffmpeg -i wb.mp4 -vf scale=2990:2080 -preset slow -crf 18 wbrs.mp4

# Added the video file names to a text file to combine later
vim videos.txt
# videos.txt
file 'wbfs.mp4'
file 'wbrs.mp4'

# then combined these 2 video files (front video + back video) as one video
ffmpeg -f concat -i videos.txt -c copy wff.mp4

# Then I added the wff.mp4 twice to export a longer video
vim videos2.txt
# videos2.txt
file 'wff.mp4'
file 'wff.mp4'
ffmpeg -f concat -i videos2.txt -c copy wff_2.mp4

# Then I bought an audio file from Ryoji Ikeda, cut a section that I liked, to the length of the video (all also through ffmpeg) and added the audio to the video
ffmpeg -i wff_2.mp4 -i sf_cut_2.mp3 -map 0:v -map 1:a -c:v copy -shortest wff_2_wa.mp4 

# Then I tested some contrast changes as my images that were used to create the video were grey as fusion 360 didn't have a complete black background env
ffplay -vf eq=brightness=0.02:saturation=0:contrast=1.9 wff_2_wa.mp4
# Then I rendered it when I was happy
ffmpeg -i wff_2_wa.mp4 -vf eq=brightness=0.02:saturation=0:contrast=1.9 -c:a copy wff_2_wa_cc.mp4

# Then I played with some affects to create a bit blurry, a bit grainy greenish old anime/science video style
ffplay -vf eq=brightness=0.06:saturation=0:contrast=1.8,hue=s=1,boxblur=lr=2.05,noise=c0s=7:allf=t wff_2_wa.mp4
# When I was happy, I rendered it
ffmpeg -i wff_2_wa.mp4 -vf eq=brightness=0.085:saturation=0:contrast=1.8,hue=s=0.9,boxblur=lr=2.05,noise=c0s=7:allf=t -c:a copy wff_2_wa_cc.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment