Skip to content

Instantly share code, notes, and snippets.

@datavudeja
datavudeja / ffmpeg.txt
Created December 30, 2025 20:20 — forked from aardbol/ffmpeg.txt
ffmpeg examples
# Add a subtitle to a video, set the language=eng, make it the default subtitle and store it as mkv
# $1 = video file, $2 = subtitle file
ffmpeg -i "$1" -i "$2" -map 0 -map 1 -metadata:s:0 language=eng -c copy -disposition:s:0 default "$1.mkv"`
# Add a subtitle to a video, copy just one audio stream, set metadata language=eng for the subtitle, make it the default one and store it as mkv
ffmpeg -i "$1.mp4" -i "$1.srt" -map 0 -map 1 -map -0:a:0 -c copy -metadata:s:s:0 language=eng -disposition:s:0 default "$1.mkv"
# Scale down every file to H265 720p using Intel QSV hardware encoding
find . -type f -exec ffmpeg -i {} -c:v hevc_qsv -s 1280x720 -global_quality 20 -c:a copy -c:s copy {}.mkv \; && find . ! -name '*.mkv.mkv' -exec rm {} \; && rename 's/.mkv.mkv/.mkv/' *
@datavudeja
datavudeja / ClipVideo.ps1
Created December 30, 2025 20:20 — forked from jeremyrsellars/ClipVideo.ps1
Clip YT audio
# Downloads the video and coverts to audio, then clips it from $start to $stop time and saves as $file
# The time formats must be "hh:mm:ss" and are relative to the beginning of the source video.
$youtubeUrl = "https://www.youtube.com/watch?v=T6SyM0Kw6GA"
$start = "00:00:36"
$stop = "00:04:55"
$file = "clip"
$youtube_id = [regex]::new("[^/=]+$").Match($youtubeUrl).Value
md $youtube_id -ErrorAction SilentlyContinue
cd $youtube_id
@datavudeja
datavudeja / gist:985587c768f7280a62223d643d1ba353
Created December 30, 2025 20:19 — forked from sebdi/gist:fede0f15c6e47737dc48089720d9ee36
Python script to create a youtube video from a slide deck
import os
import json
import requests
from pdf2image import convert_from_path
from pydub import AudioSegment
from pydub.utils import make_chunks
import subprocess
import time
# Configuration
@datavudeja
datavudeja / README.md
Created December 30, 2025 20:19 — forked from troykelly/README.md
Multi Screen Video Playback using ffplay

Stream.sh

stream.sh is a Bash script designed to stream multiple video sources to multiple screens using ffplay. This script ensures that each video stream is displayed on a specified monitor and restarts the stream if it fails. The script is optimized for real-time playback by using various ffplay options to reduce latency and handle frame drops effectively.

Features

  • Streams multiple video sources to multiple screens.
  • Ensures each stream is displayed on the specified monitor.
  • Restarts streams automatically if they fail.
  • Optimized for real-time playback with minimal latency.
@datavudeja
datavudeja / create-mp4-from-pictures.md
Created December 30, 2025 20:19 — forked from jfrobbins/create-mp4-from-pictures.md
Create mp4 from pictures
@datavudeja
datavudeja / clipper.md
Created December 30, 2025 20:19 — forked from BachLe2000/clipper.md
Send Video File As Clip

Send video file as clip

How to use this:

  1. Prepare your video file by using the clip metadata snippet in the Requirement section below.
  2. Press Ctrl+Shift+I to open DevTools and copy everything in Main Function section.

Note

If there is nothing poping up, you can:

  • Download the ptb client, or
  • Use this to enable DevTools on stable client.
@datavudeja
datavudeja / #pi_setup.md
Created December 30, 2025 20:19 — forked from haydenhhyc/#pi_setup.md
Raspberry Pi Media Server Setup

Raspberry Pi Media Server Setup

How to setup Pi to serve RGB and Thermal footage from cameras.

We're using the Logitech webcam c270 and Seek Compat for RGB and Thermal respectively.

1. Setup RTSP Server

Download mediamtx binary from: https://github.com/bluenviron/mediamtx/releases Latest version is v1.8.3 as of writing, change it accordingly.

@datavudeja
datavudeja / silencepad.md
Created December 30, 2025 20:18 — forked from tuurep/silencepad.md
ffmpeg: pad silence to the end of an audio file
@datavudeja
datavudeja / QUICK_START.md
Created December 30, 2025 20:18 — forked from emilwojcik93/QUICK_START.md
VideoCompressor - PowerShell video compression tool optimized for cloud storage

VideoCompressor - Quick Start Guide

GitHub Gist: https://gist.github.com/emilwojcik93/868fbc801667e65e334679fec62b6879

TLDR - Two Simple Commands

Step 1: Download script to profile directory

$profileDir = Split-Path $PROFILE -Parent; if(!(Test-Path $profileDir)){md $profileDir -Force}; iwr 'https://gist.githubusercontent.com/emilwojcik93/868fbc801667e65e334679fec62b6879/raw/VideoCompressor.ps1' -OutFile "$profileDir\VideoCompressor.ps1" -UseBasicParsing
@datavudeja
datavudeja / forever-livestream.md
Created December 30, 2025 20:17 — forked from felipeasimos/forever-livestream.md
Cheap 24/7 radio livestreaming

How to Make a 24h Music Livestream

Stream video and audio file in loop for youtube, using FFmpeg. FFmpeg will get the job done with 2 vCPUs in this scenario (I tried with 1 vCPU on lightsail, and buffering was a frequent occurance there). Since this is a 24/7 program, paying hourly would be unsustainable. In order to avoid that, a 2vCPU VPS is what you are looking for.

Contabo and OneTSolutions are good providers for this specific VPS use case.

1. Buy cheapest VPS you can

Carefully choose your plans, test your stream locally before to calculate specifically your requirements. Using the -listen option in ffmpeg and ffplay command are great for testing locally.