Skip to content

Instantly share code, notes, and snippets.

@shivasiddharth
shivasiddharth / piffmpegcompiler.sh
Last active June 21, 2020 16:58
Script to compile FFMPEG on Raspberry Pi for OMX acceleration
#!/bin/bash
echo "Compiling FFMPEG.........."
echo ""
sudo apt-get -y install autoconf automake build-essential cmake doxygen git graphviz imagemagick libasound2-dev libass-dev libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libfreetype6-dev libgmp-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev librtmp-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev libsnappy-dev libsoxr-dev libssh-dev libssl-dev libtool libv4l-dev libva-dev libvdpau-dev libvo-amrwbenc-dev libvorbis-dev libwebp-dev libx264-dev libx265-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb1-dev libxml2-dev lzma-dev meson nasm pkg-config python3-dev python3-pip texinfo wget yasm zlib1g-dev libgmp3-dev libgmp-dev libdrm-dev
cd /home/pi/
if [ ! -d ffmpeg/ffmpeg-libraries ]
then
mkdir -p ~/ffmpeg/ffmpeg-libraries
@shivasiddharth
shivasiddharth / nginx-hls.conf
Created June 21, 2020 13:36
Sample Nginx conf file for HLS streaming
worker_processes auto;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935;
chunk_size 4000;
@shivasiddharth
shivasiddharth / nginx-hls-dash.conf
Created June 21, 2020 13:37
Sample Nginx conf file for HLS and Dash streaming
worker_processes auto;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935;
chunk_size 4000;
@shivasiddharth
shivasiddharth / nginx-dash.conf
Created June 21, 2020 13:39
Sample Nginx conf file for Dash streaming
worker_processes auto;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935;
chunk_size 4000;
@shivasiddharth
shivasiddharth / nginx-rtmp-compiler.sh
Created June 21, 2020 13:41
Script to compile Nginx with RTMP module
#!/bin/bash
git clone https://github.com/sergey-dryabzhinsky/nginx-rtmp-module.git
sudo apt-get -y install build-essential libpcre3 libpcre3-dev libssl-dev
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -xf nginx-1.18.0.tar.gz
cd nginx-1.18.0
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module
make -j 1
sudo make install
@shivasiddharth
shivasiddharth / ffmpeg-rtmp-streaming
Created June 21, 2020 13:53
Sample commands to stream Pi webcam video to RTMP sink
# Command for streaming USB Webcam to RTMP sink without audio
/usr/bin/ffmpeg -y -f v4l2 -video_size 640x480 -framerate 25 -i /dev/video0 -vcodec h264_omx -f flv rtmp://localhost/show/stream
# Command for streaming USB Webcam to RTMP sink with audio
/usr/bin/ffmpeg -y -f v4l2 -video_size 640x480 -framerate 25 -i /dev/video0 -vcodec h264_omx -c:a aac -b:a 160k -ar 44100 -f flv rtmp://localhost/show/stream
@shivasiddharth
shivasiddharth / Google Assistant Windows
Last active May 25, 2021 16:21
Hints to install google assistant in windows
pip3 install google-assistant-grpc==0.3.0
pip3 install google-assistant-sdk==0.6.0
pip3 install google-assistant-sdk[samples]==0.6.0
google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype --scope https://www.googleapis.com/auth/gcm --save --headless --client-secrets $credname
@shivasiddharth
shivasiddharth / stremio-mint-ubuntu-install.sh
Last active February 17, 2023 12:47
Script to install Stremio on Linux mint
#!/bin/bash
clear
cd /home/${USER}/Downloads/
echo "Lets get entertained....................."
echo ""
wget "https://dl.strem.io/shell-linux/v4.4.116/stremio_4.4.116-1_amd64.deb"
sudo dpkg -i stremio_4.4.116-1_amd64.deb
wget "http://archive.ubuntu.com/ubuntu/pool/universe/x/x264/libx264-152_0.152.2854+gite9a5903-2_amd64.deb"
sudo dpkg -i libx264-152_0.152.2854+gite9a5903-2_amd64.deb
@shivasiddharth
shivasiddharth / videoscript.sh
Created November 11, 2020 09:45
Script to make mp4 video Da Vinci Resolve Compatible in Linux
#!/bin/bash
for f in *.mp4;
do ffmpeg -i "$f" -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le -preset ultrafast -f mov "$f".mov
done
@shivasiddharth
shivasiddharth / Nextcloud-steps.text
Last active November 22, 2020 05:38
How to install Nextcoud in Raspberry, Linux Mint or other Linux based systems.
1. Install snap:
#Do not worry if the below command says no file or directory
sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt-get update
sudo apt-get install snapd
#For Raspberry Pi Users alone:
sudo nano /etc/ld.so.preload
Comment the line that says /usr/lib/arm-linux-gnueabihf/libarmmem.so
sudo snap install snap-store