Skip to content

Instantly share code, notes, and snippets.

@jordicenzano
jordicenzano / start-simple-streaming-server.sh
Last active September 8, 2021 23:34
Live streaming server RTMP in HLS out (1 rendition + overlay)
#!/usr/bin/env bash
# We assume ffmpeg installed (recommened v 4+)
# Acts as RMTP server for application named live (expects stream)
# transcodes the media data into h264-aac, craetes HLS 4s chunks,
# and sends the data to ~/origin
# Create 1 rendition1
# 854x480@30fps 1000Kbps (+ Overlay)
@macpit
macpit / GStreamer-1.0 some strings.sh
Created June 4, 2019 12:24 — forked from strezh/GStreamer-1.0 some strings.sh
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
#!/bin/bash
# Sample script to encode 6 bitrates with TC overlay.
#
FRAME_RATE=25
FRAME_SEP=\:
FONT=/path/to/fonts/OpenSans-Bold.ttf
decklink_opts="-format_code Hi50 -channels 2 -f decklink -threads 0"
encoder="h264_nvenc"
@afriza
afriza / install-ffmpeg-with-decklink-support-ubuntu-18.04-server.md
Last active May 6, 2024 22:45
Compiling and installing `ffmpeg` with Decklink SDK on Ubuntu 18.04 Server. Check out forks of this gist for more up-to-date info.
@gbraad
gbraad / README.md
Created March 16, 2019 01:25
ffmpeg with NDI

Follow the ffmpeg compilation guide here: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

copy "lib" and "include" directories from NDI sdk to ffmpeg_sources/ndi

use this modified build command:

cd ~/ffmpeg_sources && wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && tar xjvf ffmpeg-snapshot.tar.bz2 && cd ffmpeg && PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include -I$HOME/ffmpeg_sources/ndi/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib -L$HOME/ffmpeg_sources/ndi/lib/x86_64-linux-gnu" --extra-libs="-lpthread -lm" --bindir="$HOME/bin" --enable-gpl --enable-libass --enable-libfreetype --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libndi_newtek --enable-nonfree && PATH="$HOME/bin:$PATH" make -j4 && make install && hash -r

(I omitted some libraries I do not need, --enable what suits you better)

#!/bin/bash
#
# Copyright (c) 2015 - 2018 imm studios, z.s.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@reinzor
reinzor / stream_example.md
Last active April 1, 2024 13:36
GStreamer UDP stream examples

MJPEG

Server (Ubuntu 16.04)

gst-launch-1.0 -v filesrc location= /home/rein/Videos/big_buck_bunny_720p_30mb_0_0.mp4 ! decodebin ! videoconvert ! jpegenc ! rtpjpegpay ! udpsink host=localhost port=5000

Client (Ubuntu 16.04)

@stoyanovgeorge
stoyanovgeorge / ffmpeg_stream_check.ts
Last active January 3, 2022 16:40
Records 10 seconds of an UDP multicast stream and then it shows the stream settings using mediainfo. Requires medianfo and ffmpeg installed on the host
#!/bin/bash
stream=""
recording_dir=$HOME/recordings
while [[ ! $stream =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9] ]];
do
echo "Please enter a valid multicast address and port in the format: IP.AD.DR.ESS:PORT after the script name!"
read -r stream
done