Skip to content

Instantly share code, notes, and snippets.

@git-thinh
git-thinh / ffmpeg.js
Created June 19, 2025 09:49 — forked from toshvelaga/ffmpeg.js
stream to twitch and youtube RTMP destinations using FFmpeg
const ffmpeg = child_process.spawn('ffmpeg', [
// the input
'-i',
'-',
// video codec config: low latency, adaptive bitrate,
// list of presets: https://trac.ffmpeg.org/wiki/Encode/H.264
// tune zerolatency is good for fast encoding and low-latency streaming
// g:v 60 ==> https://www.reddit.com/r/ffmpeg/comments/redaa2/while_livestreaming_to_youtube_using_ffmpeg_i_get/
'-c:v',
@git-thinh
git-thinh / ffmpegTee.js
Created June 19, 2025 09:50 — forked from toshvelaga/ffmpegTee.js
ffmpeg to stream live video using tee muxer
const ffmpegTee = (youtube, twitch, facebook) => {
return [
'-i',
'-',
// select first stream intended for output
'-map',
'0',
// video codec config: low latency, adaptive bitrate
'-c:v',
'libx264',