Skip to content

Instantly share code, notes, and snippets.

FFmpeg Minimal Build for RTMP Streaming

This tutorial will work you through steps of configuring an FFmpeg build tailored for RTMP streaming on macOS. At first I think of making it support general live streaming, with additional protocols like HLS, but to keep things simple let's stick with RTMP for now. (Anyway, I do include HLS in the protocol list as well as some related bitstream filters but it's untested.)

Goal

The built FFmpeg executable should

@n3ksus
n3ksus / Dockerfile
Created April 28, 2021 03:40 — forked from kevmo314/Dockerfile
nginx + nginx-rtmp + ffmpeg + libsrt
FROM ubuntu:20.04
RUN apt-get -qq update && apt-get -qq upgrade
ENV NGINX_VERSION nginx-1.19.3
ENV FFMPEG_VERSION snapshot
ENV NGINX_RTMP_MODULE_VERSION 1.2.1
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/New_York
@n3ksus
n3ksus / hookalloverloads.js
Created May 17, 2020 05:32 — forked from FrankSpierings/hookalloverloads.js
Hook all overloads - Java/Android - Frida
function getGenericInterceptor(className, func, parameters) {
args = []
for (i = 0; i < parameters.length; i++) {
args.push('arg_' + i)
}
var script = "result = this.__FUNCNAME__(__SEPARATED_ARG_NAMES__);\nlogmessage = '__CLASSNAME__.__FUNCNAME__(' + __SEPARATED_ARG_NAMES__ + ') => ' + result;\nconsole.log(logmessage);\nreturn result;"
script = script.replace(/__FUNCNAME__/g, func);
script = script.replace(/__SEPARATED_ARG_NAMES__/g, args.join(', '));
script = script.replace(/__CLASSNAME__/g, className);
@n3ksus
n3ksus / compile-ffmpeg-nvenc.sh
Created March 1, 2020 09:06
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@n3ksus
n3ksus / install-ffmpeg-amazon-linux.sh
Created February 28, 2020 06:05 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@n3ksus
n3ksus / ffmpeg-nonfree-build-centos-7.sh
Created February 28, 2020 04:52 — forked from silverkorn/ffmpeg-nonfree-build-centos-7.sh
An automated script to build FFmpeg non-free on RHEL/CentOS with as much features as possible. (Including mediainfo for debugging)
# TODO: Verify to link statically some dependencies usually not available in a default instllation of RHEL/CentOS (ex.: libxcb)
###################
## Configuration ##
###################
FFMPEG_CPU_COUNT=$(nproc)
FFMPEG_ENABLE="--enable-gpl --enable-version3 --enable-nonfree --enable-runtime-cpudetect --enable-gray --enable-openssl --enable-libfreetype"
FFMPEG_HOME=/usr/local/src/ffmpeg
@n3ksus
n3ksus / linux-http-tcp.md
Created September 3, 2019 04:00 — forked from v5tech/linux-http-tcp.md
linux下查看http 并发和 tcp连接数

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@n3ksus
n3ksus / DeviceUuidFactory.java
Created February 19, 2019 08:57 — forked from beilly/DeviceUuidFactory.java
实现在设备上更通用的获取设备唯一标识
package com.benli.app.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
@n3ksus
n3ksus / DeviceUuidFactory.java
Created February 19, 2019 07:42 — forked from lenamuit/DeviceUuidFactory.java
Generate UUID for Android
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
public class DeviceUuidFactory {
@n3ksus
n3ksus / concat_binary.erl
Created August 22, 2017 08:12 — forked from halfelf/concat_binary.erl
Concatenate binaries in erlang
% concat, binary
B1= <<1,2>>.
B2= <<3,4>>.
B3= <<B1/binary, B2/binary>>.
% <<1,2,3,4>>