streamscope automates the recording of Twitch streams in real-time for archival purposes. CLI-only, rather easy to set-up and use.
- Monitor up to 100 streamers to record at the same time (Twitch API limitation)
- Record live chats to a file, with customizable formatting
- Informations about a stream are written and updated in real-time (game name, stream title...)
- Adding and removing streamers to monitor can be done in real-time
streamscope is a standalone application that should run on any recent Linux OS, however it requires 2 third-party applications to work correctly:
- streamlink: used to record the live streams
- ffmpeg: used to post-process recordings
Make sure to have them installed and available either in the same directory as streamscope or in the PATH.
streamscope cannot run on Windows as it depends on built-in Linux commands.
- Run streamscope once to have it generate a config.json file
- Fill or edit settings in that fresh config.json file
- Create a text file somewhere, with the list of streamers (usernames) you want to monitor separated by new lines (you can also comment a line with
//before the streamer username) - Run streamscope with the path of your text file containing the streamers to monitor as an argument
- You're good to go!
streamscope can be run in a Docker container. The image that will be built includes streamlink and ffmpeg, so no host dependencies are needed.
Build the image:
docker build -t streamscope .Run the container:
docker run -d \
--name streamscope \
--restart unless-stopped \
-v ./files:/home/streamscope \
-v ./recordings:/home/videos \
streamscopeOr with Docker Compose:
docker compose up -dWhere:
./files— directory containing yourlist.txtandconfig.json./recordings— directory where recordings will be stored (settemp_pathandprocessed_pathin yourconfig.jsonto use this mount, e.g./home/videos/tempand/home/videos/processed)
If your twitch_id and twitch_secret are stored in config.json, no extra flags are needed.
Modifiers can be prepended to streamer usernames in the list file to change how they are recorded.
chat:— Record chat only, without video. Example:chat:shroud
// normal recording (video + chat)
osulive
// chat-only recording
chat:mrekkosu
debug: Print debug logs when performing various taskstwitch_id: Your Twitch client IDtwitch_secret: Your Twitch client secretquery_time: Check if the streamers are online every x secondsquality: The quality to record at, passed directly to streamlink, some possible values can be "best", "worst", "720p30", "160p" (see streamlink's documentation here)video_container: The container to use for recording, should be "mp4" or "mkv"temp_path: The path where currently recording videos will goprocessed_path: The path where processed videos will goproblematic_path: The path where problematic videos will go (when ffmpeg crashes while processing a recording)download_chat: "true" or "false", download chat or notcustom_chat: "true" or "false", if false the chat text file will be filled with what Twitch sends us directly without processing the text, if true thecustom_chat_patternneeds to be setcustom_chat_pattern: The pattern to follow to write chat message lines (see the available variables below)chat_var_when_empty: An object containing pattern values, if one of the chat message field is empty, it will be replaced by a specified string
Available values for custom_chat_pattern (between double curly brackets):
date: String, a date in the format "2000-12-31 23:59:59"badge_info: Stringbadges: Stringclient_nonce: Stringcolor: Stringdisplay_name: Stringemotes: Stringis_first_message: Booleanflags: Stringid: Stringis_moderator: Booleanis_returning_chatter: Booleanroom_id: Stringis_subscriber: Booleantimestamp: Stringis_turbo: Booleanuser_id: Stringuser_type: Stringcontent: String, the message content
You need Haxe 4.3.0 minimum (and haxelib) to build the project.
The compiler target for streamscope is C++. Install hxcpp with haxelib.
Download the libraries listed in the compile.hxml file using haxelib (haxelib install [dependency name]), and run haxe compile.hxml, or the run.sh file to directly run streamscope.
Alternatively, build the Docker image (see Docker section above) which handles all build dependencies automatically.
