jackwener/OpenCLI · error · ArgumentError

Unsupported video format: ${ext}

Error message

Unsupported video format: ${ext}

What it means

validateVideoPath only allows extensions in SUPPORTED_VIDEO_EXTENSIONS (currently just .mp4). If the resolved file has another extension it throws ArgumentError with the actual extension and a hint that .mp4 is required. This reflects Instagram's reel upload constraints and the uploader's tested format.

Source

Thrown at clis/instagram/reel.js:27

import { INSTAGRAM_HOME_URL, gotoInstagramHome } from './_shared/navigation.js';
const SUPPORTED_VIDEO_EXTENSIONS = new Set(['.mp4']);
const INSTAGRAM_REEL_TIMEOUT_SECONDS = 600;
function requirePage(page) {
    if (!page)
        throw new CommandExecutionError('Browser session required for instagram reel');
    return page;
}
function validateVideoPath(input) {
    const resolved = path.resolve(String(input || '').trim());
    if (!resolved) {
        throw new ArgumentError('Video path cannot be empty');
    }
    if (!fs.existsSync(resolved)) {
        throw new ArgumentError(`Video file not found: ${resolved}`);
    }
    const ext = path.extname(resolved).toLowerCase();
    if (!SUPPORTED_VIDEO_EXTENSIONS.has(ext)) {
        throw new ArgumentError(`Unsupported video format: ${ext}`, 'Supported formats: .mp4');
    }
    return resolved;
}
function validateInstagramReelArgs(kwargs) {
    if (kwargs.video === undefined) {
        throw new ArgumentError('Argument "video" is required.', 'Provide --video /path/to/file.mp4');
    }
}
function buildInstagramReelSuccessResult(url) {
    return [{
            status: '✅ Posted',
            detail: 'Single reel shared successfully',
            url,
        }];
}
function isRecoverableReelSessionError(error) {
    if (!(error instanceof CommandExecutionError))
        return false;

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Convert the video to MP4 (e.g. ffmpeg -i input.mov -c:v libx264 -c:a aac output.mp4).
  2. Rename only if the container is actually MPEG-4 but mislabeled; otherwise re-encode.
  3. Export/record in MP4 format directly from the source tool.

Example fix

// before
await reel({ video: 'screen-recording.mov' });
// after
// ffmpeg -i screen-recording.mov -c:v libx264 -c:a aac screen-recording.mp4
await reel({ video: 'screen-recording.mp4' });
Defensive patterns

Strategy: validation

Validate before calling

if (path.extname(args.video).toLowerCase() !== '.mp4') throw new Error('Only .mp4 videos are supported; re-encode with ffmpeg');

Try / catch

try { await reel(args); } catch (e) { if (e.message.startsWith('Unsupported video format')) { console.error('Convert to mp4: ffmpeg -i in.<ext> -c:v libx264 -c:a aac out.mp4'); return; } throw e; }

Prevention

When it happens

Trigger: Passing --video with .mov, .avi, .mkv, .webm, .m4v or any non-.mp4 extension (case-insensitive check).

Common situations: Screen recordings exported as .mov (macOS), videos downloaded as .webm/.mkv, or files with uppercase extensions like .MP4 (those pass, since ext is lowercased) — but genuinely non-mp4 containers fail.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/12488bf57924b81f. Report an issue: GitHub.