Skip to content

Instantly share code, notes, and snippets.

View Bioblaze's full-sized avatar

Bioblaze Payne Bioblaze

View GitHub Profile
@tkarna
tkarna / make_animation.sh
Last active May 31, 2021 18:46
Script to generate an mp4 video file from still images
#!/bin/bash
# generate mp4 animation from still images with ffmpeg.
if [ $# != 2 ]; then
echo "Usage: $(basename "$0") \"image/file/pattern_*.png\" output.mp4"
exit -1
fi
pattern=$1
outputfile=$2
@rileyjshaw
rileyjshaw / ffmpeg-add-voiceover.sh
Created May 30, 2020 01:19
Quick one-liner to merge audio narration with a video
ffmpeg -i narration.mp3 -i original.mp4 -filter_complex "[0:a][1:a]amerge,pan=stereo|c0<c0+c2|c1<c1+c3[a]" -map 1:v -map "[a]" -c:v copy -c:a aac -shortest output.mp4
@valentineus
valentineus / shell.sh
Created June 1, 2020 10:16
Convert video file to audio file
ffmpeg -i filename.ogg -vn -c:a libopus -ar 16k -ac 1 -b:a 16k -vbr on -compression_level 10 new_filename.ogg
@codecreate-dev
codecreate-dev / mp4-cover-image-create.sh
Created June 9, 2020 23:10
Create image covers from mp4 vids in a for loop
for vid in *.mp4; do ffmpeg -i $vid -codec mjpeg -ss 4 -vframes 1 -q:v 1 ./covers/$vid.jpg; done
@carylee
carylee / stitch.sh
Created June 10, 2020 00:29
Generate a virtual quartet video
#!/bin/bash
ffmpeg -y \
-ss 5 -i "elisabeth.mp4" \
-ss 0 -i "ryan.MOV" \
-ss 7.5 -i "cary.mp4" \
-ss 2.9 -i "jackie.MOV" \
-ss 9 -i "tess.MOV" \
-ss 9 -i "Water River Spirit Grace.m4a" \
-filter_complex " \
[0:v] setpts=PTS-STARTPTS, crop=608:720:in_w/2-out_w/2+100:100, scale=912:1080 [v0]; \
@alexjpaz
alexjpaz / gist:de25c83d69e597e311602ffaa7d16f06
Created June 18, 2020 20:08
ffmpeg with audio with visualization on top of an image with text
#!/bin/bash
ffmpeg \
-y \
-i input.wav \
-i paz.png \
-filter_complex "\
[1:v]scale=-1:480:flags=neighbor,loop=size=2:loop=-1[fg];
[0:a]showcqt=s=1280x720:axis_h=0:sono_h=0:basefreq=27.5:endfreq=1000.0[v];
[fg]drawtext=text='Primitive Rule':fontcolor=white:fontsize=72:font=Bebas Neue:x=(w-text_w)/2:y=(h-text_h)/2[fg];
@m4nh
m4nh / images_to_video.sh
Last active August 5, 2020 14:35
#ffmpeg #video from #images
# Create from folder
ffmpeg -framerate 1 -pattern_type glob -i '/tmp/ciao/*.png' -c:v libx264 -r 30 -pix_fmt yuv420p /tmp/out.mp4
# Repeat video until CTRL+c (is very dense! )
ffmpeg -stream_loop -1 -i /tmp/out.mp4 -c copy /tmp/out_repeat.mp4
# Convert into MP4 yuv420p
@wildrun0
wildrun0 / compile-ffmpeg.sh
Last active May 23, 2024 09:36
Compiling ffmpeg for Raspberry Pi 4 (script only works fine on RPi OS 32bit). x64 does not support mmal (see https://github.com/raspberrypi/userland/issues/688)
#!/bin/bash
# Note that there's no libdrm because this lib cause errors
sudo apt update -y && sudo apt upgrade -y
sudo apt-get -y install \
autoconf \
automake \
build-essential \
@sharapeco
sharapeco / imageaudio2mp4
Created June 20, 2020 14:33
画像と音声からMP4動画を作る
#!/bin/sh
### 画像と音声からMP4動画を作る
# なんでかわからんけどこれで順番に引数が入る
image=$1
shift
audio=$*
# shift
# dai_3_no_hikisuu=$*
# example of using xargs to find files and sending files to a shell command with complicated file parsing
ls *mp4 | xargs -I{} sh -c 'base=$(basename $1 .mp4) ; ffmpeg -i "$1" -vcodec copy -an "${base}"_noaudio.mp4' -- {}