thelabcat / rumble-chat-actor

Interact with the chat of your livestreams in Python
GNU General Public License v3.0
2 stars 0 forks source link

Clip resolution is too low #4

Closed thelabcat closed 4 months ago

thelabcat commented 4 months ago

When clips are saved, the TS is already at a low resolution, but the concatenated clip from those is even lower.

Proposed solution:

  1. Up the resolution of the m3u8 by adjusting the URL.
  2. If the URL is valid, test to make sure that we can download the TS chunks from the m3u8 at least twice as fast as playback speed (compare its duration to download time).
  3. If the URL is invalid or the test fails, settle for the lower resolution.
  4. Figure out how to keep higher resolution in MoviePy, or switch video editing libraries.
thelabcat commented 4 months ago

See the documentation on VideoClip().write_videofile() for info on how to effect step 4.

thelabcat commented 4 months ago

Confirming, steps 1 and 2a can work. Invalid URLs will give a 404 status code. TYJ!

Should probably make the resolution picking dynamic with the cache.

If the stream is a DVR, we could save time and bandwidth by only downloading TS when a clip is made, as the chunks stay in Rumble Cloud memory for the whole stream. This would also mostly eliminate the need for dynamic resolution picking.

thelabcat commented 4 months ago

Completed in alpha.