Forums
July 30, 2021, 07:05 AM

Author Topic: thoughts about converting all replay files uploaded to TUS to vids  (Read 509 times)

0 Members and 1 Guest are viewing this topic.

Offline TheMadCharles

somewhere in the discussion of developing TUS mobile app, there was a mention of converting all replay files to videos, so i want to ask couple questions regarding that

1. where would all of the videos be uploaded? at the time of writing this, we have 227,560 games, excluding replays uploaded in the files section. that can easily reach a terabyte, and im not sure if storing them locally is a good idea. i was thinking either YouTube or Streamable
2. what would the size and framerate be? i was thinking 720p and 50fps. i don't wanna do 1080p, cuz watching on a small screen would make all texts unreadable. not sure if 60fps is a good idea cuz game runs at 50fps, so scrolling frame-by-frame in 60fps would make things weird
3. how should we handle all of the backlog? again, over 220k replays, possibly more cuz not all games are bo1. if we were to do YT, we could potentially spam subboxes, which is not ideal
4. if a game is not bo1, how should it be structured? should there be 3 separate videos for each round? or should they be combined?
5. if we are going to do youtube, how should the description be structured and what should it contain? stuff like links to the game link, player profiles, scheme used, link to tus itself, explanation what is tus and/or tus league and/or a certain tournament and/or cup and maybe a brief description of what WA is and buy links?
6. if we are going to do youtube (again), considering what kind of backlog we have, what should be the upload schedule? we can't really do 1 per day cuz that'd take like 624 years, which is impossible. we'd need to upload multiple videos per hour, maybe 4 per hour? if my math isn't wrong, uploading the entire backlog would take 2370 days, or 6.5 years... oof

for recording itself, there's Armageddon Recorder (https://github.com/Tester798/armageddon-recorder), but at the time of writing this there's no documentation as to how to use it or compile it, and there are no releases there are releases, im blind, so i have no idea on how to potentially implement it
« Last Edit: June 20, 2021, 10:09 PM by TheMadCharles »

Offline MonkeyIsland

I like this idea but the needed space is insane. Have you tested a replay? For example how much a 30-min BnG game with 720p and 50fps would be?
I don't know about Youtube's policy. Is there a limit on how many videos you can upload?

Also that software by solemnwarning has not been updated. Not sure if it works with v3.8.1
Due to massive misunderstandings: MonkeyIsland refers to an island not a monkey. I would be a monkey, if my name was IslandMonkey meaning a monkey who is or lives on an island. MonkeyIsland is an island which is related to monkeys. There's been a legend around saying MonkeyIsland is a game. So please, think of me as an island or a game.

Offline Memox

I like this idea but the needed space is insane. Have you tested a replay? For example how much a 30-min BnG game with 720p and 50fps would be?
I don't know about Youtube's policy. Is there a limit on how many videos you can upload?

Also that software by solemnwarning has not been updated. Not sure if it works with v3.8.1

There's no limit to how many videos you can upload on YouTube, meaning that you can treat it as a cloud storage. However I would personally recommend 480p instead of 720p in order to make the upload and the rendering way, way faster and lighter. It's still enough to properly read the text, although not as sharp as HD of course.
\\\ My websites ///

My Worms Armageddon Review (and other blog posts about gaming)
The Autism-O-Meter

My Worms Videos
YouTube playlist

My (other) Reviews Hub
Steam Curator page

My Gamebook
Coming Soon!

Offline TheMadCharles

ill hit up cgar since he knows how to use armageddon recorder to get a sample

[...] I would personally recommend 480p instead of 720p in order to make the upload and the rendering way, way faster and lighter. It's still enough to properly read the text, although not as sharp as HD of course.

things might get zoomed in too much then

Also that software by solemnwarning has not been updated. Not sure if it works with v3.8.1

Tester798 made an update, ill try it out
uuh i didn't manage to make a video...? what...?
« Last Edit: June 20, 2021, 04:08 PM by TheMadCharles »

Offline TheMadCharles

ok, cgar helped me out with recording a game
i used https://www.tus-wa.com/leagues/game-227429/
it's a little bit over 28 mins

it weights almost 73MBs

Offline cgar

Using that size multiplied by the 227,560 games is surprisingly only 15.8TiB. Only slightly bigger than my home server. Perhaps within the realms of self hostable.
Though with something like YouTube the quality and bandwidth hit could be much better.

For encoding I actually just manually used ffmpeg to record the sound and encode the frames from the /getvideo WA command. ArmaRec still has slight audio issues.
This is the file's mediainfo: https://gist.github.com/cgarz/2a40a791515d1724bc8aab771bd25695

For mass conversion it might be wise to look into adding command line options to ArmaRec for batch operation. Perhaps even one per core to decrease encoding time if WA is receptive to running more than one video exporting instance.

Offline TheMadCharles

whoa, i totally underestimated the storage required

also thought of couple more points that i added to OP
5. if we are going to do youtube, how should the description be structured and what should it contain? stuff like the game link, player profiles, scheme used, link to tus itself, explanation what is tus and/or tus league and/or a certain tournament and/or cup and maybe a brief description of what WA is and buy links?
6. if we are going to do youtube (again), considering what kind of backlog we have, what should be the upload schedule? we can't really do 1 per day cuz that'd take like 624 years, which is impossible. we'd need to upload multiple videos per hour, maybe 4 per hour? if my math isn't wrong, publishing the entire backlog would take 2370 days, or 6.5 years... oof
« Last Edit: June 20, 2021, 10:11 PM by TheMadCharles »

Offline cgar

This may just be totally infeasible lol.

You would need to upload at least 26 games every hour to get it done in just under a full year. (227,560 games / 26 per hour / 24 hours in a day / 365.25 days in a year. Unless I'm dumb xD)

That means if it was 1 person they would have to upload a video every 2 minutes and 18 seconds. For a whole year. Non stop. No food breaks or bathroom breaks or sleep lmao

It also means that they would have to make sure to maintain an average upload speed of at least half a megabyte per sec for the whole year. Assuming an average file size of only 70MiB per game. Which is already a low estimate since that encode was at pretty low quality settings.
Plus, since YouTube re-encodes whatever you upload, it would be better to at least double the quality of the videos. That would mean over a megabyte of constant upload would be needed. Which is quite often not feasible for many non symmetric connections that prioritize download speed.

Offline XanKriegor

If we go this way, conversion should be automatic and by demand of a viewer. Yes, it will not show the picture instantly, but after first demand it will. Do we need all games converted at once? I guess no. Who can say how much games are never watched?

Offline MonkeyIsland

Well TUS server could use Youtube's API to upload the videos. I'm still not sure if such high number of videos are allowed in Youtube. At least the submission rate must be limited. Doesn't Youtube count it as flooding?

@cgar, How much did it take to convert that replay into video?
Due to massive misunderstandings: MonkeyIsland refers to an island not a monkey. I would be a monkey, if my name was IslandMonkey meaning a monkey who is or lives on an island. MonkeyIsland is an island which is related to monkeys. There's been a legend around saying MonkeyIsland is a game. So please, think of me as an island or a game.

Offline Komito

Isn't there a limit on YouTube until you become a verified YouTuber? Like you make so many subscribers or something?

Offline StepS

Also that software by solemnwarning has not been updated. Not sure if it works with v3.8.1
It actually has been. There was a commit made in 2015 that added support for v3.8 features way before 3.8's public release. It does also support the max export speed feature.
Tester798 made a fork that focuses on MP4 export, which is the one you probably want to use.
Dec 30 2013 23:59:44 <StepS> windowed mode isn't the only thing you need about frontend
Dec 30 2013 23:59:49 <StepS> you need it to be actually bigger
Dec 31 2013 00:00:13 <StepS> it actually is very small on my 15-inch full HD screen
Dec 31 2013 00:00:25 <StepS> while running at 640x480 or stretched mode makes it fuzzy
Dec 31 2013 00:00:44 <StepS> this problem has been around since the Worms Armageddon's release and no one has even tried to beat it
[...]

Offline Memox

Isn't there a limit on YouTube until you become a verified YouTuber? Like you make so many subscribers or something?

Back in the day you could upload only 15 minutes per video, but now this verifying process is pretty much granted the moment you subscribe.

Well TUS server could use Youtube's API to upload the videos. I'm still not sure if such high number of videos are allowed in Youtube. At least the submission rate must be limited. Doesn't Youtube count it as flooding?

@cgar, How much did it take to convert that replay into video?

At the time of writing this, no. You might upload 1000 videos a day and nobody in the YouTube team would bat an eye.

This may just be totally infeasible lol.

You would need to upload at least 26 games every hour to get it done in just under a full year. (227,560 games / 26 per hour / 24 hours in a day / 365.25 days in a year. Unless I'm dumb xD)

That means if it was 1 person they would have to upload a video every 2 minutes and 18 seconds. For a whole year. Non stop. No food breaks or bathroom breaks or sleep lmao

It also means that they would have to make sure to maintain an average upload speed of at least half a megabyte per sec for the whole year. Assuming an average file size of only 70MiB per game. Which is already a low estimate since that encode was at pretty low quality settings.
Plus, since YouTube re-encodes whatever you upload, it would be better to at least double the quality of the videos. That would mean over a megabyte of constant upload would be needed. Which is quite often not feasible for many non symmetric connections that prioritize download speed.

That's why I said you should either decrease the quality or use a video codec (or even better a file extension) that isn't too demanding. Even if you did have all of this in place with the perfect balance between quality and fluidity, you still had to sacrifice a lot of time. So yeah, maybe not a year, but we're still talking about months. There is one way however that might speed up the process a bit, that is putting multiple replays in a single vid. Even if it's 10 hours per video, that would probably be less intensive, and the final user can simply use timestamps to go directly to the replay he's interested in (which are embedded on the loading bar of YT itself). I don't know if that would make that much of a big difference though, especially regarding upload times.
« Last Edit: June 21, 2021, 12:26 PM by Memox »
\\\ My websites ///

My Worms Armageddon Review (and other blog posts about gaming)
The Autism-O-Meter

My Worms Videos
YouTube playlist

My (other) Reviews Hub
Steam Curator page

My Gamebook
Coming Soon!

Offline TheMadCharles

[...] At least the submission rate must be limited. Doesn't Youtube count it as flooding?
afaik you can upload 8 videos at once simultaneously. publishing a video (making it viewable and appear in sub boxes) is something else cuz you can make a video private when it's in the middle of getting uploaded

also, when i tried using arma recorder, there were couple details that might need adding:
- a toggle for camera lock
- if chat is pinned, how many rows should it be set to?
- double check what's the real framerate - is it 60 now? or 50? when i tried recording in 50fps, i felt like the recording process seemed a bit sped up
- allow to choose an external folder for sounds (in case someone uses WWPR sounds and wants a vid with original WA sounds)
- a toggle for the black fade in after loading
should i make issues on arma recorder's github repo for that?
« Last Edit: June 21, 2021, 01:24 PM by TheMadCharles »

Offline cgar

@cgar, How much did it take to convert that replay into video?

For the total time It's kind of hard to say since it was all done manually and separately instead of with armaRec. But it was pretty slow.

I've took some time to do some more testing to get an idea about the speed. This is still just manual encoding and is only for the png frames to mp4 part. And the chosen replay is the same as previous (28m 14s).

TestTimeSpeed
CPU, 720p, 60fps, placebo preset, 1 thread19m 28s1.45x
GPU, 720p, 60fps 9m 3s3.12x
CPU, 720p, 60fps, veryfast preset, 16 threads4m 11s6.19x
GPU, 480p, 60fps 4m 51s5.82x
CPU, 480p, 60fps, veryfast preset, 16 threads 1m 40s17x

CPU is the AMD 5950x and GPU is the AMD 6700XT. I expect the speeds to be faster in the future but atm I cant push them due to my dodgy PSU.

The sound part for ArmaRec can take quite some time. Last time I tested it the sound processing part took about 10 minutes for an 8 minute replay. And that was after turning on more compiler optimizations lol.
Which is the other reason I prefer my hacky bash script manual'ish approach over armaRec. It means I have to play the file twice, once for video exporting. and once at realtime for sound recording. But its still faster and better quality than ArmaRec currently is. For large replays at least.
So as well as batch abilities and the other improvements that Charles mentioned, the sound part would also need it's speed improved and the slight quality issue fixed. Though the sound issue might only be for non 50fps exports.

double check what's the real framerate - is it 60 now? or 50? when i tried recording in 50fps, i felt like the recording process seemed a bit sped up

The game logic is still tied to 50fps but the graphics can be more using tweening so you can specify almost whatever framerate you want.
And IIRC when exporting at 50fps you don't get any tweened frames. So it should look identical to pre 3.8.
Oh and the recording might seem sped up since when exporting frames with 3.8+, it will try to export frames as fast as possible. So depending on computer speed and disk write speed and how many fps you want the gameplay may look very fast.

Since the fps is now so flexible and its only an extra 10fps I would say that 60fps would be ideal. Since that's much more standard for monitors.
As for resolution, imo 720p is the sweet spot. 1080p may be too zoomed out for some, and 480p may be the opposite.
« Last Edit: June 22, 2021, 10:46 PM by cgar »