Invalid arguments to function 'Round'

Questions and answers on how to get the most out of FFAStrans
Post Reply
DCassidy
Posts: 4
Joined: Thu Nov 10, 2022 11:30 pm

Invalid arguments to function 'Round'

Post by DCassidy »

Hi,

I'm a new user and very new to this forum.
I have a workflow that is failing in one of two modules. The first module is a Custom AVI Synth. The next module is a Custom FFMPEG. The workflow is failing at the first, if I remove it, it fails at the next one with the same error, though there are a few other modules before either of these. This is the error.
Loudness Corrections@xxxxxxxxxxx: Validate: Script error: Invalid arguments to function 'Round'
The workflow is pretty simple and is intended to create a low res mp4 auditioning video from any source. This is an overview of the modules.
  • Start
    A/V Media - for AVI transcode which are working fine.
    Timecode - for BiTC
    Watermark - for logo watermarking
    Loundess Corrections - AVI Custom to standardise loudness - FAILING
    Custom FFmpeg - final transcode for derivaive - FAILING
Most of the above modules are also outputting to a text file for logging.


The AVI Synth has Set as 64bit ticked and nothing else with this code (borrowed from another user here):

Code: Select all

# Variables:
#
# m_clip		= The last returned AviSynth media
#
# Do NOT change any of the following variables!!!
# _ffas_video 	= <original video>
# _ffas_audio	= <original audio>
# _ffas_height	= <source height>
# _ffas_width	= <source width>
# _m_clip_a_channels = <total channels>
# _ffas_work_fdr	= Working folder for the workflow
#

r=ResampleAudio(m_clip, 48000)
n=Normalize(r, 0.22)
m_clip=ConvertAudioTo24bit(n)

# The following MUST be the last line of your script
Return m_clip
The custom FFMPEG has all fields empty except the options as follows (this works fine in standalone ffmpeg):

Code: Select all

-vf "scale=min'(1280,iw)':-2" -movflags +faststart -c:v libx264 -preset slow -crf 22 -pix_fmt yuv420p -c:a aac -b:a 192k
Running Windows 10 (in a fairly tightly controlled security environment)

Any thoughts would be much appreciated.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Invalid arguments to function 'Round'

Post by emcodem »

Hey DCassidy,

welcome to the Forum and Thank you for using FFAStrans!

Great error description, i assume you didnt send the workflow export and logs because of your security stuff and you do not wish to upload files that contain potentially internal information? In that case you can use PM to send us files if you like.
However, i can try a shoot in the (not so) dark:
You say when you remove either Custom AVS or Custom ffmpeg, it fails. That means that it is the Watermark that produces the error. The reason is that Each processor checks the output of the previous one.
Looking at the source code, we do use "Round" avisynth function in the Watermark processor for fadein and fadeout values.

This is the source code in Watermark processor that inserts Fadein and Out using Round function:

Code: Select all

			
			If $i_PROC_FADE_IN > 0 Then
				$i_PROC_FADE_IN = '.Fadein(Round(' & $i_PROC_FADE_IN & '))'
			Else
				$i_PROC_FADE_IN = ''
			EndIf
			If $i_PROC_FADE_OUT > 0 Then
				$i_PROC_FADE_OUT = '.Fadeout(Round(' & $i_PROC_FADE_OUT & '))'
			Else
				$i_PROC_FADE_OUT = ''
			EndIf
So my first guess would be that you got some invalid values in fadein/out. Try if it works when you set the values to 0.
emcodem, wrapping since 2009 you got the rhyme?
User avatar
FranceBB
Posts: 264
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: Invalid arguments to function 'Round'

Post by FranceBB »

DCassidy wrote: Fri Nov 11, 2022 12:26 am this code
Oh, that's the -24 LUFS Loudness Correction in Avisynth.
I have it everywhere :D
DCassidy wrote: Fri Nov 11, 2022 12:26 am (borrowed from another user here)
@emcodem... wait, when did Grandmaster fire me? :o
hahahahahahaha just joking. ;)

By the way, since we're here, you could even skip variables aside from m_clip, like

Code: Select all

ResampleAudio(m_clip, 48000)
Normalize(0.22)
m_clip=ConvertAudioTo24bit()

DCassidy wrote: Fri Nov 11, 2022 12:26 am The workflow is pretty simple and is intended to create a low res mp4 auditioning video from any source. This is an overview of the modules.
Any progressive source only, though, as it won't take care of eventual interlaced stuff but rather it will mess up with the fields.
It won't also deal with different matrices, primaries and transfers in case the source is anything other than BT709 SDR.
By the way, everything you're doing in the Custom FFMpeg is doable in the built-in H.264 encoder, including the CRF which you can specify in the custom x264 params at the bottom (when you do that, it will ignore the bitrate inside the node and use the crf value you set instead).
I know it's off topic, but I just thought that it was worth specifying it.
emcodem wrote: Fri Nov 11, 2022 6:51 am my first guess would be that you got some invalid values in fadein/out.
Yep, emcodem is right.
The best thing would be if you could export the workflow and send it over.
DCassidy
Posts: 4
Joined: Thu Nov 10, 2022 11:30 pm

Re: Invalid arguments to function 'Round'

Post by DCassidy »

Apologies for the late reply. I've been away from this for a while. The curious thing here is that I only used the Watermark modules sliders to set fade times so if the values are invalid, the UX was sending invalid values. I added a deinterlace module earlier on in the chain which appears to have solved my issue.
I'm in a Library doing digitisation from analogue sources so all of my source file formats are consistent (though there are a few variations depending on analogue source). I realise I can use the built in H264 encoder, but I've used ffmpeg quite a lot and find it easier to simply re-purpose what I'm doing with command lines into FFATrans. This is my first foray into using this so I will likely come back with more as I complicate my life a bit more.

Thanks for the helpful input.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Invalid arguments to function 'Round'

Post by emcodem »

DCassidy wrote: Thu Dec 01, 2022 4:11 am I'm in a Library doing digitisation from analogue sources ...
Oh, you and @ThomasM are working at the same place? :D
emcodem, wrapping since 2009 you got the rhyme?
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: Invalid arguments to function 'Round'

Post by ThomasM »

@emcodem I always thought of FFAStrans as an archival-soulution... :D

@DCassidy - What is your profession and where are you situated? maybe a PM to me?

cheers
thomas
DCassidy
Posts: 4
Joined: Thu Nov 10, 2022 11:30 pm

Re: Invalid arguments to function 'Round'

Post by DCassidy »

@ThomasM Not to get too far off-topic, but I am as yet unauthorised to send PMs.
I'm an long time audio archivist and have expanded to video and film in the last few years, being the only person in this area at my Library. I won't say which one publicly but it's in Australia and its one of the major Libraries.
I see a lot of potential use for what I do which is most often outputting 'rough and ready' viewing copies from digitised film and videotape archival master files in the quickest, most hand-off way I can.
Post Reply