Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
Hi there! BizHawk users should use this guide instead! It's much quicker and easier!
Hi there. It's me, your buddy Samsara. Do you need a shiny temp encode for your WIP or submission, but don't have the time, knowledge, or Spikestuff required to do it? Then this guide is probably for you! I've been making temp encodes in my spare time for as long as I can remember, at least after that nasty bout of permanent retrograde plot amnesia I developed during what fans call "easily the worst arc of the series", so this guide is going to teach you my method for knocking these babies out, because I know exactly what all y'all want, and it's to be more like me. I'm not claiming this is the quickest or even easiest way, but it works for me and it's easy enough for most people to understand. It's a pick-up-and-go sorta deal now. Coupla clicks and boingy-banga-kabonga, you got yourself a brand spankin' new encode ready to shove onto someone else's stream in a month or so before you upload it to YouTube and submit! This process will not make publication-quality encodes. If you're a beginner and you want to make publication-quality encodes, I've got a couple choice words for you. But seriously, if you want to learn how to make publication-quality encodes, you'll want to read basically any other thing in this subforum. This guide is for nothing more than temporary encodes! Okay. Right. Got that? I hope so. If not, read it again. To anyone who's actually good at encoding: If you have any way to improve this guide to make it easier or more efficient, by all means post it! EDIT2: Due to some recent things happening with downloads, it is time for some Solid Rewriting. Everything should be easier now. PART ONE: DUMPING, AND NOT THE DIRTY KIND Actually getting the video to encode involves a fun process known as frame dumping, which in layman's terms means "recording the dang video". The emulators we use for the site all have AVI recording options, which can be found in menus. Look around, you'll see it. When you want to record your sweet TAS or your sweet WIP or your sweet ass, you sexy sexy beast, pause the emulator and load up the movie. If you're using FCEUX or other non-BizHawk emulators, make sure the sound is on before starting to record, otherwise your dump will most likely be without audio! Most versions of BizHawk should be able to dump audio while being muted, though BizHawk 1.11.7 specifically adds a Sound Master Enable option that must be on. Now for the actual recording part. When starting a recording, you'll get a choice between video codecs. The best option to use for great looking encodes is a little codec known as Lagarith, which comes with a nice and easy installer so I don't have to tell you to hunt down a specific folder. I don't have all day, here, even in written form! The default option when dumping, Full Frames (Uncompressed), is exactly as it sounds. It dumps every frame perfectly without caring about compression or file size. This will give you picture-perfect, lossless quality, but even a tiny 1-minute Game Boy video may take up hundreds of MB. Lagarith is also a lossless codec, but it's very much easier on the ol' hard drive, giving just as perfect dumps with much lower file sizes. Lagarith is preferred in every case, so get it, use it, and love it. When your TAS or WIP finishes, just stop AVI recording at a suitable time and your video will magically appear where you told it to, just like computers always do! PART TWO: THE NEW AND IMPROVED EASY PART Before, this was a long section of the guide that told you to download a bunch of codecs and set up a specific environment, but I had an epiphany after most of those links went dead and everything is much simpler now. Just download this here folder: https://dl.dropboxusercontent.com/u/10529315/Encoding%20-%20Temp.7z https://mega.nz/#!tz4hjTBR!fVvYv2FjRJO1tY8ru869uC_TTBljLAtOOZXcJvKUqqs HOLY H*CK, 2020 EDIT: THIS IS 4 YEARS OUT OF DATE! I'll update it with a new, modernized version in the near future. Everything still works, just DO NOT UPDATE ANYTHING IN MEGUI, EVEN IF PROMPTED! This is a portable MeGUI setup that contains all the codecs I recommended, as well as AvsPmod for editing AVS files, as well as a couple premade AVS files that can be edited. After you get that, all you have to do is four simple instructions: 1. Unzip the folder to a location of your choice 2. Open up one of the AVS files (aaa-consoletemps or aaa-handheldtemps) and paste in your full video path. The easiest way to get that is to Shift+Right Click your video and choose "Copy as path". Your AVISource line should look roughly like this:
Language: Avisynth

AVISource("C:/Users/You/Pornography/video1.avi")
If you have a much longer encode that's split up into multiple parts, you'll want to do something like this:
Language: Avisynth

AVISource("part1.avi") + AVISource("part2.avi") + AVISource("part3.avi")
or
Language: Avisynth

AVISource("part1.avi", "part2.avi", "part3.avi")
And so on and so forth for each individual part. If you made a temp that includes different parts of different resolutions, then you may have noticed that an error gets thrown up if you try to do this. You have to manually resize each clip to be the same resolution before it'll let you encode. A messy, but simple-to-remember, way to do this is as follows, but you can check the other posts in this thread when someone inevitably tells me how to do it better:
Language: Avisynth

AVISource("part1.avi").PointResize(1024,896) + AVISource("part2.avi").PointResize(1024,896) + AVISource("part3.avi").PointResize(1024,896)
If you do this, you don't need the standalone PointResize at the end, since you're already manually resizing everything to an HD resolution. 3. Open up MeGUI and drop in the AVS file, and after that all you gotta do is click Autoencode. It should already be set to No Target Size (Use Profile Settings), if it isn't then just choose that option and go forward. Now you have a shiny new HD encode ready for YouTube! Continue reading the thread for other pieces of advice, such as how to properly format DS game encodes.
Edit by feos: If the above is for whatever reason not easy enough for you, we also have a solution that's simplified to the point of stupidity (sometimes it's exactly what's needed): http://tasvideos.org/EncodingGuide/CasualEncoding.html
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.
Spikestuff
They/Them
Editor, Publisher, Expert player (2656)
Joined: 10/12/2011
Posts: 6444
Location: The land down under.
Language: AviSynth

AVISource("video.avi") i = Height / 2 top = Crop(0, 0, -0, -i) bottom = Crop(0, i, -0, -0) StackHorizontal(top, bottom) PointResize(last.width * 4,last.height * 4)
Language: AviSynth

AVISource("video.avi") i = Height / 2 top = Crop(0, 0, -0, -i) bottom = Crop(0, i, -0, -0) right = last left = top.Pointresize(bottom.Width() * 2, bottom.Height() * 2) StackHorizontal(left, right) PointResize(last.width * 2,last.height * 2)
On this one you can switch the text "top" and "bottom" around to choose a main screen.
Language: AviSynth

AviSource("video.avi") i = Height / 2 bottom = Crop(0, i, -0, -0) top = Crop(0, 0, -0, -i) top PointResize(last.width * 4,last.height * 4)
On this one the basic text "top" can be switched to "bottom" if you just want the main screen only. If your game runs at 30fps add this to the end of the code:
Language: AviSynth

ChangeFPS(30)
You can also mute lines of code by putting "#" at the start.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
ars4326
He/Him
Experienced player (778)
Joined: 12/8/2012
Posts: 706
Location: Missouri, USA
Keep this guide coming, guys! You're making a layman like me feel like he could know what he's doing on encoding movies, lol.
"But as it is written, Eye hath not seen, nor ear heard, neither have entered into the heart of man, the things which God hath prepared for them that love him." - 1 Corinthians 2:9
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
I've been watching some crappy 144p encodes... This guide will definitely be linked to those people. Nice work!
Post subject: Re: [GUIDE] Creating quick, HQ temp encodes
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Samsara wrote:
For the sake of temporary encoding, I highly suggest using Lagarith. It's fast and lossless while keeping the initial AVI's filesize reasonable.
There's also the ZMBV codec which is included in DOSBox and shows up in BizHawk as "Zipped Motion Block Video". It records only the changes from one frame to the next, saving some space, which in the end may be faster.
Samsara wrote:
Language: AviSynth

AVISource("(your video file)") PointResize(last.width * 8,last.height * 8)
"last" isn't strictly needed... Here's some code that automatically calculates the necessary zoom level:
Language: Avisynth

file_name = "video clip.avi" AVISource(file_name) i = Get_ZoomLevel(Height, 1) PointResize(Width * i, Height * i) function Get_ZoomLevel(int h, int i) { # 720 lines enables Youtube's HD mode (h * i >= 720) ? i : Get_ZoomLevel(h, i * 2) }
Samsara wrote:
PointResize, to put it simply, resizes your video. There are many resizing filters available in AviSynth, but you'll almost always want to use PointResize for your TAS temp encodes. Anything sprite-based with clearly defined pixels will benefit more greatly from PointResize, which is... well, 90% of the content on this site.
If the video is from a TV-based system then "BilinearResize(960, 720)" might look better.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11489
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Haven't read the entire thing (it's so long, seriously), but here's what I've been doing for years for quick encodes: http://tasvideos.org/EncodingGuide/CustomEncoding.html And when talking about pub-quality encodes, it's better to link here: http://tasvideos.org/EncodingGuide/PublicationManual.html
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.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
Added a section about joining together multiple parts to the OP.
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.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Alternative:
Language: Avisynth

AVISource("part1.avi", "part2.avi", "part3.avi")
Experienced player (691)
Joined: 11/23/2013
Posts: 2234
Location: Guatemala
How do you encode DS movies but from the touch screen instead?
Here, my YouTube channel: http://www.youtube.com/user/dekutony
Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
Kurabupengin wrote:
How do you encode DS movies but from the touch screen instead?
Refer back to Spikestuff's post.
Spikestuff wrote:
Language: AviSynth

AVISource("video.avi") i = Height / 2 top = Crop(0, 0, -0, -i) bottom = Crop(0, i, -0, -0) right = last left = top.Pointresize(bottom.Width() * 2, bottom.Height() * 2) StackHorizontal(left, right) PointResize(last.width * 2,last.height * 2)
On this one you can switch the text "top" and "bottom" around to choose a main screen.
Bolded for emphasis. I don't know how specifically to change them, but I'm sure someone else will jump in with the correct answer. Until then, keep playing around with the script in AvsPmod until it works.
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.
Spikestuff
They/Them
Editor, Publisher, Expert player (2656)
Joined: 10/12/2011
Posts: 6444
Location: The land down under.
Samsara wrote:
Spikestuff wrote:
On this one you can switch the text "top" and "bottom" around to choose a main screen.
I don't know how specifically to change them, but I'm sure someone else will jump in with the correct answer. Until then, keep playing around with the script in AvsPmod until it works.
Was:
Language: AviSynth

top = Crop(0, 0, -0, -i) bottom = Crop(0, i, -0, -0)
Now:
Language: AviSynth

bottom = Crop(0, 0, -0, -i) top = Crop(0, i, -0, -0)
And now we have the bottom screen as the main screen.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Editor, Expert player (2079)
Joined: 6/15/2005
Posts: 3282
Actually encoding 8x versions through x264 takes an awful long time though. My guess is the time to encode goes up as the square of the scale factor. When I added a temp Youtube encode for [2888] SNES Mega Man X2 by Hetfield90 in 31:15.15, I uploaded a 3x version (combined with the black space I added at the bottom puts it over 720 pixels in height, thus invoking Youtube's 720p60 mode). I skipped using x264 entirely and just uploaded Camstudio lossless-encoded video to Youtube, which I think is far faster even though the file size is much bigger. I don't think there is an easy usability solution though (those that just want an encode out there are going to select inferior AVI writer options or FFmpeg writer options which give lower size outputs but bad quality video, and just upload that straight to Youtube. And it won't be 60fps either). Although, I'd mention that if you do care about quality, you should at least use a lossless codec like Camstudio or Lagarith, even if the output file is much larger (it's worth the quality), and upload that directly. It will still be 30fps at most however. Personally I don't worry too much about scaling up the video; the only reason I scaled it up 3x for Youtube was to get the 60fps mode. Then again, I'm more used to making downloadable versions and uploading for other sites, for which there are strict limits on final filesize and there really isn't any reason to scale up the video unless it is really small or something.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
Just posting here to remind myself to actually update the guide with individual codec links instead of the codec pack I had recommended in the past. Eventually the guilt will overtake me and I'll provide the proper updates.
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.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
I've uploaded a 7z of my (cleaned up) MeGUI folder that should, in theory, be completely set up to do temp encodes straight out of the gate. Instructions: 1. Unzip the folder somewhere 2. Edit one of the two included AVS files (aaa-consoletemps or aaa-handheldtemps) to point to a video of your choosing. AvsPmod is included, but you can technically use any editor you like. 3. Open MeGUI, click and drag the AVS file in. 4. AutoEncode, should already be on No Target Size (Use Profile Settings) so just click through If this works, I'll add it to the OP and rewrite the guide to surround it. Should solve all of the link/codec/actual effort problems that are currently plaguing the guide. EDIT: you know adding the link might help, samsara https://dl.dropboxusercontent.com/u/10529315/Encoding%20-%20Temp.7z
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.
MediaMagnet
He/Him
Moderator
Joined: 8/15/2016
Posts: 27
Location: Austin TX
zipped up file works great and the tutorial is great.
"Do not meddle in the affairs of Dragons, for you are crunchy and taste good with ketchup!"
Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
MediaMagnet wrote:
zipped up file works great and the tutorial is great.
Thanks for the report! OP updated with the download and new info. Also going to move this to the Encoding subforum (with a shadow topic here) just for more visibility or something, I dunno.
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.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
- Why "aaa"? If it's intended to show up as the first files, "_console_.avs" and "_handheld_.avs" would look better imo. - "logs" isn't empty - 101 "*.backup" files - "update_cache" can be cleared?
Samsara
She/They
Senior Judge, Site Admin, Expert player (2240)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
creaothceann wrote:
- Why "aaa"? If it's intended to show up as the first files, "_console_.avs" and "_handheld_.avs" would look better imo. - "logs" isn't empty - 101 "*.backup" files - "update_cache" can be cleared?
- Who cares? - Who cares? - Who cares? - Who cares?
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.
MediaMagnet
He/Him
Moderator
Joined: 8/15/2016
Posts: 27
Location: Austin TX
i saw in the guide you mentioned putting an avisource for each file... wouldn't this work instead?
Language: avisynth

AVISource("file1.avi","file2.avi","file3.avi")
"Do not meddle in the affairs of Dragons, for you are crunchy and taste good with ketchup!"
Masterjun
He/Him
Site Developer, Skilled player (1988)
Joined: 10/12/2010
Posts: 1185
Location: Germany
Yes, using + or just putting multiple file names in the function do the same thing.[1]
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
JorWat25
He/Him
Player (18)
Joined: 1/15/2015
Posts: 79
Location: United Kingdom
Samsara, your MeGUI folder link doesn't seem to exist any more. Can you re-upload it?
Editor, Reviewer, Skilled player (1360)
Joined: 9/12/2016
Posts: 1646
Location: Italy
JorWat25 wrote:
Samsara, your MeGUI folder link doesn't seem to exist any more. Can you re-upload it?
Here is a new download link: https://mega.nz/#!tz4hjTBR!fVvYv2FjRJO1tY8ru869uC_TTBljLAtOOZXcJvKUqqs Spikestuff said that Dropbox has updated some random stuff which privates the files for some reason.
my personal page - my YouTube channel - my GitHub - my Discord: thunderaxe31 <Masterjun> if you look at the "NES" in a weird angle, it actually clearly says "GBA"
Stovent
He/Him
Publisher
Joined: 8/23/2016
Posts: 165
Location: France
I've made two files to put in the TASEncodingPackage that do quick HD encodes and is faster that MeGUI (I took 15mn with MeGUI and 7 mn with my files to encode a 33mn movie with same settings) and faster to setup, my output is just 15% heavier than his but this can be changed by using a higher crf value (temp.bat) They are a small avs script and a batch file to launch the encode. Can you tell me if it is good or what have to be changed ?
[17:37:00]<TheCoreyBurton> It's N64 - it's ALWAYS bad news.
Pokota
He/Him
Joined: 2/5/2014
Posts: 779
We don't actually need AviSynth for single dump temp encodes since FFmpeg has a scalar that accepts Nearest Neighbor. We do still need AviSynth if the dump created multiple files (any PSX dump) or if it's DS Footage (see SpikeStuff's above post on the matter), but if we can cut out Avisynth's processing that saves save time on the encode. Stovent's AVS Script:
AviSource("movie.avi")
ChangeFPS(30)
PointResize(width * 4, height * 4)
return last
First - this forces 30 FPS by deleting frames. Not necessarily a good thing, though if the game is native 30 FPS I guess there's no loss of fidelity? Second - this will not give Youtube HD for GBx footage. Also, we can upscale using FFmpeg - see my batch file at the end of the post. Third - You do not need return last, since avisynth is weird and doesn't require return last if the last line of your script is a clip and isn't a variable declaration. Stovent's Batch File:
@echo off

echo.
echo -------------------------
echo -   Encoding HD audio   -
echo -------------------------
echo.
:: Audio ::
 ".\programs\avs2pipemod" -wav temp.avs | ".\programs\venc" -q5 - ".\temp\audio_temp.ogg"
echo.
echo -------------------------
echo -   Encoding HD video   -
echo -------------------------
echo.
:: Video ::
".\programs\x264" --qp 5 --crf 20 --output ".\temp\video_temp.mkv" temp.avs
echo.
echo -------------------------
echo - Muxing HD video+audio - 
echo -------------------------
echo.
:: Muxing ::
".\programs\mkvmerge" -o ".\output\temp_encode.mkv" --compression -1:none ".\temp\video_temp.mkv" ".\temp\audio_temp.ogg"
Fourth - there is no programs subfolder in the rar file, so this will not work for anyone other than yourself. Ohh I see, it's supposed to be run from the MeGUI folder. Still won't work for me though. Fifth - Since you're already running from the command line, grab FFmpeg and try my batch script for comparison (You'll want to pass it the avi dump directly, not the avisynth script)
@echo off
set /p fn="Filename? "
@echo.
set /p src="Source? "
@echo.
set /p scale="Scale value? (common values are 2, 4, 8)"
@echo.
choice /m "Are there subtitles?"
@echo.
IF errorlevel 2 goto Encode
IF errorlevel 1 goto Subtitle

:Subtitle
set /p sub="Subtitle file name? "
goto Subencode

:Encode
cls
ffmpeg -i %src% -sws_flags neighbor+full_chroma_inp -c:v libx264 -crf 20 -bf -1 -b_strategy 2 -force_key_frames 00:00:00.000 -pix_fmt yuv420p -c:a aac -b:a 192k -vf scale=%scale%*iw:-1 %fn%
if errorlevel 1 goto :Fail
@echo ----------------------
@echo Encoding complete.
pause >nul
goto :eof

:Subencode
cls
ffmpeg -i %src% -sws_flags neighbor+full_chroma_inp -c:v libx264 -crf 20 -bf -1 -b_strategy 2 -force_key_frames 00:00:00.000 -pix_fmt yuv420p -c:a aac -b:a 192k -vf subtitles=%sub% -vf scale=%scale%*iw:-1 %fn%
if errorlevel 1 goto :Fail
@echo ----------------------
@echo Encoding complete.
pause >nul
goto :eof

:Fail
@echo ----------------------
@echo Encode failed, please review FFMPEG output.
@echo I will go ahead and delete %fn% for you.
pause >nul
del %fn%
goto :eof
Adventures in Lua When did I get a vest?
Stovent
He/Him
Publisher
Joined: 8/23/2016
Posts: 165
Location: France
Pokota wrote:
Fourth - there is no programs subfolder in the rar file, so this will not work for anyone other than yourself. Ohh I see, it's supposed to be run from the MeGUI folder. Still won't work for me though.
No, It is supposed to be in the TASEncodingPackage, like I said upper.
Stovent wrote:
to put in the TASEncodingPackage
The package can be found in this thread :
feos wrote:
I moved TASEncodingPackage to github some time ago, and per Fog's suggestion, I switched to this direct zip link, that will always have all the latest files: https://github.com/vadosnaprimer/TASEncodingPackage/archive/master.zip Also note that it's not TEP2 anymore, because freesub started working for me again, so I switched back to it.
It's the official package for the encoders
[17:37:00]<TheCoreyBurton> It's N64 - it's ALWAYS bad news.