--- name: Convert Video description: Convert video between containers through av-club — copying streams when the codec already fits, re-encoding when it does not. category: Video version: 1 mode: script language: typescript inline: ask args: - file_path inputs: file_path: type: string description: A video file, or a folder to convert recursively. target_format: type: string default: mp4 options: [mp4, mkv, webm, mov] description: Container to convert to. delete_source: type: boolean default: false description: Delete each source file once its conversion has been written. trigger: - type: file extensions: [mp4, mkv, webm, mov, avi, wmv, flv, m4v, mpg, mpeg, m2ts, mts, 3gp, ogv, vob, divx, asf, f4v] - type: directory --- # Convert Video Writes the result **beside the original** — `film.mkv` becomes `film.mp4` in the same folder. **Streams are copied when they can be.** If the video and audio codecs already fit the target container, this is a remux: lossless, and a hundred times faster than re-encoding. Only when a codec does not fit is it re-encoded, at CRF 21 — constant quality, so the bitrate follows how difficult the picture is rather than a number somebody guessed. Resolution and frame rate are never changed. Skips a file already in the target container, and never overwrites an existing output. ## What this does not do yet The version of this on the old machine also picked which audio and subtitle tracks to keep, downmixed surround to stereo, and showed per-file percentage. None of that is here. Those belong with the Jellyfin side of things rather than with basic conversion, and are deliberately left where they are rather than half-ported.