FFmpeg often reports No such file or directory even when the file is clearly there.
Typical Error Message
[in#0 @ 000001889ddd7a80] Error opening input: No such file or directory
Error opening input file input.mp4.
Error opening input files: No such file or directory
FFmpeg 6.0 and earlier print a single line with the path instead, such as input.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
The shell passes My and Video.mp4 as two separate arguments, so FFmpeg looks for a file called My.
How to fix
Put the path 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: File names without spaces avoid this problem. Use underscores (
_) or hyphens (-) instead.
Cause 2: Wrong Working Directory
Symptom
The terminal’s current directory (the folder it is working in) is not the one that holds the file:
# The file is in /home/user/videos/, but you're somewhere else
ffmpeg -i input.mp4 output.mp4
# → Error opening input: No such file or directory
How to fix
Use the full (absolute) path:
ffmpeg -i /home/user/videos/input.mp4 /home/user/videos/output.mp4
Or cd into that directory first:
cd /home/user/videos/
ffmpeg -i input.mp4 output.mp4
Check where the file is:
# macOS / Linux
ls -la *.mp4
# Windows (PowerShell)
Get-ChildItem *.mp4
Cause 3: Extension Case Mismatch
Symptom
If the file is called INPUT.MP4 but you type input.mp4, Linux fails because its file names are case-sensitive. Windows and macOS (with its default disk format) are not.
# Wrong on Linux (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 a missing output directory for you.
# Wrong — output/ directory doesn't exist
ffmpeg -i input.mp4 output/result.mp4
# → Error opening output 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, PowerShell) / cd (Command Prompt)
→ Retry with an absolute path
4. Check case sensitivity (Linux)
→ Use ls to confirm the exact file name
5. Check the output directory
→ Create it with mkdir -p
Bonus: Windows Path Notes
Windows separates folders with \, but FFmpeg accepts / too.
# Both work
ffmpeg -i C:\Users\user\video\input.mp4 output.mp4
ffmpeg -i C:/Users/user/video/input.mp4 output.mp4
Network (UNC) paths work with either slash too: \\server\share\input.mp4 or //server/share/input.mp4.
What to Expect
On Windows, converting My Video.mp4 on the Desktop fails with the same error if your shell is in a different working directory. In PowerShell, first check that the file exists:
Test-Path "C:\Users\user\Desktop\My Video.mp4"
If it returns True, give FFmpeg the same absolute path, in quotes:
ffmpeg -i "C:\Users\user\Desktop\My Video.mp4" "C:\Users\user\Desktop\out.mp4"
FFmpeg opens both the input and the output before it starts processing. A wrong path, a missing output folder or a permission problem fails immediately, even for a 2-minute video. If the command runs for a while and then fails, check the free disk space or the network storage instead.
Frequently Asked Questions
Spaces in the filename — quoted but still failing
Quotes copied from a document are often curly “smart quotes”. They look like normal quotes but are different characters. Retype the quotes in the terminal. In bash and zsh you can instead escape each space with \.
How do I run FFmpeg on a glob pattern?
FFmpeg does not expand wildcards such as * itself. Let the shell expand them in a loop (for f in *.mp4; do ffmpeg -i "$f" ...; done). For a set of image files, -pattern_type glob -i "*.png" also works, but Windows builds usually don’t support it.
Why does a relative path with \ fail on Windows?
In Command Prompt and PowerShell, \ is an ordinary path separator. Git Bash, MSYS2 and WSL read \ as an escape character, so an unquoted videos\input.mp4 becomes videosinput.mp4. There, use forward slashes (/) or put the path in quotes.
Does FFmpeg create the output directory?
No. Create it first with mkdir -p. In a script you can do both in one line: mkdir -p "$(dirname "$out")" && ffmpeg ... "$out".
My UNC network path fails on Windows
UNC paths work with backslashes (\\server\share\file.mp4) or forward slashes (//server/share/file.mp4). Command Prompt and PowerShell don’t need the backslashes escaped. If it still fails, map the share to a drive letter first.
Related Articles
Primary source: ffmpeg.org/ffmpeg.html