Skip to content

Instantly share code, notes, and snippets.

@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.
@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:
@stoyanovgeorge
stoyanovgeorge / change_vlan_ip_mask.bat
Last active September 18, 2024 16:46
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"