API: How to use user_variables to name the output file
Posted: Thu Dec 12, 2019 11:20 pm
Guess this REALLY sounds like a newbie question, but I am submitting a new job with the API quite successfully, and including a uservariable to specify the name of the output filename I would like
I submit the job, and it proceeds and completes as expected. However, I'm am completely missing the boat on how to USE the variable 's_myfilename' in FFasTrans. I can see a number of places to select them, but mine is not on the list anywhere. How do I get them there to begin with, so that I can select them in building the output filename in the FFmpeg output node?
The installation is almost vanilla. A single Workflow that the API submits to, with single output folder.
UPDATE: I added the variables to an .ini file, and they're now visible.
I've since found a newer post that submitted the variables like this, but still no luck. All I can get is an output file named "%s_myfilename%.mp4"
"variables":[{"name":"s_myfilename","content":"myfilename"}]
Further Update
Having tried a "Populate Variables" node, it will work if values are added there, so it must be how I'm submitting them with the API.
I've now tried submitting them in all ways that I know, all at once, hoping one would be right - no luck, so I'm at a loss as to how to get them into the workflow.
Posted with http://localhost:65445/api/json/v1/jobs
In all variations of tinkering, the final output is "TVNI-S8E47.original%s_transcoded_filename%.mp4"
Code: Select all
$body = array(
'wf_id' => $wf_id,
'inputfile' => $input_file,
's_myfilename' => $broadcast_filename
);
The installation is almost vanilla. A single Workflow that the API submits to, with single output folder.
UPDATE: I added the variables to an .ini file, and they're now visible.
I've since found a newer post that submitted the variables like this, but still no luck. All I can get is an output file named "%s_myfilename%.mp4"
"variables":[{"name":"s_myfilename","content":"myfilename"}]
Further Update
Having tried a "Populate Variables" node, it will work if values are added there, so it must be how I'm submitting them with the API.
I've now tried submitting them in all ways that I know, all at once, hoping one would be right - no luck, so I'm at a loss as to how to get them into the workflow.
Posted with http://localhost:65445/api/json/v1/jobs
Code: Select all
array =
wf_id: string = 20190326155521
inputfile: string = C:\TVNI-S8E47.original.mp4
s_transcoded_filename: string = TVNI-S8E47-20191212_broadcast
transcoded_filename: string = TVNI-S8E47-20191212_broadcast
variables: string = [
{"name":"s_transcoded_filename","content":"TVNI-S8E47-20191212_broadcast"},
{"name":"transcoded_filename","content":"TVNI-S8E47-20191212_broadcast"}
]