why ffmpeg command producing error in Ubuntu terminal?

6,114

Solution 1

The path /usr/local/bin/ indicates, that you have installed a custom version of ffmpeg. The version you have installed with apt-get install is located at /usr/bin/ (without the "local" part). To execute the version apt-get has installed, run

/usr/bin/ffmpeg

You can remove /usr/local/bin/ffmpeg or mark it as non-exexcutable with sudo chmod -x /usr/local/bin/ffmpeg. Run hash -r so the change takes effect in the current shell. Log out and log back in so that the change takes effect for every graphical application.

As soon as /usr/local/bin/ffmpeg has been treated with one of the above mentioned method, simply calling ffmepg will start the one at /usr/bin/ffmpeg by default.

Edit Added information from @Ramchandra_Apte on how to do this without a complete reboot.

Solution 2

Yeah something isn't quite right here. If you install ffmpeg, its binary is installed to /usr/bin/ffmpeg, not /usr/local/bin/ffmpeg.

So the first assumption I have to make is either:

  • You've installed a non-standard ffmpeg package
  • Something else has included a weird local and broken copy of ffmpeg for some reason.

First see if /usr/bin/ffmpeg will run. If it does, at least you've probably got the proper ffmpeg installed and we can just focus on removing the dud copy. If you don't, you've gone and got yourself a dodgy copy. I'm not you, I don't know what you've done but remove dodgy repositories and generally clean house.

Now let's see if there's a package associated with this /usr/local/bin/ffmpeg version

dpkg -S /usr/local/bin/ffmpeg

That will either tell you it hasn't found anything or it will tell you which package it came from. If there's a package, sudo dpkg -r <package name> and try ffmpeg again.

If there's no package you're left in the unenviable spot of needing to manually remove it. If you've built this from source, you can cd into the source directory and run a sudo make uninstall. If you still claim not to know where this came from you can try a sudo rm /usr/local/bin/ffmpeg but I can't say what effect that may have on other applications if this is something that they've done.

Share:
6,114

Related videos on Youtube

open source guy
Author by

open source guy

Updated on September 18, 2022

Comments

  • open source guy
    open source guy over 1 year

    I installed ffmpeg using this command

    sudo apt-get install ffmpeg
    

    After the installation i tried this command in terminal

    ffmpeg
    

    but i got error message like this

    root@client85-desktop:~# ffmpeg
    bash: /usr/local/bin/ffmpeg: cannot execute binary file
    

    How can i solve this issue?

  • SoothingMist
    SoothingMist over 10 years
    Suggestion a reboot seems a bit overkill, simply opening a new shell should do it, right?
  • Ramchandra Apte
    Ramchandra Apte over 10 years
    @user50849 You don't even need to reboot; simply run hash -r.
  • SoothingMist
    SoothingMist over 10 years
    You mean "don't even need a new shell", I assume? Good to know, I didn't know what the command was to refresh the current environment, so I suggested a new shell, but hash -r is even better. :)