Joined: 8/3/2012
Posts: 10
yeah, if I remember correctly youtube also had problems to decode x264-10bit encoded videos. yip, keeping it at 8bit and yuv420 for yt is the safe way to go.
Reviewer, Experienced player (918)
Joined: 11/18/2011
Posts: 311
Location: Morocco
Aktan wrote:
McBobX wrote:
I have a question:What is interlacing?Is it like deblink? What is the defferent betwen interlacing and deinterlacing?
Check http://www.100fps.com/
Thank you Aktan for the site,I learned a lot of informations about interlaciing.
I still learn more about English. https://www.youtube.com/user/McBobX100
I wrote:
Working is the best way to achieve goals in speedruning. Hardworking is a pain.
Reviewer, Experienced player (918)
Joined: 11/18/2011
Posts: 311
Location: Morocco
I was right when I was thinking that interlacing has relation with blending,But...I have another question about ng_deblink:Why it is very slow than TASBlend when previewing on VD or encoding?
I still learn more about English. https://www.youtube.com/user/McBobX100
I wrote:
Working is the best way to achieve goals in speedruning. Hardworking is a pain.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
TASBlend is a very simple filter (just separating the frames into pairs and combining them again with varying opacity), but Deblink has to examine every pixel and decide if it's part of a blinking sprite or not. It's more code and it does a lot more work.
Reviewer, Experienced player (918)
Joined: 11/18/2011
Posts: 311
Location: Morocco
creaothceann wrote:
TASBlend is a very simple filter (just separating the frames into pairs and combining them again with varying opacity), but Deblink has to examine every pixel and decide if it's part of a blinking sprite or not. It's more code and it does a lot more work.
So,the work that deblink does is the main reason that let it very slow,unlike TASBlend that doesn't much effort,it is faster. creaothceann,thank you for explaining to me the slowring reason for Deblink.
I still learn more about English. https://www.youtube.com/user/McBobX100
I wrote:
Working is the best way to achieve goals in speedruning. Hardworking is a pain.
Active player (279)
Joined: 4/30/2009
Posts: 791
So, how would one go about making an encode like this one, which displays the memory values on screen? https://www.youtube.com/watch?v=57jUrDd0fuw Would like to make a similar type of encode for my FE6 TAS, but don't know how to go about it yet.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
  • The part to the right can be just a bitmap that you draw the numbers over.
  • Drawing the numbers (decimal and hexadecimal) can be done with some functions that cut out characters from a font bitmap (e.g. 16*16 characters). This takes care of Frame Number and Real Time.
  • Game Time, Hex Time, GP, Lag, MP, Map, Floor, Encount, Shift and RNG have to be supplied from outside of Avisynth, for example with a LUA script that writes these values to a file and an Avisynth plugin that reads that file.
  • The names can be bitmaps; I don't know if they change significantly during the run but this can be supplied via the LUA Script too.
  • The RNG distribution can be a bitmap, and the marker can be just a small frame created via BlankClip.
And when you have to write a LUA script anyway you can also do Frame Number and Real Time that way too, I guess.
Active player (279)
Joined: 4/30/2009
Posts: 791
I was actually looking at something that can be turned into a tutorial for future encodes. Assume I don't know how to do any of those things, which would be pretty accurate. Just bullet pointing the steps involved is not enough. PS Lua is a word, not an acronym :)
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Searching for "final fantasy 4 nes font" eventually led me to this site and this image: I modified it a bit: We can now load that bitmap, extract a character's area and print it on the emulator output:
Language: Avisynth

# create the font clip (1 frame, completely white, alpha layer is transparent where the FontMask image is black) FontMask = ImageSource(path="FontMask.png", start=0, end=0).ConvertToRGB32 BlankClip(clip=FontMask, length=1, color=$FFFFFF) Mask(clip=last, mask_clip=FontMask) global Font = last BlankClip(length=1, width=256, height=244, pixel_type="RGB32", fps=60, color=$000063) # the NES frame Print_Index(last, 0, 0, 1) function Print_Index(clip c, int x, int y, int i) { src_x = (i % 5) * 16 src_y = (i / 5) * 16 Font.Crop(left=src_x, top=src_y, right=8, bottom=8) Layer(base_clip=c, overlay_clip=last, x=x, y=y) }
Printing a "char" instead of an "int" requires a conversion:
Language: Avisynth

function Print_Char(clip c, int x, int y, string s) { Assert(StrLen(s) == 1, "Print_Char: '" + s + "' is not a character") i = FindStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>-.abcdefghijklmnopqrstuvwxyz!?%/:", s) - 1 Assert(i >= 0, "Print_Char: character '" + s + "' is not in the font") Print_Index(c, x, y, i) }
Printing a string is done with a bit of recursion:
Language: Avisynth

function Print(clip c, int x, int y, string s) { (StrLen(s) == 0) ? c : c.Print_Char(x, y, s.LeftStr(1)).Print(x + 8, y, MidStr(s, 2)) }
(This creates one additional frame per letter, but the overhead should not be a problem, I guess.) A decimal or hexadecimal number can be easily converted with the standard Avisynth string functions (see the installed manual files). Reading values from a file can be done with ConditionalReader (one variable per file). So the biggest problem for me would be writing a Lua script that writes the values into text files, because I don't know Lua scripting (in- or outside of emulators). :)
Active player (279)
Joined: 4/30/2009
Posts: 791
Do you need to use a bitmap, or can you use a custom TTF font?
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
I don't know if this topic has been discussed before, but I was wondering that since modern Nvidia cards have hardware support for H.264 encoding (NVENC), if there are any software or plugins that could be used to take advantage of this. A mencoder or a kdenlive plugin would be wonderful.
Publisher
Joined: 4/23/2009
Posts: 1283
Warp wrote:
I don't know if this topic has been discussed before, but I was wondering that since modern Nvidia cards have hardware support for H.264 encoding (NVENC), if there are any software or plugins that could be used to take advantage of this. A mencoder or a kdenlive plugin would be wonderful.
There has been attempts in the past with CUDA on NVidia with x264, but in the end one of the main x264 developer said it was not beneficial. I forgot exactly why, but I do know that usually the HW solution doesn't do the more complicated stuff available in the H.264 spec. What we do in our encodes is use the most complicated parts of it to maximize the quality vs compression. I've not kept up so maybe there is something now that can utilize this.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
You could try asking these guys.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
It would be neat, though. NVENC can encode in real-time a 60FPS 1920x1080 videocapture of a game into a H.264 file, while taking something like 5% of the resources of the graphics card, and basically no resources from the CPU.
Publisher
Joined: 4/23/2009
Posts: 1283
Warp wrote:
It would be neat, though. NVENC can encode in real-time a 60FPS 1920x1080 videocapture of a game into a H.264 file, while taking something like 5% of the resources of the graphics card, and basically no resources from the CPU.
Like I said, most likely with a simpler settings. The crazy settings we do to squeeze every last byte is probably not possible on it. I do admit it would be great if it can be used, and I could be completely wrong now since I've not kept up.
Joined: 8/4/2011
Posts: 26
Location: Sweden
I'm trying to upload a couple encodes but I've never quite understood how to upload high quality TASes to youtube. I'm trying to dump some videos from Gens11b. First off I checked the video dumping page and then dumped an RGB lagarinth encoded AVI from Gens11b which looks great in its native resolution. On youtube however it looks like this. Yuck. So anyway reading the required programs I downloaded what I believe is Avisynth 2.6 alpha as specified (although the folder it installed to was named 2.5). I wanted to download the x264 encoder as well but there's a whole bunch of links on the komisar-site and I don't know which one/'s I'm supposed to download or where to put them, if that even matters. So anyway after searching the forums a bit it seems like I just want to upscale it in some way using avs-scripts but whenever I google that I get forum posts full of random code I can't read or use and screenshots using some form of GUI I can't find. Also the actual enconding guide in the encoding guide gives a line with some settings but no commands that again upscales the video for youtube. I'm also finding posts that x264 is unsuitable for youtube... Great. So I'm a bit tired and at a loss and all I want is some videos on youtube that doesn't look like you're watching someone stirring oatmeal on the screen. tl;dr anyone has an avs script file to upscale a 320*224 genesis video to HD for youtube? Or can point me in the right direction? Thank you
Samsara
She/They
Senior Judge, Site Admin, Expert player (2107)
Joined: 11/13/2006
Posts: 2821
Location: Northern California
Language: avisynth

PointResize(1280,896)
That's all you need, just add that to the .avs and it should resize perfectly.
TASvideos Admin and acting Senior Judge 💙 Currently unable to dedicate a lot of time to the site, taking care of family. Now infrequently posting on Bluesky
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
Joined: 8/4/2011
Posts: 26
Location: Sweden
I'm finding a couple of options when googling but how would you suggest I run it? Also I edited the code so that it looks like this:
x264 --sar 14:15 --crf 0 --keyint 100 --ref 16 --no-fast-pskip --bframes 16 --b-adapt 2 --direct auto --me umh --merange 64 --subme 11 --trellis 2 --partitions all --input-range pc --range pc --no-dct-decimate --PointResize(1280,896) --tcfile-in times.txt -o GH1.mp4 HG1.avi
I don't know how the code is read but that's how I interpreted your message. Also again, thanks for the help.
Publisher
Joined: 4/23/2009
Posts: 1283
Welp hopefully I can help you. First get the latest software: Lagarith: http://lags.leetcode.net/LagarithSetup_1327.exe (You probably already have this) Avisynth: http://sourceforge.net/projects/avisynth2/files/AviSynth_Alpha_Releases/AVS%202.6.0%20Alpha%205%20%5B130918%5D/AviSynth_130918.exe/download VirtualDub: http://sourceforge.net/projects/virtualdub/files/virtualdub-win/1.10.4.35491/VirtualDub-1.10.4.zip/download x264: http://download.videolan.org/pub/videolan/x264/binaries/win32/x264-r2479-dd79a61.exe Install Lagarith (which you probably already did) and Avisynth. VirtualDub just extract somewhere and I'll tell you where to place x264.exe (rename x264-r2479-dd79a61.exe to x264.exe to make it easier). You already figured out how to capture so I won't tell you how to do that. Now you have an AVI. I'm guessing HG1.avi. Place that AVI in an empty directory with x264.exe. In that same directory, create a new "AviSynth Script" (either right click a blank area and go to "New" or go to File->New). Now name that new file as something and then open that blank file in a text editor (like Notepad). Inside enter the following lines:
AVISource("HG1.avi")
PointResize(1280, 896)
(Change "HG1.avi" if that is not the correct filename) And save. Now open VirtualDub.exe in the extracted VirtualDub directory and in VirtualDub, open the AviSynth script you created above. If all goes well, you should see video. Now for some question before listing the next steps. How fast is your internet? If you have fast internet, you can encode really fast and upload it in very nice quality. Also how much free hard drive space do you have? For the best quality to YouTube, you need a bit of space. Not too much if the clip is short. Let me know if you have any questions.
Joined: 8/4/2011
Posts: 26
Location: Sweden
Ah, thanks that reply was all I needed. You can comfort yourself in the fact that your post was 10x more informative than the guides on the site, good work! I have about 80Mb/s upload (advertised as 100Mb/s, scammers) and about 500gigabyte of free HDD space. My files are between 15 and 60 seconds since they're just recordings of IL's I'm gonna upload as references for a guide I'm making. Anyway I guess I could ask about if there's anything other than just "export AVI" I could do to increase the quality or if all options just try to optimise compression or whatever (which I'm not interested in for this purpouse).
Publisher
Joined: 4/23/2009
Posts: 1283
I'm guessing you had no problem getting video in VirtualDub then. Well you have awesome speed so size really isn't a factor. I forgot one last program: MKVToolNix: http://app.fosshub.com/download/mkvtoolnix-7.2.0-setup.exe/18c9c22ad234b9394b750fb66f11f321 Get that and install it. Do you want 4k video? If so, change the
PointResize(1280, 896)
line to
PointResize(last.width * 12, last.height * 12)
In fact I made mistake in telling you that line last post. It should have been originally
PointResize(last.width * 4, last.height * 4)
So you have a choice. I think you can tell which is which. I also forgot to give you two more lines to add to the AviSynth script. They are:
ConvertToYV24(matrix="Rec709", chromaresample="point")
ConvertToYV12(matrix="Rec709", chromaresample="point")
So all the lines together should be something like:
AVISource("HG1.avi")
PointResize(last.width * 12, last.height * 12)
ConvertToYV24(matrix="Rec709", chromaresample="point")
ConvertToYV12(matrix="Rec709", chromaresample="point")
Test it out to make sure it works fine in VirtualDub again by opening the AviSynth script. After you are satisfied on the video size, go to (in VirtualDub) File->Save WAV... and save the audio WAV file somewhere. You will need that later. Now for video, open command prompt on the folder where the AVI, AviSynth script, and x264.exe is. You can do this easily via hold down the shift key and right clicking the folder and go to "Open command window here". Once in command prompt, type the following command:
x264.exe --qp 0 --keyint infinite --input-range tv --range tv --colormatrix bt709 --output <whatever>.mp4 <whatever>.avs
Where the first <whatever> is the output file you want and the 2nd <whatever> is the name you set to the AviSynth script. After that is done (which should be pretty quick), open "mkvmerge GUI." Click on add on the right and add both the MP4 file for video and WAV file for audio. You can change where to output to near the bottom and once you are satisfied, press "Start muxing" at the bottom which will create a MKV file. You can play this file back to see if it is fine (depends if you have the right codecs installed), then upload it to YouTube. Don't forget to add the tag yt:stretch=4:3 to correct the aspect ratio. If you have any questions let me know. Also provide a YT link on the final result! I love to see it =)!
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
TimpZ wrote:
You can comfort yourself in the fact that your post was 10x more informative than the guides on the site, good work!
Are you sure?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 8/4/2011
Posts: 26
Location: Sweden
I uploaded an AVI straight from virtualdub with the settings from your previous post and it turned out like this which I'm not entirely happy with. I could try increasing the resolution but I'm wondering if Youtube's encoder is to blame for the loss of quality or if something else could be done. I'll try the convert-command you posted though. Also I'm not sure about why you would extract the audio just to edit it straight back, any particular reason for this? There's one last thing I'd like to try out and that is slowing the framerate to 30fps (while keeping the number of frames intact) and slowing down the audio a similar amount so you can have 60fps video using the 2x speed option on youtube. Is there a script for that? Would you recommend slowing the audio in something like audacity or can that be done with scripts as well? feos, while that is a very helpful page I can't find it through the "Articles" tab. If it is there then it's well hidden. EDIT: I haven't tried it yet but for regular uloads on YT would it be smarter to dump AVI's using frameskip 1? Assuming that gives a native 30fps framerate on the video.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
It's because it's not part of the "Publication Work". Any ideas how to link it better?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
feos wrote:
http://tasvideos.org/EncodingGuide/CustomEncoding.html
Language: Avisynth

ChangeFPS(25)
:(
TimpZ wrote:
I uploaded an AVI straight from virtualdub with the settings from your previous post and it turned out like this which I'm not entirely happy with. I could try increasing the resolution but I'm wondering if Youtube's encoder is to blame for the loss of quality or if something else could be done. I'll try the convert-command you posted though.
What exactly is wrong with it?
TimpZ wrote:
There's one last thing I'd like to try out and that is slowing the framerate to 30fps (while keeping the number of frames intact) and slowing down the audio a similar amount so you can have 60fps video using the 2x speed option on youtube. Is there a script for that? Would you recommend slowing the audio in something like audacity or can that be done with scripts as well?
Language: Avisynth

AVISource("input_file.avi") AssumeFPS(FrameRateNumerator, FrameRateDenominator * 2) AssumeSampleRate(AudioRate / 2)
TimpZ wrote:
I haven't tried it yet but for regular uploads on YT would it be smarter to dump AVIs using frameskip 1? Assuming that gives a native 30fps framerate on the video.
Not every console/emulator uses/dumps exactly 60fps. You can add "info" to the Avisynth script to see the exact frame rate. Dumping 60fps is still useful if you want to TASBlend / Deblink, but there's no reason to upload more than 30fps to YT (not discounting your "2x speed option" which I haven't tested.)