Converts .live_chat.json
from yt-dlp to .mp4
video for overlaying live chats over recorded streams.
-
Install FFmpeg
(For Windows users: download ffmpeg.exe and place it next to the script file) -
Install dependencies
npm install
-
Download the YouTube stream with live chat replay using yt-dlp:
yt-dlp --live-from-start --write-subs https://www.youtube.com/watch?v=CqnNp8kwE78
-
After the stream download completes, a
video_id.live_chat.json
file will appear in the directory.
Pass this file to the script:node ./chat-to-video.js video_id.live_chat.json
When conversion is complete, the result will be in the
output.mp4
file
node ./chat-to-video.js [OPTIONS] video_id.live_chat.json -o output.mp4
-o output.mp4
--output output.mp4
- Output filename--width 385
- Video width--height 400
- Video height--frame-rate 10
- Video framerate--font 'bold 16pt Arial'
- Chat font--background-color '#000000'
- Chat background color--author-color '#aaaaaa'
- Author name color--message-color '#ffffff'
- Message text color--from 0
- Start time in seconds--to 60
- End time in seconds--no-avatars
- Skip downloading user avatars