Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ For instance if you plan on streaming to Twitch, set the OUTPUT to something lik
`OUTPUT` is the output file/stream. Can either start with `rtmp://`, `gs://` or end with `.mp4`. Defaults to `output.mp4`
`RATE` is the constant bitrate (CBR) used for the video. Defaults to `6000`
`RESOLUTION` is the resolution of the video. Defaults to `1280x720`
`TUNE` is the FFmpeg libx264 [tune setting](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune). Defaults to `zerolatency`
`URL` is the webpage to record. Required.

# Contributing
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const disableAudio = process.env.DISABLE_AUDIO === 'true'
const fps = process.env.FPS || 30
const rate = process.env.RATE || 6000
const resolution = process.env.RESOLUTION
const tune = process.env.TUNE || 'zerolatency'
const url = process.env.URL

async function main() {
Expand Down Expand Up @@ -80,7 +81,7 @@ async function main() {
`ffmpeg -y -loglevel error -hide_banner -async 1 -nostdin -s ${resolution} -r ${fps} -draw_mouse 0
-f x11grab -i $DISPLAY
-f pulse -ac 2 -i default
-c:v libx264 -preset veryfast -tune zerolatency -b:v ${rate}k -minrate ${rate}k -maxrate ${rate}k -g 30
-c:v libx264 -preset veryfast -tune ${tune} -b:v ${rate}k -minrate ${rate}k -maxrate ${rate}k -g 30
${audioConfig}
-ss 00:00:03 ${ffmpegDurationParams} -pix_fmt yuv420p ${exporter.getFFmpegOutputParams()}`.replaceAll(
/[\n\r\s]+/gm,
Expand Down