NeoQuarZ:~Archetype
EN ⇄ ES
← Back to projects

Media processing recipes

Reproducible export settings with FFmpeg.

FFmpegPython
WEB PROTOTYPE

Select a profile to generate an example command. This page does not execute commands or convert video.

ffmpeg.recipeREFERENCE / NO EXECUTION

Use a simple filename without spaces or paths.

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]}`;
}

To turn this into a production application

Create a job queue, validate files and add error logs and output checks.

Talk about this project ↗
NEOQUARZ / ARCHETYPE~/projects/media-pipeline0%