Skip to content

Instantly share code, notes, and snippets.

@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:
@gdavila
gdavila / tsduck_ffmpeg.md
Last active December 30, 2025 11:58
Comandos utiles
  • Send RTMP - bitmovin sample:
ffmpeg -re -f lavfi -i color=black:640x480:rate=ntsc,format=yuv420p -g 6 -r ntsc \
-b:v 5M -minrate:v 5M -maxrate:v 5M -bufsize:v 1M -preset ultrafast \
-vcodec libx264  -r ntsc -tune zerolatency  -muxrate 8M  \
-pcr_period 40 -f flv rtmp://live-input.bitmovin.com/streams/a1142cd9-69b0-45d2-a655-a6c980b806c5
  • Grabar multicast:
@stoyanovgeorge
stoyanovgeorge / change_vlan_ip_mask.bat
Last active January 23, 2026 08:37
A batch script for Windows 10 which can change the IP address, the network mask, the gateway, the DNS and the VLAN ID of an interface. You need to execute the script with admin rights.
@echo off
:: Configuration Variables
set "ifName=Ethernet 2"
set "ipAddress=10.88.167.35"
set "subnetMask=255.255.255.240"
set "vlanID=702"
:: set "defaultGateway=x.x.x.x"
:: set "primaryDNS=x.x.x.x"
@m1tk4
m1tk4 / bars_w_text.bat
Created March 4, 2020 17:59
SMPTE HD Bars + Overlay Text as TS Loop suitable for Mux
@echo off
:: Set duration in seconds
set duration=20
:: Temporary loop TS file to create
set loopfile=svc%1.ts
set "overlaytext=ABC-%2 / LTN"
:: Create the loop file
ffmpeg.exe ^
@m1tk4
m1tk4 / hevc-test-pattern.bat
Last active July 30, 2022 19:11
HEVC Test Pattern to UDP Multicast
@echo off
:: Set duration in seconds
set duration=10
:: Temporary loop TS file to create
set loopfile=loop.mkv
:: Target mpegts URL (ESCAPE &s with ^!!! and add double quotes)
:: see https://www.ffmpeg.org/ffmpeg-protocols.html#udp for full syntax
set "target=udp://239.0.0.1:1234?ttl=13^&pkt_size=1316"