MyGit

stream-rec/stream-rec

Fork: 46 Star: 536 (更新于 2024-10-21 01:14:52)

license: MIT

Language: Kotlin .

Automatic streaming record tool. Live stream and bullet comments recorder. 虎牙/抖音/斗鱼/Twitch/PandaTV直播,弹幕自动录制

最后发布版本: v0.7.2-fix1 ( 2024-10-19 20:17:53)

GitHub网址

English | 简体中文

Stream-rec

Stream-rec is an automatic stream recording tool for various streaming services.

It's powered by Kotlin, Ktor, and ffmpeg.

This project is the result of my personal need for a tool that can automatically record live streams and upload them to cloud storage.

[!NOTE]
This project is the result of my personal learning of Kotlin Coroutines, flow, Ktor, dao, repository pattern and other technologies.

Features

  • Automatic stream recording, with configurable quality and format.
  • Automatic file naming based on the stream title and start time.
  • Automatic Danmu(Bullet comments) recording
  • Persistent storage of stream and upload information (using SQLite)
  • Integration with Rclone for uploading to cloud storage
  • Configurable via web interface.
  • Docker support
  • FLV AVC fix support

Supported streaming services

Service Recording Danmu Url format
Douyin https://www.live.douyin.com/{douyinId}
Douyu https://www.douyu.com/{room}
Huya https://www.huya.com/{room}
PandaTV https://www.pandalive.co.kr/live/play/{room}
Twitch https://www.twitch.tv/{room}
AfreecaTv
Bilibili
Niconico
Youtube
  • More services will be supported in the future (if I have time, PRs are welcomed).

Screenshots

login.png dashboard.png streamers.png

Installation

1. Docker Compose (Recommended)

1.1 Configuring the docker-compose.yml file

Create a docker-compose.yml, take a look at the example configuration file.

Please read the comments in the configuration file for more information and make sure to modify crucial parts like passwords, paths, etc.

1.2 Running the Docker compose

Make sure you are in the same directory as the docker-compose.yml file, then run the following command:

docker compose up -d && docker compose logs -f

Now, you are all set! You can access the web interface at http://localhost:15275 and start configuring the tool ( see Configuration).

[!NOTE]
You can detach from the logs by pressing Ctrl + C. And you can reattach to the logs by running docker compose logs -f. To stop the containers, run docker compose down.

2. Building from source

2.1 Prerequisites

  • Internet access, obviously 😂
  • Git (Used to get the version information by the backend)
  • A java development kit (JDK) (version 21 or later), Amazon Corretto 21 is recommended.
  • FFmpeg (Make sure it's in your PATH). No longer required if you are using the kotlin engine.
  • FFprobe (Make sure it's in your PATH). Required if Exit on download error is enabled.
  • Streamlink (optional, for recording streams, make sure it's in your PATH)
  • Rclone (optional, for uploading to cloud storage, make sure it's in your PATH)
  • Sqlite3 (for storing stream, upload information, make sure it's in your PATH)

2.2 Building the backend

To build the project, first clone the repository and navigate to the root directory of the project.

git clone https://github.com/hua0512/stream-rec.git
cd stream-rec

Then, build the project using the following command:

./gradlew stream-rec:build -x test

The built fat jar file stream-rec.jar will be located in the stream-rec/build/libs directory.

2.2.1 Running the jar file

To run the jar file, use the following command:

java -jar stream-rec/build/libs/stream-rec.jar

Several environment variables can be set to configure the tool:

  • DB_PATH: Path to the SQLite database folder. (default: ./db)
  • JWT_SECRET: Secret key for JWT token generation.
  • LOG_LEVEL: Log level (default: info).
  • LOGIN_SECRET: Login password for the web interface (default: stream-rec, if not set).

For example:

java -DDB_PATH=/path/to/your/db -DLOG_LEVEL=DEBUG -DJWT_SECRET=SECRET -DLOGIN_SECRET=123 -jar stream-rec/build/libs/stream-rec.jar

[!IMPORTANT]
Things to note:

  • Please set the LOGIN_SECRET environment variable to a secure password. This password is used to log in to the web interface.
  • This password cannot be changed after the first run.

2.3 Building the frontend

Frontend is used to configure the tool, it's a simple web interface built with React.

Navigate to frontend repository and follow the build instructions.

After that, you can start configuring the tool by accessing the web interface at http://localhost:15275. Take a look at the Configuration page for more information.

Troubleshooting

Check logs under logs directory, by default, it will be created in the same directory as the DB_PATH.

  • There´s a environment variable LOG_LEVEL that can be set to debug to enable debug logs.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please feel free to open an issue or a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Credits

Star History

Star History Chart

最近版本更新:(数据更新于 2024-10-22 12:21:03)

2024-10-19 20:17:53 v0.7.2-fix1

2024-09-03 19:05:56 v0.7.1

2024-07-27 04:18:18 v0.7.0

2024-07-03 06:03:06 v0.6.9

2024-06-21 21:58:52 v0.6.8

2024-06-16 09:37:28 v0.6.7

2024-06-04 20:14:52 v0.6.6

2024-03-03 23:16:35 v0.3.1

2024-02-22 00:59:46 v0.3.0

主题(topics):

douyin, douyu, downloader, huya, streaming-recorder, twitch

stream-rec/stream-rec同语言 Kotlin最近更新仓库

2024-10-22 15:19:49 Mygod/VPNHotspot

2024-10-21 17:56:29 gkd-kit/gkd

2024-10-19 01:31:54 jellyfin/jellyfin-androidtv

2024-10-15 09:33:42 gotson/komga

2024-10-11 04:29:00 yairm210/Unciv

2024-10-09 13:03:35 MatsuriDayo/NekoBoxForAndroid