This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i filename.ogg -vn -c:a libopus -ar 16k -ac 1 -b:a 16k -vbr on -compression_level 10 new_filename.ogg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for vid in *.mp4; do ffmpeg -i $vid -codec mjpeg -ss 4 -vframes 1 -q:v 1 ./covers/$vid.jpg; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### 画像と音声からMP4動画を作る | |
# なんでかわからんけどこれで順番に引数が入る | |
image=$1 | |
shift | |
audio=$* | |
# shift | |
# dai_3_no_hikisuu=$* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' -- {} |