lossless1024 / StreaMonitor

Adult live stream downloader for advanced people. I could have chosen a better name.
GNU General Public License v3.0
177 stars 44 forks source link

vr support? #11

Closed xAstroBoy closed 1 year ago

xAstroBoy commented 1 year ago

stripchat \ xhamsterlivesome models have vr cams, it would be nice if you add the vr stream as well, is a wss link.

lossless1024 commented 1 year ago

This is a really good suggestion. It might require a change in the framework, but worth the effort, so please be patient, this will be added.

lossless1024 commented 1 year ago

I started to implement this, and works pretty good, but there are a few hard decisions that should be made, so I need a bit more time. And also I will have to add some post-processing, because the timestamps are aligned to the beginning of the stream and it is kinda inconvenient when the file starts from x hours.

xAstroBoy commented 1 year ago

I started to implement this, and works pretty good, but there are a few hard decisions that should be made, so I need a bit more time. And also I will have to add some post-processing, because the timestamps are aligned to the beginning of the stream and it is kinda inconvenient when the file starts from x hours.

as long we get the raw video without any conversion done by the browser, as the whole purpose is to replay it in a VR headset

lossless1024 commented 1 year ago

It's done. If you pull to the latest version, you can check. To add VR channel use scvr as site. Currently this is implemented as different sites so you'll have to add Stripchat and StripchatVR channels separately.

xAstroBoy commented 1 year ago

There's a small bug where the videos are in multiple clips when a stream gets interrupted, and there's no duration on the videos and mostly in the majority of the times in VR videos there's video glitches @lossles1024

lossless1024 commented 1 year ago

The post-processing is still missing, I'll fix it ASAP

lossless1024 commented 1 year ago

It is done with the latest commit, please check

xAstroBoy commented 1 year ago

@lossless1024 Found a better way to fix timestamps without postprocessing

ffmpeg -ignore_editlist 1 -i tmp.mp4 -codec copy output.mp4

use this command

lossless1024 commented 1 year ago

The code does exactly this, only without the ignore_editlist flag

xAstroBoy commented 1 year ago

The code does exactly this, only without the ignore_editlist flag

ignore editlist makes it faster as well, i tested and it fixed the entire video, probably because it skips the missing files clips from the stream and makes ffmpeg regenerate the timestamps

lossless1024 commented 1 year ago

Okay, then I add it.

lossless1024 commented 1 year ago

I pushed the modification. Also implemented some looping to avoid new files on every reconnection. Try it please.

xAstroBoy commented 1 year ago

I pushed the modification. Also implemented some looping to avoid new files on every reconnection. Try it please.

still happens when a VR stream drops.

lossless1024 commented 1 year ago

It shouldn't if the bot can continue immediately. However if it couldn't, then a new file will be created. Sorry, I can't make it better right now. If you can, feel free to submit a PR.

xAstroBoy commented 1 year ago

@lossless1024 i wonder, is possible to redirect the video thru a local url, then ffmpeg does the rest? this way we have a proper video and there's no need for post processing.

lossless1024 commented 1 year ago

TL;DR No.

Every websocket streaming implementation is custom as I saw. AFAIK FFmpeg doesn't even support websockets. This is the reason why I didn't want to include any websocket magic at all. Unfortunately there are these sites which use it. However I totally agree with the fact that websockets are pretty good for low-latency uses. On the actual VR site you don't see, but the connection drops there too, but you don't notice, because there are buffers and also the stream restarts almost immediately. The latest fix tries to continue the stream, but if it can't immediately, it restarts itself. Also the regular hls streams drop sometimes, you have to accept this for now. You can concat the videos if you want.

xAstroBoy commented 1 year ago

TL;DR No.

Every websocket streaming implementation is custom as I saw. AFAIK FFmpeg doesn't even support websockets. This is the reason why I didn't want to include any websocket magic at all. Unfortunately there are these sites which use it. However I totally agree with the fact that websockets are pretty good for low-latency uses. On the actual VR site you don't see, but the connection drops there too, but you don't notice, because there are buffers and also the stream restarts almost immediately. The latest fix tries to continue the stream, but if it can't immediately, it restarts itself. Also the regular hls streams drop sometimes, you have to accept this for now. You can concat the videos if you want.

im saying, emulate a local videoplayer that ffmpeg could intercept, and there download the video.

lossless1024 commented 1 year ago

Yes, kinda possible, but not that way! That is way too complicated and inefficient. And you probably won't have any benefits. The downloader does the downloading, and the ffmpeg process would also stop when an interruption happens, so it would produce the same splitted files. TBH, simply retrying a few times would maybe improve it, but I don't have time for it right now.

xAstroBoy commented 1 year ago

image @lossless1024 with one of my favourite models.

lossless1024 commented 1 year ago

Pushed a fix