Last active
June 19, 2025 09:50
-
-
Save toshvelaga/91157816f235c98030f945d2ae1ff7f3 to your computer and use it in GitHub Desktop.
ffmpeg to stream live video using tee muxer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | |
'-preset', | |
'veryfast', | |
'-tune', | |
'zerolatency', | |
'-g:v', | |
'60', | |
// audio codec config: sampling frequency (11025, 22050, 44100), bitrate 64 kbits | |
'-c:a', | |
'aac', | |
'-strict', | |
'-2', | |
'-ar', | |
'44100', | |
'-b:a', | |
'64k', | |
//force to overwrite | |
'-y', | |
// used for audio sync | |
'-use_wallclock_as_timestamps', | |
'1', | |
'-async', | |
'1', | |
'-flags', | |
'+global_header', | |
'-f', | |
'tee', | |
`[f=flv:onfail=ignore]${youtube}|[f=flv:onfail=ignore]${twitch}|[f=flv:onfail=ignore]${facebook}`, | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HI!
How can I input the video from camera to the ffmpeg?