Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow Help: Best way to delete tyhe working file and restart flow on a new copy of the original file? #1106

Open
ajw107 opened this issue Oct 26, 2024 · 4 comments

Comments

@ajw107
Copy link

ajw107 commented Oct 26, 2024

Hi

My main flow works by first running through the flow normally until after the transcoding step, at which point it checks to see if the file size reduction gained was worth it. If so, it just continues, if not it sets a variable/flag and runs through the flow again from almost the start. The idea being, so that all the muxing steps (stream clean and reorder, container setting, etc) are executed, but not the encoding, as it's not worth the file space gained vs possible quality degradation.

Just before I go back to the top of the flow, I need to get rid of the unwanted working file in the cache, so I can start off fresh. That's easily done with the Delete File step. Unfortunately I've not found a step where I can then copy the original file back into the cache to become the new working file. Both Copy to Working Directory or Set Original File I thought may do this, but they check for the existence of the Working File, and then error out as I've just deleted it.

I was just wondering, using the Flow system, what is the correct way to get rid of a working file and run through the Flow again with a new working file?

Click here to see my Flow currently if you want to see what I have done so far. ``` { "_id": "5eUZm1evb", "name": "TVShowFlow", "description": "TVShowFlow", "tags": "", "flowPlugins": [ { "name": "Input File", "sourceRepo": "Community", "pluginName": "inputFile", "version": "1.0.0", "inputsDB": {}, "id": "0dswXCUvul", "position": { "x": 368.7110788292972, "y": -515.559020683866 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_ajw107_Convert_Subs_To_SRT", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Local:Tdarr_Plugin_ajw107_Convert_Subs_To_SRT", "debugmsgs": "true" }, "id": "iPFEm7jhDk", "position": { "x": 204.04480502289533, "y": 129.7412566631349 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_ajw107_Repair_Timestamps", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Local:Tdarr_Plugin_ajw107_Repair_Timestamps", "debugmsgs": "true" }, "id": "PqCllSBn6m", "position": { "x": 201.8384322654298, "y": 461.8694019782245 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_MC93_MigzImageRemoval", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Community:Tdarr_Plugin_MC93_MigzImageRemoval" }, "id": "qbXSLWnN8a", "position": { "x": 203.31114047600505, "y": 1098.9746499036387 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_ajw107_Remove_Packed_B_frames", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Local:Tdarr_Plugin_ajw107_Remove_Packed_B_frames" }, "id": "F0l4fqg3A-E", "position": { "x": 205.3447135637436, "y": 1395.2621868345857 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_MC93_Migz4CleanSubs", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Community:Tdarr_Plugin_MC93_Migz4CleanSubs", "tag_language": "eng", "language": "eng,und,eng-us,eng-gb" }, "id": "HZEhG4Hg8q8", "position": { "x": 202.07846609959023, "y": 1727.4484861966762 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_ajw107_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Local:Tdarr_Plugin_ajw107_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE", "sdCQV": "21", "hdCQV": "23", "fullhdCQV": "25", "uhdCQV": "28", "bframe": "0", "ffmpeg_preset": "slow", "debugmsgs": "true" }, "id": "vR70RBuRxBS", "position": { "x": 342.8978264597415, "y": 2449.1661178765244 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_ajw107_z18s_rename_files_based_on_codec", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Local:Tdarr_Plugin_ajw107_z18s_rename_files_based_on_codec" }, "id": "RriRTYqZSw2", "position": { "x": 424.3371835785352, "y": 3609.2475253513126 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin: Tdarr_Plugin_z80t_keep_original_date", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "inputsDB": { "pluginSourceId": "Community:Tdarr_Plugin_z80t_keep_original_date", "log": "true", "extensions": "mkv", "server": "192.168.16.22" }, "id": "-8z1B9A9OVq", "position": { "x": 422.7044743418423, "y": 3979.003721735655 }, "fpEnabled": true }, { "name": "Replace Original File", "sourceRepo": "Community", "pluginName": "replaceOriginalFile", "version": "1.0.0", "inputsDB": {}, "id": "MBfLZeK8v", "position": { "x": 419.7076542930483, "y": 4278.488250316961 }, "fpEnabled": true }, { "name": "Check File Exists", "sourceRepo": "Community", "pluginName": "checkFileExists", "version": "1.0.0", "id": "7Fa5pQEn-", "position": { "x": 369.82288735440454, "y": -274.6399401166193 }, "fpEnabled": true, "inputsDB": { "fileToCheck": "${fileName}.${container}" } }, { "name": "Check File Size", "sourceRepo": "Community", "pluginName": "checkFileSize", "version": "1.0.0", "id": "MShjlKlmZ", "position": { "x": 342.22830048661115, "y": -164.40468630757303 }, "fpEnabled": true, "inputsDB": { "lessThan": "100" } }, { "name": "Fail Flow", "sourceRepo": "Community", "pluginName": "failFlow", "version": "1.0.0", "id": "BZP0qRb3A", "position": { "x": 658.9016022914585, "y": -150.25555015067602 }, "fpEnabled": true }, { "name": "Remove Data Streams", "sourceRepo": "Community", "pluginName": "ffmpegCommandRemoveDataStreams", "version": "1.0.0", "id": "d0ewkegGL", "position": { "x": 435.2217324867066, "y": 629.0112377924324 }, "fpEnabled": true }, { "name": "Begin Command", "sourceRepo": "Community", "pluginName": "ffmpegCommandStart", "version": "1.0.0", "id": "3NBo6uxeu", "position": { "x": 202.82691736746472, "y": 758.5910940768086 }, "fpEnabled": true }, { "name": "Execute", "sourceRepo": "Community", "pluginName": "ffmpegCommandExecute", "version": "1.0.0", "id": "h71dtHUyI", "position": { "x": 654.6567036043343, "y": 681.8772481410205 }, "fpEnabled": true }, { "name": "Begin Command", "sourceRepo": "Community", "pluginName": "ffmpegCommandStart", "version": "1.0.0", "id": "BSAJv72tB", "position": { "x": 200.92278492155424, "y": 2035.1842712661605 }, "fpEnabled": true }, { "name": "Execute", "sourceRepo": "Community", "pluginName": "ffmpegCommandExecute", "version": "1.0.0", "id": "WUY7nvmD4", "position": { "x": 669.4158516847389, "y": 2060.414965799846 }, "fpEnabled": true }, { "name": "Reorder Streams", "sourceRepo": "Community", "pluginName": "ffmpegCommandRorderStreams", "version": "1.0.0", "id": "Gbi5BfofP", "position": { "x": 455.8379646939228, "y": 2035.2421446588532 }, "fpEnabled": true }, { "name": "Check File Medium", "sourceRepo": "Community", "pluginName": "checkFileMedium", "version": "1.0.0", "id": "aRXqy18ag", "position": { "x": 317.91144259610974, "y": -49.07771958366741 }, "fpEnabled": true }, { "name": "Check Video Codec", "sourceRepo": "Community", "pluginName": "checkVideoCodec", "version": "1.0.0", "id": "4ru0OpOwA", "position": { "x": 285.2493249904106, "y": 2257.430203271829 }, "fpEnabled": true }, { "name": "Compare File Size Ratio", "sourceRepo": "Community", "pluginName": "compareFileSizeRatio", "version": "2.0.0", "id": "qBN3C3YEv", "position": { "x": -409.58347888722756, "y": 2483.6695559831373 }, "fpEnabled": true, "inputsDB": { "greaterThan": "95", "lessThan": "105" } }, { "name": "Compare File Duration Ratio", "sourceRepo": "Community", "pluginName": "compareFileDurationRatio", "version": "1.0.0", "id": "GAwHiDLtS", "position": { "x": -96.52138077259428, "y": 3377.3777393415103 }, "fpEnabled": true }, { "name": "Compare File Size Ratio", "sourceRepo": "Community", "pluginName": "compareFileSizeRatio", "version": "2.0.0", "id": "L3dc9pCo7", "position": { "x": 656.3133214805862, "y": 3121.812594516129 }, "fpEnabled": true, "inputsDB": { "lessThan": "105" } }, { "name": "Check File Name Includes", "sourceRepo": "Community", "pluginName": "checkFileNameIncludes", "version": "2.0.0", "id": "Bb8ufi1aX", "position": { "x": 438.33144158980565, "y": 2956.0517209180607 }, "fpEnabled": true, "inputsDB": { "terms": "remux,REMUX,Remux" } }, { "name": "Compare File Size Ratio", "sourceRepo": "Community", "pluginName": "compareFileSizeRatio", "version": "2.0.0", "id": "NMiKZEweT", "position": { "x": 321.66776937115355, "y": 3113.846959131062 }, "fpEnabled": true, "inputsDB": { "greaterThan": "20", "lessThan": "105" } }, { "name": "Set Video Encoder", "sourceRepo": "Community", "pluginName": "ffmpegCommandSetVideoEncoder", "version": "1.0.0", "id": "XiJs1ct3r", "position": { "x": 892.839341370537, "y": 2509.4046846418937 }, "fpEnabled": true, "inputsDB": { "ffmpegPreset": "slow", "ffmpegQuality": "20", "hardwareType": "videotoolbox" } }, { "name": "Begin Command", "sourceRepo": "Community", "pluginName": "ffmpegCommandStart", "version": "1.0.0", "id": "jSiAWJmsR", "position": { "x": 893.9260762330625, "y": 2317.9232334239387 }, "fpEnabled": true }, { "name": "Execute", "sourceRepo": "Community", "pluginName": "ffmpegCommandExecute", "version": "1.0.0", "id": "9A045nqIO", "position": { "x": 892.7853125171945, "y": 2723.6535391195553 }, "fpEnabled": true }, { "name": "Set Flow Variable", "sourceRepo": "Community", "pluginName": "setFlowVariable", "version": "1.0.0", "id": "xV6abVF2S", "position": { "x": -209.4557293191085, "y": 2931.005125843876 }, "fpEnabled": true, "inputsDB": { "variable": "flowVarEncodeFile", "value": "FALSE" } }, { "name": "Set Flow Variable", "sourceRepo": "Community", "pluginName": "setFlowVariable", "version": "1.0.0", "id": "3dtt0aUAg", "position": { "x": 87.263108505709, "y": -54.04076949705272 }, "fpEnabled": true, "inputsDB": { "variable": "flowVarEncodeFile", "value": "TRUE" } }, { "name": "Require Review", "sourceRepo": "Community", "pluginName": "requireReview", "version": "1.0.0", "id": "sXJxOD7yU", "position": { "x": 460.0131663521472, "y": 3349.531314819873 }, "fpEnabled": true }, { "name": "Check Flow Variable", "sourceRepo": "Community", "pluginName": "checkFlowVariable", "version": "1.0.0", "id": "T-lobnuXN", "position": { "x": 504.5193762589013, "y": 2261.4929197300817 }, "fpEnabled": true, "inputsDB": { "variable": "{{{args.variables.user.flowVarEncodeFile}}}", "value": "TRUE" } }, { "name": "Check Node Hardware Encoder", "sourceRepo": "Community", "pluginName": "checkNodeHardwareEncoder", "version": "1.0.0", "id": "8ZW2Ra_Or", "position": { "x": 544.7244567758373, "y": 2524.464965362188 }, "fpEnabled": true }, { "name": "Check Node Hardware Encoder", "sourceRepo": "Community", "pluginName": "checkNodeHardwareEncoder", "version": "1.0.0", "id": "i-DRWO-V5", "position": { "x": 638.3758894671334, "y": 2713.350812681728 }, "fpEnabled": true, "inputsDB": { "hardwareEncoder": "hevc_videotoolbox" } }, { "name": "Tags: Requeue", "sourceRepo": "Community", "pluginName": "tagsRequeue", "version": "1.0.0", "id": "fs4VaTVGL", "position": { "x": 887.6436619492245, "y": 2942.884735746628 }, "fpEnabled": true, "inputsDB": { "basicQueueTags": "requireGPU" } }, { "name": "Tags: Worker Type", "sourceRepo": "Community", "pluginName": "tagsWorkerType", "version": "1.0.0", "id": "BCq5J-1vY", "position": { "x": 369.7369349449592, "y": -424.2790052892671 }, "fpEnabled": true, "inputsDB": { "requiredWorkerType": "CPU" } }, { "name": "Tags: Worker Type", "sourceRepo": "Community", "pluginName": "tagsWorkerType", "version": "1.0.0", "id": "h7rFTbkYC", "position": { "x": 620.704952436013, "y": 2368.3105711566377 }, "fpEnabled": true, "inputsDB": { "requiredWorkerType": "GPU" } }, { "name": "Fail Flow", "sourceRepo": "Community", "pluginName": "failFlow", "version": "1.0.0", "id": "NqtwClykz", "position": { "x": -324.8645465916996, "y": 2653.1700042013927 }, "fpEnabled": true }, { "name": "Fail Flow", "sourceRepo": "Community", "pluginName": "failFlow", "version": "1.0.0", "id": "TtmNk0cnL", "position": { "x": 170.94257197350674, "y": 3502.6511424747155 }, "fpEnabled": true }, { "name": "Tags: Worker Type", "sourceRepo": "Community", "pluginName": "tagsWorkerType", "version": "1.0.0", "id": "zoUa-DI6S", "position": { "x": -448.0972864862722, "y": 3310.921953308875 }, "fpEnabled": true, "inputsDB": { "requiredWorkerType": "CPU" } }, { "name": "Delete File", "sourceRepo": "Community", "pluginName": "deleteFile", "version": "1.0.0", "id": "a3EjGAToi", "position": { "x": -215.19412684089178, "y": 3040.3996516817033 }, "fpEnabled": true, "inputsDB": { "deleteParentFolderIfEmpty": "false" } }, { "name": "Copy to Working Directory", "sourceRepo": "Community", "pluginName": "copyToWorkDirectory", "version": "1.0.0", "id": "sQjSwrKjm", "position": { "x": -14.878982043311623, "y": 2753.471764275722 }, "fpEnabled": true }, { "name": "Notify Radarr or Sonarr", "sourceRepo": "Community", "pluginName": "notifyRadarrOrSonarr", "version": "2.0.0", "id": "l9AQw80_P", "position": { "x": 421.20346810681656, "y": 4444.970690925966 }, "fpEnabled": true, "inputsDB": { "arr": "sonarr", "arr_host": "http://sonarr-service:8989", "arr_api_key": "3839916310e44723abac3d2695c1d628" } }, { "name": "Reset Flow Error", "sourceRepo": "Community", "pluginName": "resetFlowError", "version": "1.0.0", "id": "jOyOd44rT", "position": { "x": 671.3236597687517, "y": 4469.633891212783 }, "fpEnabled": true }, { "name": "Run Classic Transcode Plugin", "sourceRepo": "Community", "pluginName": "runClassicTranscodePlugin", "version": "2.0.0", "id": "j92_WWor2", "position": { "x": 133.59381587711772, "y": 3624.277945413155 }, "fpEnabled": true, "inputsDB": { "pluginSourceId": "Community:Tdarr_Plugin_MC93_Migz3CleanAudio", "language": "eng,und,eng-us,eng-gb", "tag_language": "eng", "tag_title": "true" } } ], "flowEdges": [ { "source": "iPFEm7jhDk", "sourceHandle": "1", "target": "PqCllSBn6m", "targetHandle": null, "id": "doHagnXBW3" }, { "source": "iPFEm7jhDk", "sourceHandle": "2", "target": "PqCllSBn6m", "targetHandle": null, "id": "Zy8ianVS8B" }, { "source": "qbXSLWnN8a", "sourceHandle": "1", "target": "F0l4fqg3A-E", "targetHandle": null, "id": "Ftw6cXZYhBJ" }, { "source": "qbXSLWnN8a", "sourceHandle": "2", "target": "F0l4fqg3A-E", "targetHandle": null, "id": "u8WM-iTWJ0k" }, { "source": "F0l4fqg3A-E", "sourceHandle": "1", "target": "HZEhG4Hg8q8", "targetHandle": null, "id": "gg4P0op90VW" }, { "source": "F0l4fqg3A-E", "sourceHandle": "2", "target": "HZEhG4Hg8q8", "targetHandle": null, "id": "JqQPsIZ9DvN" }, { "source": "RriRTYqZSw2", "sourceHandle": "1", "target": "-8z1B9A9OVq", "targetHandle": null, "id": "uwBeQGevRyT" }, { "source": "RriRTYqZSw2", "sourceHandle": "2", "target": "-8z1B9A9OVq", "targetHandle": null, "id": "uN5v9pzYhqc" }, { "source": "-8z1B9A9OVq", "sourceHandle": "1", "target": "MBfLZeK8v", "targetHandle": null, "id": "C4DIHYjbess" }, { "source": "-8z1B9A9OVq", "sourceHandle": "2", "target": "MBfLZeK8v", "targetHandle": null, "id": "R5tzgCUslbp" }, { "source": "7Fa5pQEn-", "sourceHandle": "1", "target": "MShjlKlmZ", "targetHandle": null, "id": "TTUpjh0mb" }, { "source": "7Fa5pQEn-", "sourceHandle": "2", "target": "BZP0qRb3A", "targetHandle": null, "id": "8d-HX3bfI" }, { "source": "MShjlKlmZ", "sourceHandle": "2", "target": "BZP0qRb3A", "targetHandle": null, "id": "qXd7rln1D" }, { "source": "h71dtHUyI", "sourceHandle": "1", "target": "qbXSLWnN8a", "targetHandle": null, "id": "fQbY_zvI4" }, { "source": "d0ewkegGL", "sourceHandle": "1", "target": "h71dtHUyI", "targetHandle": null, "id": "tw1lmldz4" }, { "source": "PqCllSBn6m", "sourceHandle": "1", "target": "3NBo6uxeu", "targetHandle": null, "id": "GzXWweiH9" }, { "source": "PqCllSBn6m", "sourceHandle": "2", "target": "3NBo6uxeu", "targetHandle": null, "id": "A_lAwieUc" }, { "source": "3NBo6uxeu", "sourceHandle": "1", "target": "d0ewkegGL", "targetHandle": null, "id": "zxhM-i94f" }, { "source": "BSAJv72tB", "sourceHandle": "1", "target": "Gbi5BfofP", "targetHandle": null, "id": "sCoUJSWqi" }, { "source": "Gbi5BfofP", "sourceHandle": "1", "target": "WUY7nvmD4", "targetHandle": null, "id": "-KJYYiWoG" }, { "source": "HZEhG4Hg8q8", "sourceHandle": "1", "target": "BSAJv72tB", "targetHandle": null, "id": "6PgfWdxTu" }, { "source": "HZEhG4Hg8q8", "sourceHandle": "2", "target": "BSAJv72tB", "targetHandle": null, "id": "muT4-foCl" }, { "source": "MShjlKlmZ", "sourceHandle": "1", "target": "aRXqy18ag", "targetHandle": null, "id": "9vqHk72OL" }, { "source": "aRXqy18ag", "sourceHandle": "3", "target": "BZP0qRb3A", "targetHandle": null, "id": "3Y5w67dzS" }, { "source": "aRXqy18ag", "sourceHandle": "2", "target": "BZP0qRb3A", "targetHandle": null, "id": "ZgbjGdFzv" }, { "source": "4ru0OpOwA", "sourceHandle": "1", "target": "qBN3C3YEv", "targetHandle": null, "id": "B9P-Fvinp" }, { "source": "WUY7nvmD4", "sourceHandle": "1", "target": "4ru0OpOwA", "targetHandle": null, "id": "1GS8-eO54" }, { "source": "vR70RBuRxBS", "sourceHandle": "1", "target": "Bb8ufi1aX", "targetHandle": null, "id": "v_4JldijU" }, { "source": "vR70RBuRxBS", "sourceHandle": "2", "target": "Bb8ufi1aX", "targetHandle": null, "id": "pKxQoTo3b" }, { "source": "Bb8ufi1aX", "sourceHandle": "2", "target": "L3dc9pCo7", "targetHandle": null, "id": "oPbj3c9GJ" }, { "source": "Bb8ufi1aX", "sourceHandle": "1", "target": "NMiKZEweT", "targetHandle": null, "id": "dHVCG7ztw" }, { "source": "XiJs1ct3r", "sourceHandle": "1", "target": "9A045nqIO", "targetHandle": null, "id": "0OmNpZnpj" }, { "source": "9A045nqIO", "sourceHandle": "1", "target": "Bb8ufi1aX", "targetHandle": null, "id": "kDy1TyM6c" }, { "source": "NMiKZEweT", "sourceHandle": "3", "target": "xV6abVF2S", "targetHandle": null, "id": "QYg2AFMWr" }, { "source": "L3dc9pCo7", "sourceHandle": "3", "target": "xV6abVF2S", "targetHandle": null, "id": "leXyQYfSJ" }, { "source": "aRXqy18ag", "sourceHandle": "1", "target": "3dtt0aUAg", "targetHandle": null, "id": "gD7TsS1ba" }, { "source": "NMiKZEweT", "sourceHandle": "2", "target": "sXJxOD7yU", "targetHandle": null, "id": "0GQ4eNuoy" }, { "source": "L3dc9pCo7", "sourceHandle": "2", "target": "sXJxOD7yU", "targetHandle": null, "id": "P5M6P0ScW" }, { "source": "3dtt0aUAg", "sourceHandle": "1", "target": "iPFEm7jhDk", "targetHandle": null, "id": "xw_Feqthh" }, { "source": "4ru0OpOwA", "sourceHandle": "2", "target": "T-lobnuXN", "targetHandle": null, "id": "neq6MdlZv" }, { "source": "8ZW2Ra_Or", "sourceHandle": "1", "target": "vR70RBuRxBS", "targetHandle": null, "id": "YFFqMXc9y" }, { "source": "8ZW2Ra_Or", "sourceHandle": "2", "target": "i-DRWO-V5", "targetHandle": null, "id": "Ic2SeHC4d" }, { "source": "i-DRWO-V5", "sourceHandle": "1", "target": "jSiAWJmsR", "targetHandle": null, "id": "E9TeneG16" }, { "source": "jSiAWJmsR", "sourceHandle": "1", "target": "XiJs1ct3r", "targetHandle": null, "id": "yiZ6rbO8m" }, { "source": "i-DRWO-V5", "sourceHandle": "2", "target": "fs4VaTVGL", "targetHandle": null, "id": "mmfZ7LJBp" }, { "source": "fs4VaTVGL", "sourceHandle": "1", "target": "8ZW2Ra_Or", "targetHandle": null, "id": "9W-jWVL0z" }, { "source": "0dswXCUvul", "sourceHandle": "1", "target": "BCq5J-1vY", "targetHandle": null, "id": "M2wzWm3e1" }, { "source": "BCq5J-1vY", "sourceHandle": "1", "target": "7Fa5pQEn-", "targetHandle": null, "id": "3kjgomHFj" }, { "source": "T-lobnuXN", "sourceHandle": "1", "target": "h7rFTbkYC", "targetHandle": null, "id": "qi2I87J78" }, { "source": "T-lobnuXN", "sourceHandle": "2", "target": "qBN3C3YEv", "targetHandle": null, "id": "KKFPBk7Az" }, { "source": "h7rFTbkYC", "sourceHandle": "1", "target": "8ZW2Ra_Or", "targetHandle": null, "id": "nlI5xL1BU" }, { "source": "qBN3C3YEv", "sourceHandle": "2", "target": "NqtwClykz", "targetHandle": null, "id": "bnTt3iev7" }, { "source": "qBN3C3YEv", "sourceHandle": "3", "target": "NqtwClykz", "targetHandle": null, "id": "NtOGiGkSm" }, { "source": "GAwHiDLtS", "sourceHandle": "2", "target": "TtmNk0cnL", "targetHandle": null, "id": "BlpDlv2v6" }, { "source": "GAwHiDLtS", "sourceHandle": "3", "target": "TtmNk0cnL", "targetHandle": null, "id": "cpP6fdlia" }, { "source": "sXJxOD7yU", "sourceHandle": "1", "target": "zoUa-DI6S", "targetHandle": null, "id": "kgek_iOSq" }, { "source": "sXJxOD7yU", "sourceHandle": "err1", "target": "xV6abVF2S", "targetHandle": null, "id": "yjWOOye8Q" }, { "source": "NMiKZEweT", "sourceHandle": "1", "target": "zoUa-DI6S", "targetHandle": null, "id": "rY656DOeH" }, { "source": "L3dc9pCo7", "sourceHandle": "1", "target": "zoUa-DI6S", "targetHandle": null, "id": "iEmktytGe" }, { "source": "qBN3C3YEv", "sourceHandle": "1", "target": "zoUa-DI6S", "targetHandle": null, "id": "aXyMYW3Sm" }, { "source": "zoUa-DI6S", "sourceHandle": "1", "target": "GAwHiDLtS", "targetHandle": null, "id": "3bbu3p4P6" }, { "source": "xV6abVF2S", "sourceHandle": "1", "target": "a3EjGAToi", "targetHandle": null, "id": "FDs0C2Shj" }, { "source": "sQjSwrKjm", "sourceHandle": "1", "target": "iPFEm7jhDk", "targetHandle": null, "id": "3GU7siIF-" }, { "source": "GAwHiDLtS", "sourceHandle": "1", "target": "j92_WWor2", "targetHandle": null, "id": "G_e8KzLE_" }, { "source": "j92_WWor2", "sourceHandle": "1", "target": "RriRTYqZSw2", "targetHandle": null, "id": "b-rW3NLiP" }, { "source": "j92_WWor2", "sourceHandle": "2", "target": "RriRTYqZSw2", "targetHandle": null, "id": "ti_aMAG3_" }, { "source": "l9AQw80_P", "sourceHandle": "err1", "target": "jOyOd44rT", "targetHandle": null, "id": "CIS63E_zH" }, { "source": "MBfLZeK8v", "sourceHandle": "1", "target": "l9AQw80_P", "targetHandle": null, "id": "QPDw9iK9z" }, { "source": "a3EjGAToi", "sourceHandle": "1", "target": "sQjSwrKjm", "targetHandle": null, "id": "xe_ac3gBl" } ] } ```
@taltamir
Copy link

taltamir commented Oct 27, 2024

I have been banging my head against this as well. although for slightly different reasons. I believe you should be able to get what you want using the Set Original File function

Tags: Requeue simply does not work. it just marks the file as successfully finished. And I can't find any way to check the tag within the flow, only outside the flow to determine which worker gets it.

Delete File set to delete Working File just makes anything after it error out due to working file not being found.

Set Original File states
Set the working file to the original file path at the very start of the flow. The original file won't be affected by subsequent plugins (E.g. Replace Original File).
This seems to be wrong. as replace original file DOES actually work if done after that. (so long as you actually do some sort of processing first.).

it is worth noting that you do not need to use delete file. just set original file after a transcode you want to discard.

unfortunately, I have yet to figure out how to actually properly mark the file via metadata to indicate that it should stop trying to transcode it every time it goes through.

meanwhile, if you remux and then replace the original file and then continue onwards then the remuxed file will immediately start processing in parallel.
that is, if I take

test.mp4
remux to test.mkv
transcode audio to opus.
transcode video to av1

it will be processing test.mp4 and test.mkv in parallel. ending up with two files test.mp4 and test.mkv

the workaround I currently found is

test.mp4
remux to test.mkv
requeue

manually requeue here because automatic requeue does not work

test.mkv
transcode audio to opus. check size. if size is smaller use replace original file, if size is bigger use Set Original File
transcode video to av1. check size. if size is smaller use replace original file, if size is bigger use Set Original File
if test.mkv is av1 + opus. remux to webm then replace original file

@HaveAGitGat
Copy link
Owner

If the working file is still the original file, and you delete the working file, then you will be deleting the original file.

@taltamir what tags have you used? The tags are a Tdarr Pro feature. You need to set the node tags in the node options panel. Then tags: requeue must have tags which are a subset of the node tags.

@taltamir
Copy link

taltamir commented Oct 31, 2024

@taltamir what tags have you used? The tags are a Tdarr Pro feature. You need to set the node tags in the node options panel. Then tags: requeue must have tags which are a subset of the node tags.

I used simple tags checkbox. and then either RequireCPU or RequireCPUorGPU picked from the drop down menu.
I don't have pro. I don't actually want the tags, I just want it to requeue so it can start the flow over as a fresh "new" file.

I do things step by step, but after remuxing to mkv I gotta restart.
this is because the tags: requeue does not work to requeue it. but if I try to do any processing on the mkv file, it will immediately spawn a new worker to work on the same file.

for example
test.webm (vp9 + opus)

flow: input file -> remux to mkv -> convert audio to opus using ffmpeg if not opus -> convert video to av1 using libsvtav1 -> remux to webm -> finished

will produce two end files
test.mkv (av1 + opus)
test.webm (av1 + opus)

and it will trasncode them both seperately on two different nodes.
the workaround is to have a split.
if already mkv, encode
if not mkv, remux to mkv then stop. (or if cannot be remuxed to mkv, reencode to av1 and opus in mkv at the same time).

by stopping after the mkv it prevents the double encode issue and the two files issue.
but it does require me to manually requeue the mkv file so it can get converted

I initially wanted to somehow tag a file as "skipaudioencode" and "skipvideoencode". so i could check the size of video and audio afterwards. but could not find any way to examine the tags inside the flow itself.
Thus I am just forcing the audio to opus no matter what. and skipping if already opus.
for video, I skip if already av1, otherwise I try and convert, and then check if the new file is smaller. if not delete working file and finish.

this is inefficient since it will waste time trying to reencode the video every time I requeue all files.

@taltamir
Copy link

If the working file is still the original file, and you delete the working file, then you will be deleting the original file.

That is really not a very logical thing to do.
there should be a check to see if the working file is the original file or a /cache/ directory file.
And only delete the file in the cache if one exists.
Otherwise, delete working file should do nothing on account of a working file not existing.
Because there is an option to delete original file if that is what you wanted to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants