Hi,
does anyone know if it is possible to make use of the output of a command execution as variable.
As background:
I noticed that ffmpeg sometimes renders the video shorter than the audio (in nvenc & x264) and I have no direct solution for this. The difference in duration is more than a second and leads to files being rejected by our partners. I now want to automatically compare audio & video duration, but ffastrans has only an output option for duration of the whole file not for separate streams.
I thought I could read out the separate duration with ffprobe and store them in variables to compare them.
Does anyone has an idea to this?
Best,
silverline
(I tried searching the forum for this, but the word "command" always leads to no search results, because it is "too common"...)
Command Executer output to variable etc.
Re: Command Executer output to variable etc.
Hi silverline,
You need to use the "Command executor" for this. Please read the help section and the examples on how it works. So make sure you know how to get the output you want using ffprobe from a normal dos command. Then connect the "Populate variables"-node and the $read()-function to read the output to a variable. From there you can use other functions like $between() or the more advanced $regext() in order to get what you want. Now, this is not a trivial task and some basic programing or scripting knowledge is required.
-steinar
You need to use the "Command executor" for this. Please read the help section and the examples on how it works. So make sure you know how to get the output you want using ffprobe from a normal dos command. Then connect the "Populate variables"-node and the $read()-function to read the output to a variable. From there you can use other functions like $between() or the more advanced $regext() in order to get what you want. Now, this is not a trivial task and some basic programing or scripting knowledge is required.
-steinar
-
- Posts: 1
- Joined: Fri Jan 18, 2019 4:01 pm
Re: Command Executer output to variable etc.
Hi,
I guess you mean by using the $read()-function that we first have to write the command output to a file and then read in that file and populate a variable?
Or is there any possibility to directly populate the variable?
Regards,
Gilles
I guess you mean by using the $read()-function that we first have to write the command output to a file and then read in that file and populate a variable?
Or is there any possibility to directly populate the variable?
Regards,
Gilles
Re: Command Executer output to variable etc.
Hi Gilles, thank you for using FFAStrans and welcome to the forum!
Yes, that is what I mean.
Currently you cannot output stdout/err directly to a FFAStrans variable. But it's a good idea to look at the options. Thanks for posing the idea
-steinar
Yes, that is what I mean.
Currently you cannot output stdout/err directly to a FFAStrans variable. But it's a good idea to look at the options. Thanks for posing the idea
-steinar
Re: Command Executer output to variable etc.
Challenge accepted!
[EDIT] it is partly possible to do but only using hacky style techniques
Cheers,
emcodem
Last edited by emcodem on Wed Jan 23, 2019 8:03 pm, edited 2 times in total.
emcodem, wrapping since 2009 you got the rhyme?
Re: Command Executer output to variable etc.
Just a word of warning: This is possible but not recomended. Misuse, crashes or any other abnormal behavour from executing autoit commands from within FFAStrans is your responsibility alone. Support with issues regarding this approach will not be given by me. Also, this method might not be available in the future.
-steinar
-steinar
Re: Command Executer output to variable etc.
Hehe, damned, i tried to be funny
I should have added a note about it but i also really hope that anybody who is able to use this also understands what this means and will not use it in production
I should have added a note about it but i also really hope that anybody who is able to use this also understands what this means and will not use it in production
emcodem, wrapping since 2009 you got the rhyme?
Re: Command Executer output to variable etc.
Hehe, and funny it was in a wierd kind of way...