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
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
#!/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
#!/bin/bash | |
echo "" | |
echo "Checking memory size.........." | |
Totalmem=$(cat /proc/meminfo|grep MemTotal|grep -o '[0-9]*') | |
if (($Totalmem > 3500000)); then | |
echo "" | |
echo "You have got enough memory. No need for a swap partition.........." | |
echo "" | |
else |
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 | |
# all mp4 files in this directory | |
for file in ./*.mp4; do | |
# create new mp3 name | |
audio="${file%.mp4}.mp3" | |
# if .mp4 is file and .mp3 does not exists | |
if [ -f $file ] && [ ! -e $audio ]; then | |
# ffmpeg will convert mp4 to mp3 with the strongest compressing (-q:a 9) | |
# will show only panic logs | |
ffmpeg -hide_banner -loglevel panic -i $file -vn -codec:a libmp3lame -q:a 9 $audio |
These Scripts will install NGINX with the RTMP Module in the usual directories similar to installation with apt-get.
The RTMP-Server you get with this can then be used to do one ore more of the following:
- deliver streams in a local network
- deliver streams to websites similar to youtube
- transcode rtmp streams to hls video
- publish to multiple streaming providers
- record livestreams to a harddrive
- Sets device in
demo
mode: hides your notifications, fixed clock, full battery, wifi level) - Takes a screenshot and saves it into
captures
directory. Also to your clipboard, so it's ready for Paste - Exits demo mode
- Download
screenshot.sh
chmod +x screenshot.sh
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
# Encode a video in H.264 with a constant rate factor of 0 (visually non-lossy), run it through a filter for deinterlacing (Weston | |
# Three-Field), and do not re-encode the audio | |
ffmpeg -i input.mkv -c:v libx264 -crf 0 -filter:v w3fdif -c:a copy output_edit-x264-crf0-w3fdif.mkv | |
# H.264 video at an average bitrate of 25MB/s, and just copy the audio | |
# - `-an` disables audio on first pass | |
# - `-y` automatically overwrites an existing output file, but don't worry since it's /dev/null on the first pass | |
ffmpeg -y -i input.mkv -c:v libx264 -b:v 25000k -pass 1 -an -f mp4 /dev/null && \ | |
ffmpeg -i input.mkv -c:v libx264 -b:v 25000k -pass 2 -c:a copy output_edit-x264-abr25000.mkv |
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 | |
rev="12" | |
_log(){ | |
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log | |
} | |
_log_para(){ | |
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log |