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 | |
# vim:sw=4:ts=4:et | |
################################################################################ | |
# # | |
# A shell script which searches youtube for a video or audio # | |
# and plays it in mpv. # | |
# Created by Supershadoe # | |
# # | |
################################################################################ |
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
vid2gif() { | |
file=$(realpath $1) | |
name=$(basename ${file/.*}) | |
ffmpeg -y -i "${file}" -vf fps=${3:-24},scale=${2:-480}:-1:flags=lanczos,palettegen "${name}.png" | |
ffmpeg -y -i "${file}" -i "${name}.png" -filter_complex "fps=${3:-24},scale=${2:-480}:-1:flags=lanczos[x];[x][1:v]paletteuse" "${name}".gif | |
rm "${name}.png" | |
} |
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
# (tested on Ubuntu 18.04 Desktop) | |
# Stream your own desktop to RTMP | |
ffmpeg -f x11grab -s 1920x1200 -framerate 15 -i :0.0 -c:v libx264 -preset fast -pix_fmt yuv420p -s 1280x800 -threads 0 -f flv "rtmp://127.0.0.1/live/mystreamkey" | |
# Broadcasting Examples | |
ffmpeg -f dshow -i video="Virtual-Camera" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://127.0.0.1:1234 | |
ffmpeg -f dshow -i video="screen-capture-recorder":audio="Stereo Mix (IDT High Definition" \ |
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' -- {} |
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
#!/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
# 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 | |
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
#!/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
for vid in *.mp4; do ffmpeg -i $vid -codec mjpeg -ss 4 -vframes 1 -q:v 1 ./covers/$vid.jpg; done |
NewerOlder