Skip to content

Instantly share code, notes, and snippets.

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@shahnhogan
shahnhogan / download-redisinsight.cmd
Last active October 21, 2023 12:01
Download latest RedisInsight for Windows
curl -O https://download.redisinsight.redis.com/latest/RedisInsight-v2-win-installer.exe
@lynt-smitka
lynt-smitka / fbclid.htaccess
Last active November 6, 2023 13:10
Remove fbclid argument from the URL in .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*?)(&?fbclid=[a-zA-Z0-9_-]+)$
RewriteRule ^(.*)$ /$1?%1 [L,NE,R=301]
</IfModule>
@Brainiarc7
Brainiarc7 / ffmpeg-desktop-livestreaming-nvenc-and netcat.md
Last active December 13, 2023 03:27
This gist will show you how to livestream your Linux desktop to a client via FFMpeg using a GPU-accelerated video encoder (NVENC and VAAPI-based)

Low-Latency Live Streaming for your Desktop using ffmpeg and netcat:

Preamble:

In this post I will explore how to stream a video and audio capture from one computer to another using ffmpeg and netcat, with a latency below 100ms, which is good enough for presentations and general purpose remote display tasks on a local network.

The problem:

Streaming low-latency live content is quite hard, because most software-based video codecs are designed to achieve the best compression and not best latency. This makes sense, because most movies are encoded once and decoded often, so it is a good trade-off to use more time for the encoding than the decoding.

@cbarraco
cbarraco / ffmpeg screen sharing
Last active December 24, 2023 09:46
The poor man's VNC. If you have ffmpeg and netcat you can stream your screen across your network with two one-liners
# If the server has ffmpeg:
## For the server:
ffmpeg -f fbdev -i /dev/fb0 -f avi pipe:1 | nc -l -p 1234
## For the viewer:
nc 127.0.0.1 1234 | ffplay -i pipe:0
# If the server doesn't have ffmpeg:
## For the server:
sudo cat /dev/fb0 | nc -l -p 1234
## For the viewer (replace 1920x1080 with the server's resolution):
@kurlov
kurlov / mkv embed soft subtitles
Created December 16, 2017 23:41
ffmpeg command to add .srt based subtitles to an .mkv file
ffmpeg -i in.mkv -f srt -i in.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt out.mkv
@dlqqq
dlqqq / ryzen_bug.md
Last active February 22, 2024 22:22 — forked from wmealing/C-states.md
AMD Ryzen "Freezing" Bug on GNU/Linux Systems

Random "Freezing" with AMD Ryzen CPUs

It seems that numerous GNU/Linux users (including myself) have been having issues with the system randomly "freezing" during light usage. From journalctl output and anecdotal accounts, it is speculated that the AMD Ryzen CPUs do not support other C-states for power management very well (at least on GNU/Linux distributions), and the freezing may be resolved by limiting the C-state of the CPU.

Possible Solution

Limiting the C-state of the CPU can be done through the addition of the following kernel boot parameter.

processor.max_cstate=1
@giu1io
giu1io / load_wifi.sh
Last active February 24, 2024 10:00
Shell script that loads the WPA_supplicant configuration and use it to connect to available networks, if none is available it an AP is created. Include Wi-Fi watchdog service that checks that the connection is always working.
#!/bin/bash
WPA_SUPPLICANT_CONF="/etc/wpa_supplicant/wpa_supplicant.conf"
# this funcion is called once the connection is established,
# in this case a boot sound will be played to notify the user that everything is ready.
function connected {
aplay /root/Windows3.1.wav 2>&1 >/dev/null &
}
@harv
harv / glibc-2.17_centos6.sh
Last active March 1, 2024 08:42
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
@lynt-smitka
lynt-smitka / fbclid-nginx.conf
Last active March 13, 2024 18:56
Remove fbclid argument from the URL in Nginx
http {
...
# redirect map in http block - remove fbclid argument from the end
map $request_uri $redirect_fbclid {
"~^(.*?)([?&]fbclid=[a-zA-Z0-9_-]+)$" $1;
}
...