﻿{
  "workflow": {
    "wf_id": "20240418-2052-0549-4055-cbd6539435ae",
    "wf_name": "emcodem_concat_1.4.3_avisynth_cuts",
    "wf_folder": "",
    "description": "webui_stitch Format independent stitching with in/outpoint",
    "updated": "2024-09-29T18:27:04.879+02:00",
    "updated_by": "Gam3r1@DESKTOP-3VMPAN6",
    "created": "2024-04-18T20:52:05.494+02:00",
    "general": {
      "sleep": 30,
      "priority": "2 (normal)",
      "timeout_level": 3,
      "cron": ""
    },
    "maintainance": {
      "keep_all_workdir": true,
      "keep_failed_workdir": false,
      "work_age": 5,
      "run_on_days": 1234567
    },
    "special": {
      "log_level": "1 (Basic)",
      "force_32bit": false,
      "protected": false,
      "password": ""
    },
    "nodes": [
      {
        "id": "20240219-2312-2887-9576-7555628bfa0e",
        "type": "op_foreach",
        "custom_proc_guid": "",
        "name": "For each",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 737.676,
        "pos_y": 627.23,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20240220-0021-3405-87e3-f25b602c6186"
          }
        ],
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "astring": "%webui_o_source%",
          "value": "%s_temp%",
          "index": "%i_index%"
        },
        "description": "This branch will finish before above goes on\r\n\r\nPre-transcode each and every source, ensuring they can be stitched"
      },
      {
        "id": "20240220-0021-3405-87e3-f25b602c6186",
        "type": "op_populate",
        "custom_proc_guid": "",
        "name": "Populate variables",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 1400.352,
        "pos_y": 627.23,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "dec_avmedia",
            "id": "20240928-2320-3649-0679-3ae297447b84"
          }
        ],
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "variables": [
            {
              "name": "s_ffconcat",
              "data": "$jsonget(\"%s_temp%\",\"ffconcat\")",
              "type": "string"
            },
            {
              "name": "s_source",
              "data": "$jsonget(\"%s_temp%\",\"source\")",
              "type": "string"
            },
            {
              "name": "s_inpoint_frames",
              "data": "$jsonget(\"%s_temp%\",\"inpoint_frames\")",
              "type": "string"
            },
            {
              "name": "s_outpoint_frames",
              "data": "$jsonget(\"%s_temp%\",\"outpoint_frames\")",
              "type": "string"
            }
          ]
        },
        "description": "get current files concat options from webui"
      },
      {
        "id": "20240221-0150-5190-67db-b8a68af090e5",
        "type": "cmd_run",
        "custom_proc_guid": "",
        "name": "Command executor",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 4051.056,
        "pos_y": 75,
        "execute_on": "success",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "command": "cmd \/C \"%s_encode_config%\"",
          "out_source": "",
          "omit_exit_code": false,
          "console": false,
          "show_command": true,
          "unicode": false,
          "stdout_var_name": "None",
          "set_timeout": 120,
          "error_timeout": 1,
          "std_types": "stdout + stderr"
        },
        "outbounds": [
          {
            "type": "dest_folder",
            "id": "20240221-2008-3516-5d68-91d1741ff841"
          }
        ],
        "description": "execute the modified encode cmd"
      },
      {
        "id": "20240221-2008-3516-5d68-91d1741ff841",
        "type": "dest_folder",
        "custom_proc_guid": "",
        "name": "Folder",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 4713.732,
        "pos_y": 75,
        "execute_on": "success",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "folder": "c:\\temp",
          "suffix": "",
          "prefix": "stitched",
          "overwrite": false,
          "unique": true,
          "case": "None",
          "drop_name": false,
          "drop_ext": false,
          "move": false,
          "padding": "None"
        },
        "description": "Deliver final file",
        "outbounds": []
      },
      {
        "id": "20240221-2016-5047-7f5b-3ad1324ed8d0",
        "type": "op_populate",
        "custom_proc_guid": "",
        "name": "Populate variables",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 3388.38,
        "pos_y": 75,
        "execute_on": "success",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "variables": [
            {
              "name": "s_encode_config",
              "data": "$regreplace(\"%s_last_enc_cmd%\",\"-vf \", \"-vf setpts=N\/FRAME_RATE\/TB,\")",
              "type": "string"
            }
          ]
        },
        "outbounds": [
          {
            "type": "cmd_run",
            "id": "20240221-0150-5190-67db-b8a68af090e5"
          }
        ],
        "description": "modify encoding cmd, insert setpts filter to avoid a/v sync problems"
      },
      {
        "id": "20240415-2334-2318-81e4-f8e8dcbdcd9d",
        "type": "enc_av_xdcamhd",
        "custom_proc_guid": "",
        "name": "XDCAM-HD",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 2725.704,
        "pos_y": 75,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20240221-2016-5047-7f5b-3ad1324ed8d0"
          }
        ],
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "audio": {
            "db_adjust": -23,
            "loudness_table": "",
            "loudness_enable": false,
            "bitdepth": 24,
            "samplerate": 48000,
            "bitrate": null,
            "codec": "pcm_s24le",
            "layout": "default",
            "streams": [
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  1
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  2
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  3
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  4
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  5
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  6
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  7
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  8
                ]
              }
            ]
          },
          "video": {
            "format": "1920×1080i50",
            "resizing": "Fit and keep aspect",
            "interlacing": "Autodetect",
            "type": "50 Mbit (422)",
            "processing": "None, transwrap",
            "videorange": "Set to Limited",
            "transformation": "None",
            "tuning": "Normal",
            "gop": "Closed",
            "nlq": true
          },
          "avid": {
            "enable": false,
            "clipname": "%s_original_name%",
            "project": "%s_wf_name%",
            "tape": "%s_original_path~1%"
          },
          "wrapper": "MXF",
          "start_tc": "%s_start_tc%"
        },
        "description": "we can \"rewrap\" because the branch below produces complete segments"
      },
      {
        "id": "20240928-2320-3649-0679-3ae297447b84",
        "type": "dec_avmedia",
        "custom_proc_guid": "",
        "name": "A/V Media",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 2063.028,
        "pos_y": 627.23,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "avs_custom",
            "id": "20240928-2320-4833-81b0-a804c6235e4c"
          }
        ]
      },
      {
        "id": "20240928-2320-4833-81b0-a804c6235e4c",
        "type": "avs_custom",
        "custom_proc_guid": "",
        "name": "Custom AviSynth script",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 2725.704,
        "pos_y": 627.23,
        "execute_on": "success",
        "description": "Cut Frame Accurate",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "script": "# the variables s_inpoint_frames and outpoint can be either nothing or some number.\r\n#this script checks if we have nothing or number, if nothing we set inpoint to 0 and outpoint to max value (=whole clip)\r\n\r\nlast = m_clip\r\ninpoint = StrLen(\"%s_inpoint_frames%\") != 0 ? Eval(\"%s_inpoint_frames%\") : 0\r\noutpoint = StrLen(\"%s_outpoint_frames%\") != 0 ? Eval(\"%s_outpoint_frames%\") : 999999999\r\n trim(inpoint ,outpoint )\r\n\r\nm_clip = last\r\nreturn m_clip",
          "verify": false,
          "adapt": false,
          "clear_props": true,
          "x64avisynth": true
        },
        "outbounds": [
          {
            "type": "enc_av_xdcamhd",
            "id": "20240928-2321-3482-574a-adb38fb1d04f"
          }
        ]
      },
      {
        "id": "20240928-2321-3482-574a-adb38fb1d04f",
        "type": "enc_av_xdcamhd",
        "custom_proc_guid": "",
        "name": "XDCAM-HD",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 3388.38,
        "pos_y": 627.23,
        "execute_on": "success",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "audio": {
            "db_adjust": -23,
            "loudness_table": "",
            "loudness_enable": false,
            "bitdepth": 24,
            "samplerate": 48000,
            "bitrate": null,
            "codec": "pcm_s24le",
            "layout": "default",
            "streams": [
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  1
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  2
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  3
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  4
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  5
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  6
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  7
                ]
              },
              {
                "codec": "pcm_s24le",
                "samplerate": 48000,
                "bitrate": null,
                "bitdepth": 24,
                "mapping": [
                  8
                ]
              }
            ]
          },
          "video": {
            "format": "1920×1080i50",
            "resizing": "Fit and keep aspect",
            "interlacing": "Autodetect",
            "type": "50 Mbit (422)",
            "processing": "Full transcoding",
            "videorange": "Set to Limited",
            "transformation": "None",
            "tuning": "Normal",
            "gop": "Open",
            "nlq": true
          },
          "avid": {
            "enable": false,
            "clipname": "%s_original_name%",
            "project": "%s_wf_name%",
            "tape": "%s_original_path~1%"
          },
          "wrapper": "MXF",
          "start_tc": "%s_start_tc%"
        },
        "outbounds": [
          {
            "type": "dest_folder",
            "id": "20240929-1152-1641-22ab-d0553b18b50e"
          }
        ]
      },
      {
        "id": "20240929-1152-1641-22ab-d0553b18b50e",
        "type": "dest_folder",
        "custom_proc_guid": "",
        "name": "Folder",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 4051.056,
        "pos_y": 627.23,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20240929-1311-3944-53f8-71c75a3e78d6"
          }
        ],
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "folder": "%s_job_work%\\concatfiles",
          "suffix": "%i_index%",
          "prefix": "",
          "overwrite": false,
          "unique": false,
          "case": "None",
          "drop_name": true,
          "drop_ext": true,
          "move": true,
          "padding": "None"
        }
      },
      {
        "id": "20240929-1309-3729-7bb6-24c8889570d8",
        "type": "other_textfile",
        "custom_proc_guid": "",
        "name": "Generate text file",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": true,
        "pos_x": 75,
        "pos_y": 75,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "op_foreach",
            "id": "20240219-2312-2887-9576-7555628bfa0e",
            "connection": "subhold"
          },
          {
            "type": "other_textfile",
            "id": "20240929-1310-1686-6812-74c66f4478f1"
          }
        ],
        "description": "Start chunk array text file",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "text": "[\r\n",
          "encoding": "UTF-8",
          "out_file": "chunks.txt",
          "out_folder": "%s_job_work%",
          "append": false,
          "set_to_source": false
        }
      },
      {
        "id": "20240929-1310-1686-6812-74c66f4478f1",
        "type": "other_textfile",
        "custom_proc_guid": "",
        "name": "Generate text file",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 737.676,
        "pos_y": 75,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "op_populate",
            "id": "20240929-1313-2673-9370-e901d2239436"
          }
        ],
        "description": "Finalize chunk array text file ",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "text": "]",
          "encoding": "UTF-8",
          "out_file": "chunks.txt",
          "out_folder": "%s_job_work%",
          "append": true,
          "set_to_source": true
        }
      },
      {
        "id": "20240929-1311-3943-973e-ce61b0ded896",
        "type": "other_textfile",
        "custom_proc_guid": "",
        "name": "Generate text file",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 5376.408,
        "pos_y": 627.23,
        "execute_on": "success",
        "outbounds": [],
        "description": "Append chunk to text file",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "text": "\"%s_temp%\",\r\n",
          "encoding": "UTF-8",
          "out_file": "chunks.txt",
          "out_folder": "%s_job_work%",
          "append": true,
          "set_to_source": false
        }
      },
      {
        "id": "20240929-1311-3944-53f8-71c75a3e78d6",
        "type": "op_populate",
        "custom_proc_guid": "",
        "name": "Populate variables",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 4713.732,
        "pos_y": 627.23,
        "execute_on": "success",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "variables": [
            {
              "name": "s_temp",
              "data": "$jsonencode(\"%s_job_work%\\concatfiles\\%i_index%\")",
              "type": "string"
            }
          ]
        },
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20240929-1311-3943-973e-ce61b0ded896"
          }
        ],
        "description": "prepare filename for writing to array"
      },
      {
        "id": "20240929-1313-2673-9370-e901d2239436",
        "type": "op_populate",
        "custom_proc_guid": "",
        "name": "Populate variables",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 1400.352,
        "pos_y": 75,
        "execute_on": "success",
        "outbounds": [
          {
            "type": "other_textfile",
            "id": "20240929-1324-4534-2123-880b74787424"
          }
        ],
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "variables": [
            {
              "name": "None",
              "data": "%s_job_work%\\concat_final.txt",
              "type": "number"
            },
            {
              "name": "s_options",
              "data": "skip_encoding=true|save_enc_cmd=true",
              "type": "string"
            },
            {
              "name": "s_temp",
              "data": "$sort($read(\"%s_source%\"))",
              "type": "string"
            },
            {
              "name": "s_temp",
              "data": "$ffconcat(\"%s_temp%\")",
              "type": "string"
            }
          ]
        },
        "description": "set option skip_encoding\r\nSort chunks"
      },
      {
        "id": "20240929-1324-4534-2123-880b74787424",
        "type": "other_textfile",
        "custom_proc_guid": "",
        "name": "Generate text file",
        "slots": 1,
        "hosts_group": 0,
        "bypass": false,
        "start_proc": false,
        "pos_x": 2063.028,
        "pos_y": 75,
        "execute_on": "success",
        "preset": {
          "name": "(custom)",
          "id": null
        },
        "properties": {
          "text": "%s_temp%",
          "encoding": "UTF-8",
          "out_file": "concat_final",
          "out_folder": "%s_job_work%",
          "append": false,
          "set_to_source": true
        },
        "outbounds": [
          {
            "type": "enc_av_xdcamhd",
            "id": "20240415-2334-2318-81e4-f8e8dcbdcd9d"
          }
        ],
        "description": "write ffconcat"
      }
    ],
    "version": "1.4.0.92",
    "variable": {
      "wf_size": 441.784
    },
    "farming": {
      "hosts": [],
      "include": false
    }
  },
  "user_variables": {
    "variables": [
      {
        "name": "i_index",
        "type": "integer",
        "data": ""
      },
      {
        "name": "s_ffconcat",
        "type": "string",
        "data": ""
      },
      {
        "name": "s_temp",
        "type": "string",
        "data": ""
      },
      {
        "name": "s_encode_config",
        "type": "string",
        "data": ""
      },
      {
        "name": "s_inpoint_frames",
        "type": "string",
        "data": ""
      },
      {
        "name": "s_outpoint_frames",
        "type": "string",
        "data": ""
      }
    ]
  }
}