The No such file or directory error that appears out of nowhere when you run FFmpeg is one of the most common stumbling blocks for newcomers — often showing up even though the file is clearly there.

Tested with ffmpeg 6.1


Typical Error Message

input.mp4: No such file or directory

or

/path/to/file.mp4: No such file or directory

Cause 1: The Path Contains Spaces (Most Common)

Symptom

# Wrong — the shell splits the argument at the space
ffmpeg -i My Video.mp4 output.mp4

In this command, My and Video.mp4 are parsed as separate arguments.

How to fix

Wrap in double quotes:

ffmpeg -i "My Video.mp4" output.mp4

Single quotes also work:

ffmpeg -i 'My Video.mp4' output.mp4

On Windows Command Prompt (cmd.exe):

ffmpeg -i "My Video.mp4" output.mp4

Tip: Avoiding spaces in file names is the best defense. Replacing them with underscores (_) or hyphens (-) saves a lot of trouble.


Cause 2: Wrong Working Directory

Symptom

Occurs when the terminal’s current directory differs from the directory containing the file:

# The file is in /home/user/videos/, but you're somewhere else
ffmpeg -i input.mp4 output.mp4
# → input.mp4: No such file or directory

How to fix

Use an absolute path:

ffmpeg -i /home/user/videos/input.mp4 /home/user/videos/output.mp4

cd into the directory first:

cd /home/user/videos/
ffmpeg -i input.mp4 output.mp4

Verify the file location:

# macOS / Linux
ls -la *.mp4

# Windows (PowerShell)
Get-ChildItem *.mp4

Cause 3: Extension Case Mismatch

Symptom

If the actual file is INPUT.MP4 but you specify input.mp4, Linux and macOS will error out because they’re case-sensitive (Windows is not).

# Wrong on Linux/macOS (actual file is INPUT.MP4)
ffmpeg -i input.mp4 output.mp4

How to fix

# Verify the exact file name, then match it
ls -la
ffmpeg -i INPUT.MP4 output.mp4

Cause 4: Output Directory Doesn’t Exist

FFmpeg does not create output directories automatically.

# Wrong — output/ directory doesn't exist
ffmpeg -i input.mp4 output/result.mp4
# → output/result.mp4: No such file or directory

How to fix

# Create the directory first
mkdir -p output
ffmpeg -i input.mp4 output/result.mp4

Diagnostic Flowchart

When "No such file or directory" appears

1. Does the file exist?
   → Check with ls -la or dir

2. Does the file name contain spaces?
   → Wrap in "" if so

3. Check the working directory
   → pwd (Linux/macOS) / cd (Windows)
   → Retry with an absolute path

4. Check case sensitivity (Linux/macOS)
   → Use ls to confirm the exact file name

5. Check the output directory
   → Create it with mkdir -p

Bonus: Windows Path Notes

Windows uses \ as the path separator, but FFmpeg accepts / as well.

# Both work
ffmpeg -i C:\Users\user\video\input.mp4 output.mp4
ffmpeg -i C:/Users/user/video/input.mp4 output.mp4

For UNC paths (network paths), forward slashes sometimes fail. Use backslashes in that case.


Frequently Asked Questions

Spaces in the filename — quoted but still failing

Smart quotes from a doc copy-paste look like normal quotes but are not. Retype the quotes manually in the terminal, or escape spaces with \ instead.

How do I run FFmpeg on a glob pattern?

FFmpeg does not expand globs itself. Either pre-expand with the shell (for f in *.mp4; do ffmpeg -i "$f" ...; done) or use -pattern_type glob -i "*.mp4" for image sequences.

Why does FFmpeg ignore a relative path on Windows?

Windows shell variable expansion plus \ escapes can mangle relative paths. Use forward slashes (/) or full absolute paths to avoid surprises.

Does FFmpeg create the output directory?

No — you must mkdir -p it first. Wrap with a check: mkdir -p "$(dirname "$out")" && ffmpeg ... "$out".

My UNC network path fails on Windows

Forward slashes break for UNC. Use \\server\share\file.mp4 (escaped backslashes) or map to a drive letter first.



Tested with ffmpeg 6.1.1 / Ubuntu 24.04 & Windows 11
Primary source: ffmpeg.org/ffmpeg.html