Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th June 2023, 13:03   #1  |  Link
Rob105
Registered User
 
Join Date: Oct 2021
Posts: 43
Use custom variable with ConditionalReader()

How to make this work so box_width is read from box_width.txt right now its fixed on value 70 regardless what ConditionalReader outputs 130.

PHP Code:
v1 colorbars(1920,1080).converttoyuy2()

box_width 70
#Make box overlay
box BlankClip(width=box_widthheight=130color=$000000).AddBorders(5,5,5,5,color=color_white)

#place overlay in video
Overlay(v1boxx=740y=600)

ConditionalReader("C:\Users\User\Downloads\AVISynth\box_width.txt""box_width"true
Rob105 is offline   Reply With Quote
Old 11th June 2023, 17:41   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
ConditionalReader() is for setting the value of a variable on a per-frame basis, so that the variable can be used inside another run-time filter such as ScriptClip().
But here you are using the variable box_width only to set the width of the blank clip, which happens at compile-time, before any frames are read.

You can get the effect you want by putting the required value (eg 130) as the only contents of the file and setting the variable by adding
Code:
box_width = Import("box_width.txt")
at some point before the call to BlankClip().
(And of course in addition removing the call to ConditionalReader()).
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.