I need to run a 2nd FFMPEG process if the result of the 1st process is greater thatn 2GB (for an external system that is limited to that file size)
If tried various ways of specifying the rule, but they're either ignored or resolve with an error. How do I correctly put in the condition? I tested it with smaller values, and it "seemed" to work correctly, but I definitely cannot make it work with 2GB in the equation.
How to use a conditional based on output file size.
How to use a conditional based on output file size.
- Attachments
-
- FastransConditional.jpg (154.22 KiB) Viewed 8117 times
Re: How to use a conditional based on output file size.
So, for checking if the original input file, the one that was picked up by the monitor, was greater than 2gb, you use the rule like this:
%i_original_size% > 2147483648
To check if the file that was generated by the first ffmpeg process was greater than 2gb, there is no inbuilt variable for this currently. If you are working with the latest beta, you could use $jsonget('%s_info_ffprobe%',"format.size"). If not we would probably need to use a commandline node that writes the filesize to a text file and later use $read("...") to get the size. Or you could write the file in the first ffmpeg process into the watchfolder of a second workflow, this way you can use the i_original_size again.
%i_original_size% > 2147483648
To check if the file that was generated by the first ffmpeg process was greater than 2gb, there is no inbuilt variable for this currently. If you are working with the latest beta, you could use $jsonget('%s_info_ffprobe%',"format.size"). If not we would probably need to use a commandline node that writes the filesize to a text file and later use $read("...") to get the size. Or you could write the file in the first ffmpeg process into the watchfolder of a second workflow, this way you can use the i_original_size again.
emcodem, wrapping since 2009 you got the rhyme?
Re: How to use a conditional based on output file size.
I've tried that, and it's generating the errors shown in the image I uploaded. The first process is outputying to a folder, and I'm checking the size of THAT output file. The values seem to be correct, but the job is ending with the errors shown.
Re: How to use a conditional based on output file size.
Well, at least in your last "example", the value of i_original_size was 58670674 (sure in Bytes), which means roughly 57 MB.
According to your picture, you are checking if 57MB> 2GB, and the result is negative, which leads to a failed job end looking at your workflow thats correct.
What were you expecting to happen?
According to your picture, you are checking if 57MB> 2GB, and the result is negative, which leads to a failed job end looking at your workflow thats correct.
What were you expecting to happen?
emcodem, wrapping since 2009 you got the rhyme?
Re: How to use a conditional based on output file size.
gdpodesta,
Emcodem is correct.
If you want to go on in your workflow say with a second branch or to the delivery-Node you have to set (at least a dummy-)Node to Execute-On-Error (Right-click on the green carree on the left of the node) and set it to ExecuteOnError. then link to your delivery-node.
The Dummy-Node could be something like a Conditional-Node which always comes out "true".
hope this helps...
tom
Emcodem is correct.
If you want to go on in your workflow say with a second branch or to the delivery-Node you have to set (at least a dummy-)Node to Execute-On-Error (Right-click on the green carree on the left of the node) and set it to ExecuteOnError. then link to your delivery-node.
The Dummy-Node could be something like a Conditional-Node which always comes out "true".
hope this helps...
tom
Re: How to use a conditional based on output file size.
I guess the failed "job" is what is throwing me. I am/was expecting that "if 57MB> 2GB" then the next process IS executed, otherwise don't.
The Condition failed, not the job, So, it seems to me that I didn't complete the conditional properly. The "If True Then..." piece is there, but "If False..." needs something to do, and that is what is leading to a failed "JOB".
I only want that 2nd process to execute if the 1st process produced a file that is >=2GB, so the adding a step of some kind for a failed Conditional seems to be the missing piece.
The Condition failed, not the job, So, it seems to me that I didn't complete the conditional properly. The "If True Then..." piece is there, but "If False..." needs something to do, and that is what is leading to a failed "JOB".
I only want that 2nd process to execute if the 1st process produced a file that is >=2GB, so the adding a step of some kind for a failed Conditional seems to be the missing piece.
Re: How to use a conditional based on output file size.
Hello Gdposdesta,
wouldn't it be the "execute on error" you need? This is the answer to "If false..."
Right-click on "green square" in front of the node that you want and select "execute on error" (the green square becomes red). In that way you can choose between " if true" and "if false" without stopping your workflow.
Hoping that's what you're looking for
Benjamin
wouldn't it be the "execute on error" you need? This is the answer to "If false..."
Right-click on "green square" in front of the node that you want and select "execute on error" (the green square becomes red). In that way you can choose between " if true" and "if false" without stopping your workflow.
Hoping that's what you're looking for
Benjamin
Re: How to use a conditional based on output file size.
I did finally solve it: In the Conditional Node, at the bottom, I checked "Dispel the job on false/fail...." That was the behavior that I was presuming would happen. I see now what FFAStrans is expecting/trying to do, so it makes more sense. Its my first use of a Conditional, and an incorrect assumption was ultimately the problem. In short, I want to make an MP4, and IF it happens to be over 2GB, then make a smaller version of it, otherwise just run with the initially created MP4.
Thanks for the insights and assist....got it done in the end.
Thanks for the insights and assist....got it done in the end.