HaveAGitGat / Tdarr

Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Other
2.92k stars 92 forks source link

[Question] Is possible to cancel the encoding if the final estimated size is much larger than the initial file? #943

Closed Jorman closed 4 months ago

Jorman commented 8 months ago

Hi, Tdarr is new for me and I'm getting used to using it, I'm doing some testing and I like how it works. Watching it work I have a question, is there any way to abort the conversion of a file if the estimated final size is larger than the original file? During operation I happen to see that the final size will be 200% and more, maybe I'm wrong but under these circumstances, shouldn't I move on to the next file? Does it make sense to keep converting the whole file? I happen to see these values when the file is 6% converted and going on with the percentage the final estimated size is not much different

Thanks for the program

J

HaveAGitGat commented 6 months ago

You can use the New file size check classic plugin or the Compare File Size Ratio flow plugin to check the size of the file after it's been processing but yes ending the transcoding early once size threshold has been met is still to-do.

Jorman commented 6 months ago

Ok, thank you for the information. Do you plan to insert this function or make no sense for you?

HaveAGitGat commented 6 months ago

In Tdarr flows we can do it by modifying this code: https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts#L123

So during processing if the new file is larger than the original we can exit the thread with an error.

Jorman commented 6 months ago

Yes, make sense, maybe after a while? I mean not immediately, IDK, maybe after 5% of total file conversion or so? I also think only if the final size is x% larger than the original, so can be customizable.

HaveAGitGat commented 4 months ago

I'll move this under here as same thing: https://github.com/HaveAGitGat/Tdarr/issues/571

HaveAGitGat commented 3 months ago

Added with flow plugin Compare File Size Ratio Live. Click Update community plugins on the classic plugins tab or will auto update within an hour or so.

image image

Can compare between either the estimated file size or the current file size of the output file.

  Compare either the estimated final size or current output size to the input size and 
  give an error if estimated final size or current size surpasses the threshold %.

  Works with 'FfmpegCommand', 'HandBrake Custom Arguments', 'Run Classic Transcode' and other flow plugins 
  that output a file.

  Can be placed anywhere before a plugin which outputs a new file.