encoding-transcode_cropdetect

{
    "tags": [
        "itest",
        "encoding",
        "transcode_cropdetect"
    ],
    "region": "aws:eu-west-1",
    "tasks": [
        {
            "tool": "storage:get",
            "parameters": {
                "location": "s3://{com-castlabs-vtk-test-access-keys}@com.castlabs.vtk.test/IN",
                "files": [
                    "tos_5s_video_1920x1080_2mbps.mp4",
                    "tos_5s_audio_44100Hz_64k_HE_2chan_eng.mp4"
                ]
            }
        },
        {
            "parameters": {
                "inputfile": "tos_5s_video_1920x1080_2mbps.mp4"
            },
            "tool": "transcode:cropdetect"
        },
        {
            "tool": "ffmpeg:cmd",
            "parameters": {
                "arguments": [
                    "-y",
                    "-i",
                    "tos_5s_video_1920x1080_2mbps.mp4",
                    "-i",
                    "tos_5s_audio_44100Hz_64k_HE_2chan_eng.mp4",
                    "-filter_complex_threads",
                    "36",
                    "-filter_complex",
                    "\"[0:v]{cropdetect}[cropped];[cropped]scale='(trunc((ih*((dar)/2))*2))':ih,setsar=1[squarepixeled];[squarepixeled]scale=384:'if(not(mod((384/a),2)),-2,(trunc((384/a)/2)*2))',setsar=1[scaled];[scaled]drawtext=fontsize=(main_h/11):text='216p@600k':fontcolor=white:fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-ExtraLight.ttf[data]\"",
                    "-map",
                    "[data]",
                    "-pix_fmt",
                    "yuv420p",
                    "-c:v",
                    "libx264",
                    "-deblock",
                    "1:0",
                    "-profile:v",
                    "high",
                    "-preset",
                    "veryfast",
                    "-level",
                    "2.0",
                    "-crf",
                    "18",
                    "-maxrate",
                    "600k",
                    "-bufsize",
                    "1200k",
                    "-force_key_frames",
                    "\"expr:gte(t,n_forced*5)\"",
                    "-sc_threshold",
                    "40",
                    "-acodec",
                    "libfdk_aac",
                    "-ab",
                    "128000",
                    "-ar",
                    "48000",
                    "-ac",
                    "2",
                    "-profile:a",
                    "aac_low",
                    "-metadata:s:a:0",
                    "language=eng",
                    "AudioVideo.mp4"
                ]
            }
        },
        {
            "tool": "storage:put",
            "parameters": {
                "location": "s3://{com-castlabs-vtk-test-access-keys}@com.castlabs.vtk.test/OUT/encoding-transcode_cropdetect_{job_id}",
                "files": [
                    "AudioVideo.mp4"
                ]
            }
        }
    ]
}