120 lines
3.9 KiB
JavaScript
120 lines
3.9 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.parseCommandLineArgs = parseCommandLineArgs;
|
|
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
const helpers_1 = require("yargs/helpers");
|
|
/**
|
|
* Parse command line arguments
|
|
*/
|
|
function parseCommandLineArgs() {
|
|
const parsed = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
.usage('Usage: $0 <video_file_path> [options]')
|
|
.positional('video_file_path', {
|
|
describe: 'Path to the input video file',
|
|
type: 'string'
|
|
})
|
|
.option('captureIntervalSeconds', {
|
|
alias: 'i',
|
|
describe: 'Interval in seconds between frame captures',
|
|
type: 'number'
|
|
})
|
|
.option('contextWindowSize', {
|
|
alias: 'c',
|
|
describe: 'Number of frames to keep in context',
|
|
type: 'number'
|
|
})
|
|
.option('visionProvider', {
|
|
describe: 'Provider to use for vision AI',
|
|
type: 'string'
|
|
})
|
|
.option('visionModel', {
|
|
describe: 'Model to use for vision AI',
|
|
type: 'string'
|
|
})
|
|
.option('ttsProvider', {
|
|
describe: 'Provider to use for text-to-speech',
|
|
type: 'string'
|
|
})
|
|
.option('ttsModel', {
|
|
alias: 'm',
|
|
describe: 'TTS model to use',
|
|
type: 'string'
|
|
})
|
|
.option('ttsVoice', {
|
|
alias: 'v',
|
|
describe: 'Voice to use for text-to-speech',
|
|
type: 'string'
|
|
})
|
|
.option('ttsSpeedFactor', {
|
|
alias: 's',
|
|
describe: 'Speed factor for the audio playback',
|
|
type: 'number'
|
|
})
|
|
.option('ttsInstructions', {
|
|
describe: 'Instructions for TTS voice style (gpt-4o-mini-tts)',
|
|
type: 'string'
|
|
})
|
|
.option('outputDir', {
|
|
alias: 'o',
|
|
describe: 'Directory for output files',
|
|
type: 'string'
|
|
})
|
|
.option('tempDir', {
|
|
alias: 't',
|
|
describe: 'Directory for temporary files',
|
|
type: 'string'
|
|
})
|
|
.option('batchTimeMode', {
|
|
alias: 'b',
|
|
describe: 'Use batch time mode for processing',
|
|
type: 'boolean'
|
|
})
|
|
.option('batchWindowDuration', {
|
|
describe: 'Duration in seconds for each batch window',
|
|
type: 'number'
|
|
})
|
|
.option('framesInBatch', {
|
|
describe: 'Number of frames to capture within each batch',
|
|
type: 'number'
|
|
})
|
|
.option('defaultPrompt', {
|
|
describe: 'Prompt for describing individual frames',
|
|
type: 'string'
|
|
})
|
|
.option('changePrompt', {
|
|
describe: 'Prompt for describing changes between frames',
|
|
type: 'string'
|
|
})
|
|
.option('batchPrompt', {
|
|
describe: 'Prompt for describing batches of frames',
|
|
type: 'string'
|
|
})
|
|
.option('estimate', {
|
|
alias: 'e',
|
|
describe: 'Only estimate the cost without generating the audio description',
|
|
type: 'boolean',
|
|
default: false
|
|
})
|
|
.option('config', {
|
|
alias: 'f',
|
|
describe: 'Path to JSON config file',
|
|
type: 'string'
|
|
})
|
|
.option('saveConfig', {
|
|
describe: 'Save current configuration to specified JSON file',
|
|
type: 'string'
|
|
})
|
|
.help()
|
|
.alias('help', 'h')
|
|
.example('$0 video.mp4', 'Process a video with default settings')
|
|
.example('$0 video.mp4 --ttsVoice nova --visionProvider openai', 'Process with custom voice and vision provider')
|
|
.example('$0 video.mp4 --estimate', 'Only estimate the processing cost')
|
|
.example('$0 video.mp4 --config myconfig.json', 'Use settings from a config file')
|
|
.example('$0 video.mp4 --saveConfig myconfig.json', 'Save current settings to a config file')
|
|
.argv;
|
|
return parsed;
|
|
}
|
|
//# sourceMappingURL=args.js.map
|