Stovent
He/Him
Publisher
Joined: 8/23/2016
Posts: 165
Location: France
Yours is quite good, but why don't we use it instead of MeGUI ? I personnally prefer use ffmpeg more than MeGUI but I don't know much about ffmpeg
[17:37:00]<TheCoreyBurton> It's N64 - it's ALWAYS bad news.
Pokota
He/Him
Joined: 2/5/2014
Posts: 779
Because there's no official process or real requirements for temp encodes - it's up to the person doing the temp encode. I just use the same settings that I use for my LP projects. It's optimized for my needs, and that's really all I care about. If it works better for you then feel free to use it. You'd have to ask the Publishing team why they do things the way they do. It might be optimized for something I don't take into consideration.
Adventures in Lua When did I get a vest?
Post subject: High quality temp encode script, Linux ver.
Editor, Experienced player (848)
Joined: 5/2/2015
Posts: 696
Location: France
Pokota's temp encode script was pretty helpful, so I made this linux version in about 15 minutes. Render the script executable; run [chmod +x "script name"] in your terminal, and run it to see the syntax. Requires only ffmpeg. (I made this because there is no real easy way to run AviSynth under linux, as far as my search went, and I didn't want to mess around with complicated stuff for temp encoding when you have ffmpeg..) Download encoding.sh
Language: shell

#!/bin/sh # Linux version by xy2_ # Original script by Pokota at http://tasvideos.org/forum/viewtopic.php?p=451051#451051 usage() { cat >&2 << EOF High-quality temp-encode script Usage: $0 -i input -s scale [-u subtitle] -o output -i | --input : Input filename. -o | --output : Output filename. -s | --scale : Upscaling factor (usually factor of 2) -u | --subtitle : Subtitle file (if required.) EOF exit } die() { echo "Encode failed!" exit 1 } [ "$#" -lt 6 ] \ && usage while [ "$#" -gt 1 ]; do case "$1" in -i|--input) INPUT=$2 ;; -o|--output) OUTPUT=$2 ;; -s|--scale) SCALE=$2 ;; -u|--subtitle) SUB=$2 ;; *) usage;; esac shift 2 done if [ -z "$SUB" ]; then ffmpeg -i "$INPUT" -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 "$OUTPUT" || die else ffmpeg -i "$INPUT" -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 "$OUTPUT" || die fi
Publisher
Joined: 4/23/2009
Posts: 1283
Pokota wrote:
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.
Actually even though it is implied to be there, AviSynth is weird in that if you start doing something like last = clip, you are require to return last. I mean it doesn't really hurt so keeping it there is it's not that big of a deal.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
if you start doing something like last = clip
last doesn't need to be set anyway...
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
last doesn't need to be set anyway...
Sometimes I set it since I was working on another variable and now I want it to be the main one. I actually have not tried just placing a clip variable on a line to set it to last. If that works, wow, surprised I've not thought of it. If that does indeed work, I would say explicitly having "last =" makes it more readable =).
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
When writing functions that take a clip as their first parameter, I (almost) always put the clip variable on its own line to make it the "current" clip. So yes, it does work.
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
When writing functions that take a clip as their first parameter, I (almost) always put the clip variable on its own line to make it the "current" clip. So yes, it does work.
That's functions, I'm talking does this work:
Language: avisynth

a = AVISource("whatever.avi") a
Even if it does work, this is more readable IMO:
Language: avisynth

a = AVISource("whatever.avi") last = a return last
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Yeah, all of that works. But it's highly redundant - you already set last with a single line of "AVISynth(...)". "return last" looks like "i = i + 1;" to a C programmer.
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
Yeah, all of that works. But it's highly redundant - you already set last with a single line of "AVISynth(...)". "return last" looks like "i = i + 1;" to a C programmer.
actually if you just do
Language: avisynth

a = AVISource("whatever.avi")
I believe last is not set and AviSynth returns an error. In your example, the shortcut is to do i += 1;, but there is no such shortcut in this case, the person reading has to "know" that last is implicit.
Pokota
He/Him
Joined: 2/5/2014
Posts: 779
Aktan - of course that would fail; you have a variable declaration on the last line of your script :P In all seriousness though, implied return last doesn't happen unless the last line of a script is a clip and is not a variable declaration containing a clip. So while
Language: avisynth

a = AVISource("a.avi") b = AVISource("b.avi") out = stackvertical(a, b)
would fail due to not having a return value,
Language: avisynth

a = AVISource("a.avi") b = AVISource("b.avi") stackvertical(a, b)
should work (since stackvertical returns a clip and you're not declaring a variable on the last line) With all that said, I don't like relying on implied last and implied return last since that makes things harder to read. So I would end up using
Language: avisynth

a = AVISource("a.avi") b = AVISource("b.avi") return stackvertical(a, b) # or, if this were being used as the final script and not a source script, I'd do the following out = stackvertical(a, b) return out
Adventures in Lua When did I get a vest?
Publisher
Joined: 4/23/2009
Posts: 1283
Pokota wrote:
Aktan - of course that would fail; you have a variable declaration on the last line of your script :P
Hey, I'm showing creaothceann that a single AVISource(... line does not work =p
Pokota
He/Him
Joined: 2/5/2014
Posts: 779
It does if it's the only line and you're not assigning it to a variable (though at that point you may as well not be using avisynth in the first place!)
Adventures in Lua When did I get a vest?
Publisher
Joined: 4/23/2009
Posts: 1283
Pokota wrote:
It does if it's the only line and you're not assigning it to a variable (though at that point you may as well not be using avisynth in the first place!)
I know, you're not getting my poking fun at him =p.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
the person reading has to "know" that last is implicit
Yes. If you use a script/programming language you have to know it.
Pokota wrote:
implied return last doesn't happen unless the last line of a script is a clip
Doesn't even have to be a clip.
Language: avisynth

BlankClip(1, color=Test) function Test {$524361}
Functions don't even have to return anything.
Language: avisynth

global s = "1" Test BlankClip(1).SubTitle(s) function Test {global s = "2"}
Aktan wrote:
poking fun at creaothceann
:˙(
Pokota
He/Him
Joined: 2/5/2014
Posts: 779
creaothceann wrote:
Functions don't even have to return anything.
Language: avisynth

global s = "1" Test BlankClip(1).SubTitle(s) function Test {global s = "2"}
I prefer to define functions at the top of a script rather than at the bottom. :P Still, this does argue against my "the last line gets implicitly return'd" statement from before. I'll have to look more closely at the rules for implicit return. Or, we could just always use explicit return statements like a sane programming language would require.
Adventures in Lua When did I get a vest?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Technically, every function returns a value. It's just that in Avisynth, the value undefined is also possible. It's what every function's return value starts at. EDIT:
Language: Avisynth

tmp = Test s = defined(tmp) ? "yes" : "no" BlankClip.Subtitle(s) function Test { # 5 }
Comment/uncomment the 5 to see the different outcomes.
Skilled player (1741)
Joined: 9/17/2009
Posts: 4981
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Sorry, but how do I simply splice AVI files generated by BizHawk together? Movie Maker is gone, and the script in the comments gives the following: https://i.imgur.com/iNHYSwq.png Is there any way to simply splice avi files together?
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
jlun2 wrote:
Sorry, but how do I simply splice AVI files generated by BizHawk together? Movie Maker is gone, and the script in the comments gives the following: https://i.imgur.com/iNHYSwq.png Is there any way to simply splice avi files together?
List all the files and their resolutions.
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.
Skilled player (1741)
Joined: 9/17/2009
Posts: 4981
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
feos wrote:
jlun2 wrote:
Sorry, but how do I simply splice AVI files generated by BizHawk together? Movie Maker is gone, and the script in the comments gives the following: https://i.imgur.com/iNHYSwq.png Is there any way to simply splice avi files together?
List all the files and their resolutions.
A single line script with listing all the files worked, thanks. Using the camtasia codec the 80 minute video is now 8 GB, but at least it works. 🙂
Dimon12321
He/Him
Editor, Reviewer, Experienced player (596)
Joined: 4/5/2014
Posts: 1222
Location: Romania
Is there a good video tutorial of how to upscale a video? I do everything like CustomEncoding says, but the video becomes even worse then just rendering in Vegas Pro.
TASing is like making a film: only the best takes are shown in the final movie.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Dimon12321 wrote:
Is there a good video tutorial of how to upscale a video? I do everything like CustomEncoding says, but the video becomes even worse then just rendering in Vegas Pro.
Doesn't sound possible. Either you use too high ratefactor or wrong upscale method (or the dump is lossy).
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.
Skilled player (1741)
Joined: 9/17/2009
Posts: 4981
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
The dropbox folder on the first post is dead. Is there another location for an up to date version?
Spikestuff
They/Them
Editor, Publisher, Expert player (2642)
Joined: 10/12/2011
Posts: 6438
Location: The land down under.
jlun2 wrote:
The dropbox folder on the first post is dead. Is there another location for an up to date version?
Scrolling must be hard.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Player (18)
Joined: 5/31/2013
Posts: 42
I'm trying to do an encode of a DS TAS using MeGUI, but I keep getting this error? https://imgur.com/a/WeQo8LN Not sure what the issue is?