Skip to content

Instantly share code, notes, and snippets.

View DevStefIt's full-sized avatar
👨‍💻

Stef DevStefIt

👨‍💻
View GitHub Profile
@DevStefIt
DevStefIt / rtmp_server_commands.txt
Last active June 5, 2024 20:33
A list of commands to configure a Nginx server to send data through RTMP
# All the commands have been tested on a Xubuntu 22.04
# First we update our machine
sudo apt update
sudo apt upgrade
# We install the Nginx server
sudo apt install nginx
# We test and enable the firewall if it is disabled
sudo ufw status
@DevStefIt
DevStefIt / ffmpeg_dash.sh
Last active February 8, 2024 22:12
HLS and DASH guide on an Nginx server with RTMP mode enabled, with FFmpeg as support
ffmpeg -re -i INPUT -c:v libx264 -c:a aac -preset slower -f dash ARBITRARY_NAME.mpd
from tkinter import Tk
from tkinter.filedialog import askopenfilename
from pathlib import Path
import subprocess
Tk().withdraw()
input_file = Path(askopenfilename(title='Load video file', initialdir=f"{Path.home()}"))
input_projection = 'equirect'
output_projection = ['c3x2', 'c6x1', 'c1x6',
'eac',
@DevStefIt
DevStefIt / pyav_copystream.ipynb
Last active May 27, 2023 16:51
PyAV - first approach
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DevStefIt
DevStefIt / bmp_creator.py
Created June 2, 2023 14:08
BMP File Format programs used in the video
import random
from PIL import Image
def create_random_image(width, height):
# Create a new blank image with RGB mode
image = Image.new('RGB', (width, height))
# Create a pixel map
pixels = image.load()
@DevStefIt
DevStefIt / wav_creator.py
Created January 1, 2024 13:06
WAV file creator and parser as explained in the related video
import wave
import struct
import math
# Audio parameters
sample_width = 2
sample_rate = 44100
duration = 5
# Define the melody