Skip to content

Instantly share code, notes, and snippets.

@marshallmassengill
marshallmassengill / multicast_mediamtx.txt
Created November 6, 2023 16:00
Setup for MPEG-TS multicast/UDP streaming Test
Install gstreamer + plugins on one system:
gst-launch-1.0 -v mpegtsmux name=mux alignment=1 ! udpsink host=238.0.0.1 port=1234 videotestsrc ! video/x-raw,width=1280,height=720,format=I420 ! x264enc speed-preset=ultrafast bitrate=3000 key-int-max=60 ! video/x-h264,profile=high ! mux.
Download and install mediamtx to "receive" the stream sent from gstreamer.
https://github.com/bluenviron/mediamtx
mediamtx will be used to re-broadcast the stream over webrtc. This can be done on as many systems as seems reasonable for demonstrating multicast.
mediamtx.yml config file (note, this file needs to be edited to have the right IPs):
--------------------------------------------------
@sfahadshahzad
sfahadshahzad / kivy_decklink.py
Created February 22, 2022 01:47 — forked from cbenhagen/kivy_decklink.py
Example of using input from a Blackmagic Decklink or Ultrastudio card in kivy with the use of OpenCV and GStreamer.
@Skimige
Skimige / iptvsearch.py
Last active January 22, 2025 19:13
Scan IPTV channels
# iptvscan
# Script for scanning and saving IPTV playlist.
# Python v.3 required for using. https://www.python.org/downloads/
# Author: joddude <joddude@gmail.com>
# Disclaimer:
# This script is free and provided "as is" without any warranty.
# You can use it at your own risk.
# The author assumes no responsibility for any moral or material damage caused
@44213
44213 / ffmpeg-commands.sh
Created September 17, 2021 19:51 — forked from rowe-morehouse/ffmpeg-commands.sh
ffmpeg commands.
# To extract the sound from a video and save it as MP3:
ffmpeg -i <video.mp4> -vn <sound>.mp3
# To convert frames from a video or GIF into individual numbered images:
ffmpeg -i <video.mpg|video.gif> <frame_%d.png>
# To combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF:
ffmpeg -i <frame_%d.jpg> -f image2 <video.mpg|video.gif>
# To quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image:
@matiaspl
matiaspl / ffmpeg_delay_line.md
Last active November 5, 2023 20:57
FFMPEG based live stream delay line for Decklink

What is it for

FFMPEG based delay loop running in RAM for Blackmagic Decklink video cards. It's useful if you need a "profanity protection" buffer, but could also be used as a poormans instant replay.

How does it work

The idea behind this is to use exploit ffmpeg's concat filter as an intermediate buffer. The length of the delay line is set by the -t parameter before anullsrc in the example below ((or d after smptehdbars).

In my case I wanted PAL interlaced input and output. If you want to use different framerate change the format using the aproppriate -format_code parameter.

@stecman
stecman / ffmpeg_hls.md
Last active December 21, 2022 20:23
ffmpeg streaming examples

FFmpeg streaming

These are some ffmpeg command lines used when developing VHS dubbing controller.

HLS Stream (on Linux)

#!/bin/bash

# Stream a PAL 50i capture, cropped and de-interlaced using ffmpeg
@ProTechEx
ProTechEx / simplified-ffmpeg-build-qsv-nvenc-vaapi.md
Last active May 20, 2022 15:56
simplified-ffmpeg-build-qsv-nvenc-vaapi.md

FFmpeg build for NVIDIA & Intel hardware on Ubuntu 18.04LTS+:

Build platform: Ubuntu 18.04LTS

Goals: Generate an FFmpeg build that can utilize NVENC hardware acceleration on NVIDIA-based systems on Ubuntu 18.04LTS+.

First steps:

Purge all NVIDIA drivers first:

#!/bin/bash
ffmpeg -re -analyzeduration 100M -probesize 100M -stream_loop -1 -i <input_file.ts> \
-vf setdar=16/9 -f decklink -pix_fmt uyvy422 -format_code pal "DeckLink Mini Monitor"
@rowe-morehouse
rowe-morehouse / ffmpeg-commands.sh
Last active August 26, 2022 07:40
ffmpeg commands.
# To extract the sound from a video and save it as MP3:
ffmpeg -i <video.mp4> -vn <sound>.mp3
# To convert frames from a video or GIF into individual numbered images:
ffmpeg -i <video.mpg|video.gif> <frame_%d.png>
# To combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF:
ffmpeg -i <frame_%d.jpg> -f image2 <video.mpg|video.gif>
# To quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image: