Selur's Little Message Board
Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' (/thread-1343.html)



Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - kingcrimsonster - 03.05.2020

Avisynth preview error: -> Script error: Invalid arguments to function 'Trim'


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - Selur - 03.05.2020

seems like trim does not support named parameters.
-> will fix


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - kingcrimsonster - 09.05.2020

Another file - is again the same defect.


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - Selur - 09.05.2020

LoadCPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\ffms2.dll")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: L:\!_Video\P\!_Single\Erena Sasamiya\[1pondo.tv] [050618_683].mp4
#  input color sampling YV12
#  input luminance scale tv
Source = FFVideoSource("L:\!_Video\P\!_Single\Erena Sasamiya\[1pondo.tv] [050618_683].mp4",cachefile="C:\Windows\Temp\mp4_bf295c8535f08a4ff29e15a7ad73065a_853323747_1_0.ffindex",fpsnum=60000,fpsden=1001,colorspace="YV12")
# cutting from 2218 to end - WARNING: This might cause synch issues
Source = Source.Trim(2218)
# current resolution: 1920x1080
# filtering
# color modifications
SourceFiltered = Source
SourceFiltered = SourceFiltered.Levels(0,1.00,255,0,212,coring=false,dither=true)
# stacking horizontal for filter preview
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec709")
Source = Source.ConvertToRGB32(matrix="Rec709")
StackHorizontal(Source, SourceFiltered)
PreFetch(6)
return last
Problem is, that I don't the the error:
Quote:Trim(clip, int first_frame, int last_frame [, bool pad] )
Returns a clip starting at first_frame and running up to and including last_frame.
  • For example, Trim(3, 5) returns source clip frames 3, 4 and 5.
  • Remember, AviSynth starts counting at frame 0.
  • If you set last_frame to 0, you will get a clip starting at first_frame and running to the end of the clip.
see: http://avisynth.nl/index.php/Trim
This should work.
Still the error is:
Quote:Script error: Invalid arguments to function "Trim"
-> I'll contact the Avisynth authors,..

Got it you explicitly have to set 0. Wink
-> will fix and send you a link to a new dev version in ~1/2 hour.

Cu Selur


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - The_Tinkerer - 30.05.2020

Sorry for the stupid question... where is "Trim" in Hybrid? It's not part of "Cut Support" as I don't see any AviSynth script changes when I enable cut support and enter times for it. Is it a custom filter or something?


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - Selur - 30.05.2020

Cut Support should add Trim(),... (does here, for Avisynth and Vapoursynth)

Cu Selur


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - The_Tinkerer - 30.05.2020

I had forgotten I rolled back to v2020.02.19.1. Not sure if there were problems with cut support in that version, but when I change back to 2020.05.01.1, it now works.

Sorry for my oversight! Blush


RE: Avisynth preview error: -> Script error: Invalid arguments to function 'Trim' - Selur - 30.05.2020

That old version did not support adding Trim() for it.
That was added in 2020.05.01.1, see: http://www.selur.de/changelog

Cu Selur