devhotteok / TwitchLink

Twitch Stream & Video & Clip Downloader/Recorder. The best GUI utility to download/record Broadcasts/VODs/Clips.
https://twitchlink.github.io
MIT License
405 stars 33 forks source link

Automatic Log File Splitting to Prevent Excessive Size #189

Open BluestCloud opened 9 months ago

BluestCloud commented 9 months ago

Long running stream which restarts when I am asleep, so I use the scheduled downloads feature and go to sleep. When I wake up, the download is hanging. Presumably when the stream restarts, the previous download keeps hanging, it says stopping but cannot stop it.

Meantime the log files in user temp folder grows very large to several GBs with the last few lines of the below log repeating forever at a very fast rate. Only stops when application is closed. The new stream is never captured and the current download is corrupt(due to lack of demuxing I guess).

frame=1475399 fps= 60 q=-1.0 size=18501632kB time=06:49:49.99 bitrate=6163.7kbits/s speed=   1x
frame=1475519 fps= 60 q=-1.0 size=18503168kB time=06:49:52.00 bitrate=6163.7kbits/s speed=   1x
[2024-01-15 12:24:46,029][WARNING] Unable to write data to pipe.
[2024-01-15 12:24:46,029][WARNING] The following exception occurred.
[2024-01-15 12:24:46,029][WARNING] Unexpected Error: None
[2024-01-15 12:24:46,029][WARNING] Terminating subprocess.
[2024-01-15 12:24:46,029][INFO] Closing subprocess write channel.
[2024-01-15 12:24:56,035][WARNING] Subprocess was unresponsive and forced to terminate.
[2024-01-15 12:24:59,036][WARNING] Unable to write data to pipe.
[2024-01-15 12:24:59,036][WARNING] The following exception occurred.
[2024-01-15 12:24:59,036][WARNING] Unexpected Error: None
[2024-01-15 12:24:59,036][WARNING] Terminating subprocess.
[2024-01-15 12:25:03,084][ERROR][FFmpeg.py:87] Subprocess error occurred.
Crashed: 1
[2024-01-15 12:25:03,084][ERROR][FFmpeg.py:101] Subprocess crashed with exit code 62097.
[2024-01-15 12:25:03,084][WARNING] The following exception occurred.
[2024-01-15 12:25:03,084][WARNING] Process Error
ExitCode: 62097
Error: Crashed: 1
Process crashed
[2024-01-15 12:25:03,087][INFO] Download Failed
[2024-01-15 12:25:03,087][WARNING] Download failed for the following reason.
[2024-01-15 12:25:03,087][ERROR][BaseEngine.py:41] Unexpected Error: None
NoneType: None
[2024-01-15 12:25:03,094][WARNING] Unable to find pipe target.
[2024-01-15 12:25:03,094][WARNING] The following exception occurred.
[2024-01-15 12:25:03,094][WARNING] Unexpected Error: None
[2024-01-15 12:25:03,095][WARNING] Unable to find pipe target.
[2024-01-15 12:25:03,095][WARNING] The following exception occurred.
[2024-01-15 12:25:03,095][WARNING] Unexpected Error: None
[2024-01-15 12:25:03,095][WARNING] Unable to find pipe target.
[2024-01-15 12:25:03,095][WARNING] The following exception occurred.
[2024-01-15 12:25:03,095][WARNING] Unexpected Error: None
[2024-01-15 12:25:03,095][WARNING] Unable to find pipe target.
[2024-01-15 12:25:03,095][WARNING] The following exception occurred.