Youtube Sonic TAS community

Impossible is possible

You are not logged in.

#1 2013-03-23 00:53:01

WST
administrator
From: Maykop, RU · Jakarta, ID
Registered: 2012-10-06
Posts: 287
Website

Video encoding

Share your experience on encoding videos…
As for me, I never do HD encodes — I don’t consider them really needed.

I used to use VLC for this purpose, but recently I feel more comfortable with ffmpeg:

ffmpeg -i s2built.avi -c:v libx264 -preset veryslow -qp 0 s2built.mkv

Sonic the EDGEhog has been obsoleted by Amy the LTEhog ©

Offline

#2 2013-03-29 20:48:14

WST
administrator
From: Maykop, RU · Jakarta, ID
Registered: 2012-10-06
Posts: 287
Website

Re: Video encoding

This is very nice


Sonic the EDGEhog has been obsoleted by Amy the LTEhog ©

Offline

#3 2013-03-29 21:11:07

Qwerty
member
Registered: 2012-10-09
Posts: 98

Re: Video encoding

wow, but how?


My anger don't like you

Offline

#4 2013-03-30 07:24:03

feeuzz22
administrator
Registered: 2012-10-07
Posts: 249

Re: Video encoding

He shows on his channel how to:


Sonic is the fastest thing alive, and Hyper Sonic is the fastest thing.

Offline

#5 2013-03-30 10:26:00

WST
administrator
From: Maykop, RU · Jakarta, ID
Registered: 2012-10-06
Posts: 287
Website

Re: Video encoding

Hmm, I would try to do it in a simplier way. You know, there are level maps available for Sonic games. So we can take a high quality map of certain level and then write a Lua script, which will get Sonic’s X/Y position on every single frame and draw his current sprite in corresponding position of the map, then get camera’s X/Y position and crop corresponding area, extended to higher resolution. When cropping, it’s not really nesessary to rely on real camera’s position — we may simply crop some area containing Sonic instead.

The problems are:
— To get Sonic’s current sprite (texture)
— Objects will not move, and rings/monitors will not be collected
— To display the game’s hud. Probably solveable by displaying custom self-made hud.

These problems are not unsolveable, but they make the task significally more complex than it looks.


Sonic the EDGEhog has been obsoleted by Amy the LTEhog ©

Offline

#6 2013-10-10 16:56:30

WST
administrator
From: Maykop, RU · Jakarta, ID
Registered: 2012-10-06
Posts: 287
Website

Re: Video encoding

ffmpeg can be used for encoding HD videos. It includes a resampling filter which can use a lot of resampling algorithms, including Lanczos filter and some other algorithm called «experimental», which also looks good for the eye. I’ve wrote a very simple shell script for quick HD encoding:

#!/bin/bash

ffmpeg -i "$1" -c:v libx264 -vf scale=960:672 -b:v 1536k -r 30 -sws_flags experimental output.mkv

However, I don’t really think it makes any sense for the videos whose native resolution is 320×224, and the lossless encoding shown in the very first example, is better. By the way, here is a test video encode made this way: s2ae.mkv

(upd) I’ve just realized that Sega Atlas styled HD encodes can actually be made even much simplier than I described. If we have high quality level maps, we can simply take a screenshot of every frame, and automatically paste it into the corresponding place of the corresponding map fragment. It will probably even not need any complex algorithm of locating the matching place to put the screenshot — the camera position is always known. The only problem will be the hud, but it can somehow be hidden, right?


Sonic the EDGEhog has been obsoleted by Amy the LTEhog ©

Offline

#7 2013-10-13 18:36:51

WST
administrator
From: Maykop, RU · Jakarta, ID
Registered: 2012-10-06
Posts: 287
Website

Re: Video encoding

A new idea for an Atlas encode: comparing 2 different TASes of the same level. Just automated copy-pasting of screenshots from 2 different runs into one map. Will be very good to see where exactly the looser messed up smile

Could be also possible to colorize the second player in different colors. Just replace the colors in the screenshot in the area where the Sonic’s sprite is located. smile and also possible to generate a hud showing how far the leader went from the looser smile


Sonic the EDGEhog has been obsoleted by Amy the LTEhog ©

Offline

#8 2013-11-06 19:11:38

NES Atlas
member
From: Connecticut, USA
Registered: 2013-11-06
Posts: 1
Website

Re: Video encoding

WST wrote:

A new idea for an Atlas encode: comparing 2 different TASes of the same level. Just automated copy-pasting of screenshots from 2 different runs into one map. Will be very good to see where exactly the looser messed up smile

Could be also possible to colorize the second player in different colors. Just replace the colors in the screenshot in the area where the Sonic’s sprite is located. smile and also possible to generate a hud showing how far the leader went from the looser smile

I'm glad my atlas videos are encouraging more people to push this idea further smile

I've been making these videos for over 3 years now and can give much advice if needed so feel free to ask any questions you might have. There have been a couple others who have taken the same route and used LUA scripting to encode an atlas video (and even implemented tools directly into the emulator), but I still prefer to make them by hand as I can include extra features like animating sprites normally out of view, extrapolating effects across entire atlas map, and more.

My hope is one day somebody can come up with a way to actually play the game with this atlas view in real time!

Here's some examples of effects I hope you can implement in the future.

Multiple play throughs onto 1 map:

Animating off-screen sprites:

Extrapolating effects across entire map (when MJ flips on the light switch):

I've added your videos to my World Atlas Playlist as well! I hope you continue to develop this further and perhaps I'll finally start using your method if these extra features become possible to use smile

Last edited by NES Atlas (2013-11-06 20:19:25)

Offline

#9 2013-11-07 09:25:06

WST
administrator
From: Maykop, RU · Jakarta, ID
Registered: 2012-10-06
Posts: 287
Website

Re: Video encoding

I realize most of the possible improvements myself, but I’d like to remind you that everything is made just for fun, and it’s not my primary goal in TASing. Because if you begin to pay too much attention to the details, it will result in loosing time which you could spent TASing. Because my real life is really busy (I am alone working in my family, and my mom is sick [probably deadly] and unable to do anything herself), I prefer just to make the beginning… Like proof of concept. If someone can make a pull request to my github, I do not mind, but I am certainly not going to go that deep myself. smile


Sonic the EDGEhog has been obsoleted by Amy the LTEhog ©

Offline

Board footer

Powered by FluxBB

Яндекс.Метрика