{
    "definitions": {
        "source_file": "contents.mp4",
        "source_path": "s3://your-domain/your-src",
        "destination_path": "s3://your-domain/your-watermarked/dst",
        "awsecr_image_urn": "public.ecr.aws/pallycon/wm_plugin_pub:latest",
        "wm_key_file_base64": "yxFNjptzCUNHE5d/gJ5g+fWZHi0XUFuZxHuFD0ycQCZvuVpQUMZO79OqVat5VMp9gZIRTrC63Lf3otykHBL9sVyEDr3jAqDnEBXD9JPiNne9bFf1k1hH1hUiIrj1YeYRtfNVdDstmC2JMBzApHdGjGPSRBE=",
        "wm_access_key": "FOR_INKA_FORENSIC_WATERMARK_TEST",
        "vcodec": "h264",
        "vtrack1_width": 1280,
        "vtrack1_height": 720,
        "vtrack1_bitrate_kb": 2000,
        "vtrack2_width": 960,
        "vtrack2_height": 540,
        "vtrack2_bitrate_kb": 1000,
        "frame_rate": "24000/1000",
        "idr_frames": 48,
        "acodec": "aac",
        "audio_bitrate_kb": 128
    },
    "name": "your_job_name",
    "payload": {
        "elements": [
            {
                "uid": "source",
                "kind": "source",
                "payload": {
                    "kind": "asset_url",
                    "payload": {
                        "storage_provider": "s3",
                        "url": "{{source_path}}/{{source_file}}"
                    }
                }
            },
            {
                "uid": "job_modifier_task",
                "kind": "script",
                "payload": {
                    "kind": "job_modifier",
                    "payload": {
                        "modifiers": [
                            {
                                "target_element_uid": "transcode_video_wm0_task",
                                "kind": "transcode_auto_split",
                                "mode": "aggressive"
                            },
                            {
                                "target_element_uid": "transcode_video_wm1_task",
                                "kind": "transcode_auto_split",
                                "mode": "aggressive"
                            },
                            {
                                "target_element_uid": "transcode_audio_task",
                                "kind": "transcode_auto_split",
                                "mode": "smart"
                            }
                        ]
                    }
                }
            },
            {
                "uid": "transcode_video_wm0_task",
                "kind": "transcode",
                "payload": {
                    "location": {
                        "path": "{{destination_path}}",
                        "storage_provider": "s3"
                    },
                    "targets": [
                        {
                            "container": {
                                "kind": "fmp4",
                                "segment_duration_sec": 2
                            },
                            "video": {
                                "codec": "{{vcodec}}",
                                "width": "{{vtrack1_width}}",
                                "height": "{{vtrack1_height}}",
                                "bitrate_kb": "{{vtrack1_bitrate_kb}}",
                                "frame_rate": "{{frame_rate}}",
                                "use_scene_detection": false,
                                "use_closed_gop": true,
                                "idr_interval": {
                                    "frames": "{{idr_frames}}"
                                },
                                "filters": [
                                    {
                                        "payload": {
                                            "docker_image": {
                                                "image_urn": "{{awsecr_image_urn}}",
                                                "registry": {
                                                    "kind": "ecr"
                                                }
                                            },
                                            "config": {
                                                "wm_key_file_base64": "{{wm_key_file_base64}}",
                                                "wm_access_key": "{{wm_access_key}}",
                                                "wm_fwm_symbol": 0
                                            }
                                        },
                                        "kind": "plugin_docker"
                                    }
                                ]
                            },
                            "existing_files": "replace",
                            "file_pattern": "video_{{vtrack1_height}}p{default_extension}"
                        },
                        {
                            "container": {
                                "kind": "fmp4",
                                "segment_duration_sec": 2
                            },
                            "video": {
                                "codec": "{{vcodec}}",
                                "width": "{{vtrack2_width}}",
                                "height": "{{vtrack2_height}}",
                                "bitrate_kb": "{{vtrack2_bitrate_kb}}",
                                "frame_rate": "{{frame_rate}}",
                                "use_scene_detection": false,
                                "use_closed_gop": true,
                                "idr_interval": {
                                    "frames": "{{idr_frames}}"
                                },
                                "filters": [
                                    {
                                        "payload": {
                                            "docker_image": {
                                                "image_urn": "{{awsecr_image_urn}}",
                                                "registry": {
                                                    "kind": "ecr"
                                                }
                                            },
                                            "config": {
                                                "wm_key_file_base64": "{{wm_key_file_base64}}",
                                                "wm_access_key": "{{wm_access_key}}",
                                                "wm_fwm_symbol": 0
                                            }
                                        },
                                        "kind": "plugin_docker"
                                    }
                                ]
                            },
                            "existing_files": "replace",
                            "file_pattern": "video_{{vtrack2_height}}p{default_extension}"
                        }
                    ],
                    "options": {
                        "pipeline": {
                            "timestamp_handling": "flexible"
                        },
                        "source_read_mode": "auto"
                    }
                }
            },
            {
                "uid": "transcode_video_wm1_task",
                "kind": "transcode",
                "payload": {
                    "location": {
                        "path": "{{destination_path}}",
                        "storage_provider": "s3"
                    },
                    "targets": [
                        {
                            "container": {
                                "kind": "fmp4",
                                "segment_duration_sec": 2
                            },
                            "video": {
                                "codec": "{{vcodec}}",
                                "width": "{{vtrack1_width}}",
                                "height": "{{vtrack1_height}}",
                                "bitrate_kb": "{{vtrack1_bitrate_kb}}",
                                "frame_rate": "{{frame_rate}}",
                                "use_scene_detection": false,
                                "use_closed_gop": true,
                                "idr_interval": {
                                    "frames": "{{idr_frames}}"
                                },
                                "filters": [
                                    {
                                        "payload": {
                                            "docker_image": {
                                                "image_urn": "{{awsecr_image_urn}}",
                                                "registry": {
                                                    "kind": "ecr"
                                                }
                                            },
                                            "config": {
                                                "wm_key_file_base64": "{{wm_key_file_base64}}",
                                                "wm_access_key": "{{wm_access_key}}",
                                                "wm_fwm_symbol": 1
                                            }
                                        },
                                        "kind": "plugin_docker"
                                    }
                                ]
                            },
                            "existing_files": "replace",
                            "file_pattern": "b.video_{{vtrack1_height}}p{default_extension}"
                        },
                        {
                            "container": {
                                "kind": "fmp4",
                                "segment_duration_sec": 2
                            },
                            "video": {
                                "codec": "{{vcodec}}",
                                "width": "{{vtrack2_width}}",
                                "height": "{{vtrack2_height}}",
                                "bitrate_kb": "{{vtrack2_bitrate_kb}}",
                                "frame_rate": "{{frame_rate}}",
                                "use_scene_detection": false,
                                "use_closed_gop": true,
                                "idr_interval": {
                                    "frames": "{{idr_frames}}"
                                },
                                "filters": [
                                    {
                                        "payload": {
                                            "docker_image": {
                                                "image_urn": "{{awsecr_image_urn}}",
                                                "registry": {
                                                    "kind": "ecr"
                                                }
                                            },
                                            "config": {
                                                "wm_key_file_base64": "{{wm_key_file_base64}}",
                                                "wm_access_key": "{{wm_access_key}}",
                                                "wm_fwm_symbol": 1
                                            }
                                        },
                                        "kind": "plugin_docker"
                                    }
                                ]
                            },
                            "existing_files": "replace",
                            "file_pattern": "b.video_{{vtrack2_height}}p{default_extension}"
                        }
                    ],
                    "options": {
                        "pipeline": {
                            "timestamp_handling": "flexible"
                        },
                        "source_read_mode": "auto"
                    }
                }
            },
            {
                "uid": "transcode_audio_task",
                "kind": "transcode",
                "payload": {
                    "location": {
                        "path": "{{destination_path}}",
                        "storage_provider": "s3"
                    },
                    "targets": [
                        {
                            "container": {
                                "kind": "fmp4"
                            },
                            "audio": [
                                {
                                    "codec": "{{acodec}}",
                                    "bitrate_kb": "{{audio_bitrate_kb}}",
                                    "source": [
                                        {
                                            "track": 0
                                        }
                                    ]
                                }
                            ],
                            "existing_files": "replace",
                            "file_pattern": "audio{default_extension}"
                        }
                    ],
                    "options": {
                        "source_read_mode": "auto"
                    }
                }
            },
            {
                "uid": "dash_seg_mp4_wm0",
                "kind": "package",
                "payload": {
                    "uid": "main_manifest",
                    "kind": "dash",
                    "location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/dash"
                    },
                    "file_pattern": "stream.mpd",
                    "segmentation_mode": "segmented_mp4",
                    "segment_duration_sec": 2,
                    "force_original_media": false,
                    "media_location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/dash/media"
                    }
                }
            },
            {
                "uid": "hls_seg_ts_wm0",
                "kind": "package",
                "payload": {
                    "uid": "main_manifest",
                    "kind": "hls",
                    "location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/hls",
                        "attributes": [
                            {
                                "name": "ContentType",
                                "value": "application/x-mpegURL"
                            }
                        ]
                    },
                    "file_pattern": "master.m3u8",
                    "segmentation_mode": "segmented_ts",
                    "segment_duration_sec": 2,
                    "force_original_media": false,
                    "media_location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/hls/media",
                        "attributes": [
                            {
                                "name": "ContentType",
                                "value": "video/MP2T"
                            }
                        ]
                    },
                    "media_file_pattern": "{source_basename}.ts",
                    "hls": {
                        "media_playlist_location": {
                            "storage_provider": "s3",
                            "path": "{{destination_path}}/hls/media"
                        }
                    }
                }
            },
            {
                "uid": "dash_seg_mp4_wm1",
                "kind": "package",
                "payload": {
                    "uid": "main_manifest",
                    "kind": "dash",
                    "location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/dash/media"
                    },
                    "file_pattern": "b.stream.mpd",
                    "segmentation_mode": "segmented_mp4",
                    "segment_duration_sec": 2,
                    "force_original_media": false,
                    "media_location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/dash/media"
                    }
                }
            },
            {
                "uid": "hls_seg_ts_wm1",
                "kind": "package",
                "payload": {
                    "uid": "main_manifest",
                    "kind": "hls",
                    "location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/hls/media",
                        "attributes": [
                            {
                                "name": "ContentType",
                                "value": "application/x-mpegURL"
                            }
                        ]
                    },
                    "file_pattern": "b.master.m3u8",
                    "segmentation_mode": "segmented_ts",
                    "segment_duration_sec": 2,
                    "force_original_media": false,
                    "media_location": {
                        "storage_provider": "s3",
                        "path": "{{destination_path}}/hls/media",
                        "attributes": [
                            {
                                "name": "ContentType",
                                "value": "video/MP2T"
                            }
                        ]
                    },
                    "media_file_pattern": "{source_basename}.ts",
                    "hls": {
                        "media_playlist_location": {
                            "storage_provider": "s3",
                            "path": "{{destination_path}}/hls/media"
                        }
                    }
                }
            }
        ],
        "connections": [
            {
                "from": [
                    {
                        "element": "source"
                    }
                ],
                "to": {
                    "success": [
                        {
                            "element": "job_modifier_task"
                        }
                    ]
                }
            },
            {
                "from": [
                    {
                        "element": "job_modifier_task"
                    }
                ],
                "to": {
                    "success": [
                        {
                            "element": "transcode_video_wm0_task"
                        },
                        {
                            "element": "transcode_video_wm1_task"
                        },
                        {
                            "element": "transcode_audio_task"
                        }
                    ]
                }
            },
            {
                "from": [
                    {
                        "element": "transcode_video_wm0_task"
                    },
                    {
                        "element": "transcode_audio_task"
                    }
                ],
                "to": {
                    "success": [{
                            "element": "dash_seg_mp4_wm0"
                        },
                        {
                            "element": "hls_seg_ts_wm0"
                        }
                    ]
                }
            },
            {
                "from": [
                    {
                        "element": "transcode_video_wm1_task"
                    }
                ],
                "to": {
                    "success": [{
                            "element": "dash_seg_mp4_wm1"
                        },
                        {
                            "element": "hls_seg_ts_wm1"
                        }
                    ]
                }
            }
        ]
    }
}