AttributeError: Module ‘FFmpeg’ Has No Attribute ‘Input’ | Fast Fix Steps

The error AttributeError: module ‘ffmpeg’ has no attribute ‘input’ usually means the wrong ffmpeg package or import is in use, not ffmpeg-python’s API.

What This Attributeerror Message Tells You

When Python shows AttributeError: module 'ffmpeg' has no attribute 'input', it is saying that the ffmpeg module that your code imports does not expose a function called input. The message does not come from the FFmpeg command-line tool; it comes from the Python module that happens to be named ffmpeg in your environment.

The ffmpeg-python project is the one that provides the familiar pattern ffmpeg.input('file.mp4'). If your code calls ffmpeg.input and you get this AttributeError, Python is importing a different package with the same name, or it is importing your own file instead of the third-party library.

In many cases, the active package is ffmpeg or python-ffmpeg, not ffmpeg-python. These packages use a different API and do not define input, so the attribute lookup fails. A second common pattern is a script named ffmpeg.py that shadows the real package in the same directory.

Why AttributeError: Module ‘FFmpeg’ Has No Attribute ‘Input’ Appears

The string AttributeError: Module 'FFmpeg' Has No Attribute 'Input' shows up most often in three situations. Each one changes what Python imports when your code runs, so the ffmpeg name no longer points at the binding from ffmpeg-python.

  • Wrong package installed — The environment has the ffmpeg or python-ffmpeg package instead of ffmpeg-python, so the expected input function is missing.
  • Conflicting packages — Both ffmpeg and ffmpeg-python are present, and Python resolves the plain import ffmpeg to the first one it finds on sys.path.
  • Name shadowing in your codebase — A local file, package, or variable named ffmpeg gets imported instead of the third-party library, so attribute access hits the wrong object.

Once you treat these three areas as a checklist, the error stops feeling random. You confirm which package is active, clean out the ones that do not match the ffmpeg-python API, and remove naming collisions in your project tree.

Attributeerror Ffmpeg Has No Input Attribute Fix Steps

The reliable fix for attributeerror ffmpeg has no input attribute follows a short path. First you verify what is installed, then you remove packages that clash with ffmpeg-python, and finally you install the correct binding and confirm that imports reach it. The process is repeatable across virtual environments, containers, and local setups.

You also need a quick scan for project files that might hide the library. A single ffmpeg.py next to your script is enough to trigger the error. Once these pieces are in order, the call ffmpeg.input('video.mp4') works as expected, and the AttributeError disappears.

Check Your Installed Ffmpeg Packages

Start by asking Python which ffmpeg-related packages are present. Use a terminal in the same environment that runs your code. That might be a virtual environment, a Conda env, a Docker image, or the base interpreter on your machine.

  • List installed packages — Run pip list or pip3 list and scan for ffmpeg, python-ffmpeg, and ffmpeg-python.
  • Inspect specific packages — Use pip show ffmpeg and pip show ffmpeg-python to see which one is active and where it lives on disk.
  • Repeat inside tools — In a notebook or REPL that triggers the error, run the same commands so you confirm that both views refer to the same environment.

Once you know what is installed, remove the packages that do not match ffmpeg-python. That avoids a situation where Python imports a different module with the same name and gives you the AttributeError again.

  • Uninstall plain ffmpeg package — Run pip uninstall ffmpeg until it reports that the package is not installed.
  • Uninstall python-ffmpeg — Run pip uninstall python-ffmpeg if it appears in your package list.
  • Reinstall ffmpeg-python cleanly — Run pip uninstall ffmpeg-python once, then pip install ffmpeg-python in the same environment.

The goal is a clean state where the only ffmpeg binding in your environment is ffmpeg-python. At that point, the ffmpeg module that Python imports should match the project that defines input, output, and related stream helpers.

Quick Reference Table For Common Ffmpeg Python Problems

Symptom Likely Cause Command To Try
module 'ffmpeg' has no attribute 'input' Wrong ffmpeg package on import path pip uninstall ffmpeg python-ffmpeg
No module named 'ffmpeg' ffmpeg-python not installed in this env pip install ffmpeg-python
Error only inside one tool or IDE Code using a different interpreter there Check that tool’s interpreter setting

Avoid Name And Import Conflicts In Your Project

Even with the correct package installed, the module that Python imports under the name ffmpeg might still be wrong. The import system follows the search path, and it prefers local modules over site-packages. That means a file in your project can shadow the real library without any warning.

  • Rename local ffmpeg files — If your project contains a file or package directory named ffmpeg, give it a different name so it no longer masks the third-party binding.
  • Avoid capitalised aliases — Lines such as import ffmpeg as FFmpeg can cause confusion when you later read the error string Module 'FFmpeg' Has No Attribute 'Input'. Stick with a single naming style.
  • Check variable names — Do not reuse ffmpeg as a plain variable before you call ffmpeg.input; that would replace the module reference with another object.

Another subtle trap appears when multiple dependencies bring their own ffmpeg bindings. A package may install its own ffmpeg module that does not match ffmpeg-python’s interface. Cleaning those from the environment, or placing your own environment ahead of system-wide paths, keeps import ffmpeg predictable.

Confirm Which Ffmpeg Module Python Imports

A short diagnostic snippet helps you see exactly which module loads when your code runs. Drop this into a throwaway script or a temporary cell in the same context where the AttributeError appears.

import ffmpeg
import inspect
import os

print("ffmpeg module path:", ffmpeg.__file__)
print("Has input attribute:", hasattr(ffmpeg, "input"))

If the printed path does not sit inside the site-packages directory for ffmpeg-python, or the check reports False, you know that another package or local module is taking over the ffmpeg name. Fix the naming or clean the environment, then run the snippet again until the path and attributes line up with your expectations.

Test Ffmpeg Python With A Minimal Script

After the environment and imports look clean, confirm that ffmpeg-python itself behaves as expected. A small script in an empty folder gives a clear signal. There should be no ffmpeg.py in that folder, and no custom package called ffmpeg.

import ffmpeg

stream = ffmpeg.input("input.mp4")
stream = ffmpeg.output(stream, "output.mp4")

print(stream.compile())

When this script runs, it should print the ffmpeg command line that would run, and it should exit without triggering AttributeError: Module 'FFmpeg' Has No Attribute 'Input'. If the error still shows up at this stage, return to the package list and import checks until the minimal script succeeds.

  • Run the script from a clean folder — Keep only the test script and a sample media file, so there is nothing else that Python might treat as a module.
  • Match interpreter versions — Ensure the interpreter that runs the script is the same one where you installed ffmpeg-python.
  • Repeat inside your main project — Once the minimal script works, move the same import pattern into your real code and compare behaviour.

This step narrows the problem. If ffmpeg-python works in isolation, any remaining AttributeError inside your main application comes from project-specific imports, paths, or packaging, not from the binding itself.

Final Checks For Stable Ffmpeg Python Code

At this point you have a repeatable path from AttributeError to working code. You know how to check the active packages, confirm the origin of the ffmpeg module, and run a minimal script that proves the input function is present. A short checklist helps you keep future projects away from the same trap.

  • Standardise on ffmpeg-python — Use ffmpeg-python as the only ffmpeg binding in each environment that needs the ffmpeg.input style API.
  • Keep names distinct — Avoid naming your own modules, packages, or variables ffmpeg, so the import system always reaches the intended library.
  • Test early in each environment — In new virtual environments or containers, run the minimal script before wiring ffmpeg calls into larger code paths.

When these habits are in place, the message AttributeError: module 'ffmpeg' has no attribute 'input' stops interrupting your work. Instead, ffmpeg-python behaves predictably, media pipelines stay readable, and the same patterns transfer cleanly between projects without surprise breakage.