Skip to content

Instantly share code, notes, and snippets.

@keima
Last active June 1, 2025 17:27
Show Gist options
  • Select an option

  • Save keima/6649966090f732882ac0787abab6a72c to your computer and use it in GitHub Desktop.

Select an option

Save keima/6649966090f732882ac0787abab6a72c to your computer and use it in GitHub Desktop.
module.exports = async (args) => {
var outputNumber = 1;
if (Array.isArray(args?.inputFileObj?.ffProbeData?.streams)) {
if (
args.inputFileObj.ffProbeData.streams
.filter((stream) => stream.codec_type === 'audio')
.length > 1
) {
outputNumber = 2;
}
} else {
throw new Error('File has no stream data');
}
return {
outputFileObj: args.inputFileObj,
outputNumber,
variables: args.variables,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment