View Single Post
Old 18th December 2015, 18:52   #4  |  Link
kypec
User of free A/V tools
 
kypec's Avatar
 
Join Date: Jul 2006
Location: SK
Posts: 826
Problems with filename?

Hi Stainless,

your plugin was very useful to me but suddenly I'm facing a problem which I can't seem to resolve.
Please have a look at my script
Code:
source = GetSourceFilename("mkv")
FFVideoSource(source)
Crop(12, 2, -4, -2)
KNLMeansCL(d=1, a=2, s=4, h=5.0, device_type="GPU")
AddBorders(0, 0, 0, 4)
output = "processed-" + GetSourceFilename("avi")
TWriteAvi(output, overwrite=true, fourcc="MAGY")
Shared function looks like this
Code:
# Replaces the script filename (ending with ".avs") with the same filename but supplied extension (ends with ".extension")
function GetSourceFilename(string extension) {
	position = FindStr(ScriptName(), ".avs")
	return LeftStr(ScriptName(), position-1) + "." + extension
}
It fails on the last line (number 7) with error message Evaluate: Unrecognized exception!. I'm using the latest Avisynth 2.6 build on Windows 8.1. When I replace the output variable with simple
Code:
output = GetSourceFilename("avi")
the script works as expected. Do you have any idea why it fails with concatenated string above?
kypec is offline   Reply With Quote