Skip to content

Instantly share code, notes, and snippets.

View Bioblaze's full-sized avatar

Bioblaze Payne Bioblaze

View GitHub Profile
@Bioblaze
Bioblaze / geninterruption.bash
Created June 26, 2020 05:27 — forked from chezsick/geninterruption.bash
Create Your Own Interruption! ;;;;;;;;;;; args :::::::::: vid1 vid2 vid3 vid4 vid5 outvid [second_for_countdown] ;;;;;;;;;;;;;;;;;;;;;;;; Inspired By ::::::::::::::::::::: https://www.youtube.com/watch?v=V3qdak_VgqQ
intone=30
inttwo=43
intthree=67
intfour=101
intfive=115
tmp=$(mktemp -d)
ffmpeg -y -t $intone -i "$1" -vf framerate=40,scale=768x576 -vcodec libx264 -an $tmp/one.avi
ffmpeg -y -t $inttwo -i "$2" -vf framerate=40,scale=768x576 -vcodec libx264 -an $tmp/two.avi
@Bioblaze
Bioblaze / ffmpeg-wrapper
Created June 26, 2020 05:27 — forked from inksong/ffmpeg-wrapper
ink-ffmpeg-wrapper
#!/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
@Bioblaze
Bioblaze / FFmpeg-tricks.md
Created June 26, 2020 05:27 — forked from isaactzab/FFmpeg-tricks.md
FFmpeg on ubuntu

FFmpeg Tricks

Repeat/loop Input Video

The -loop option is specific to the image file demuxer and gif muxer, so it can't be used for typical video files, but you can use the concat demuxer.

Concat demuxer

Make a text file. Contents of an example text file to repeat 4 times.

$ cat list.txt
file 'input.mp4'
@Bioblaze
Bioblaze / compile_ffmpeg.md
Created June 26, 2020 05:27 — forked from teocci/compile_ffmpeg.md
Compile FFmpeg on Ubuntu 16.04

Compile FFmpeg on Ubuntu

This basic guide supports Ubuntu Xenial Xerus 16.04 and will enable several external encoding and decoding libraries: libfaac (AAC encoder), libfdk-aac (AAC encoder), libmp3lame (MP3 encoder), libopencore-amr (AMR encoder/decoder), librtmp (for additional RTMP protocols), libtheora (Theora encoder), libvorbis (Vorbis encoder), libvpx (VP8 encoder/decoder), and libx264 (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters (see the filter list in the [Filtering Guide][1].

Note: Copy and paste the whole code box for each step.

Preparation

#! /bin/bash -x
VBR="2500k"
FPS="30"
QUAL="medium"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="rtsp://xxx.xxx.xxx:554/Streaming/Channels/1"
KEY="xxxxxxxxxxxxxxxx.xxx-xxx-qms4-emuc"
#ffmpeg \
raspberry pi livestream to YouTubeLive
/boot/run.sh
/boot/youtube.sh
/etc/rc.local
additional line to /etc/fstab
@Bioblaze
Bioblaze / mp4-to-mp3-extractor.sh
Created June 26, 2020 05:26 — forked from dimon4ezzz/mp4-to-mp3-extractor.sh
the script extracts mp4 files to compressed mp3 audio
#!/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
@Bioblaze
Bioblaze / README.md
Created June 26, 2020 05:26 — forked from Ghedeon/README.md
Screenshot & Recorder

1. Screenshot

Description (no more than one connected device):

  1. Sets device in demo mode: hides your notifications, fixed clock, full battery, wifi level)
  2. Takes a screenshot and saves it into captures directory. Also to your clipboard, so it's ready for Paste
  3. Exits demo mode

Usage:

  1. Download screenshot.sh
  2. chmod +x screenshot.sh
@Bioblaze
Bioblaze / _README.md
Created June 26, 2020 05:26 — forked from kfatehi/_README.md
Rebroadcasting an icecast stream to another icecast server with inline transcoding

What?

A one-liner that pulls an AAC stream, pipes it into ffmpeg which transcodes it to mp3, then pipes it into ezstream with your settings (in the xml file) which streams it your radio.

Dependencies

sudo apt-get install ficy ffmpeg ezstream

@Bioblaze
Bioblaze / ffmpeg-add-voiceover.sh
Created June 26, 2020 05:25 — forked from rileyjshaw/ffmpeg-add-voiceover.sh
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