← Back to projects
PROJECT / 08Personal lab
Media processing recipes
Reproducible export settings with FFmpeg.
WEB PROTOTYPE
Select a profile to generate an example command. This page does not execute commands or convert video.
Sample recipe
The command is not executed. The output file is named output.
View concept code
export function recipe(file, profile) {
if (!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,69}$/.test(file)) throw Error('Invalid filename');
const presets = {
web: '-vf "scale=-2:720" -c:v libx264 -crf 23 -c:a aac -movflags +faststart output.mp4',
archive: '-vf "scale=-2:1080" -c:v libx264 -crf 18 -c:a aac output.mp4',
audio: '-vn -c:a libmp3lame -q:a 2 output.mp3',
};
if (!presets[profile]) throw Error('Invalid preset');
return `ffmpeg -n -i "${file}" ${presets[profile]}`;
}