2

I'm a beginner with Ubuntu and I need to setup a streaming server for my company, I've installed NGINX and FFMPEG, but when I call ffmpeg -i in the ~/ffmpeg/ffmpeg directory it returns an error command not found but when I call ./ffmpeg -i it returns a list with configurations.. why does ffmpeg -i not work and how can I fix it?

I think that the Path Enviroment Variable is incorrect but how would I go abouts changing said variable? I'm not that experienced with Ubuntu / CMD programming / FFMPEG configuration.

Sources - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu https://github.com/arut/nginx-rtmp-module/wiki/Control-module and http://docs.unified-streaming.com/tutorials/live/broadcast-247.html#continuous-timestamps

Gerwin
  • 131
  • 1
  • 5
  • What if you do `sudo apt-get install ffmpeg`? Also, you can just add `export PATH=$PATH:/path/to/ffmpeg/executable` into your `~/.profile` or `~/.bash_profile` –  Apr 12 '16 at 14:34
  • I've tried the export PATH=$PATH:/path/to/ffmpeg/executable but it doesn't work :( – Gerwin Apr 12 '16 at 14:35
  • I hope you replaced `/path/to/ffmpeg/executable` with the *actual* path to the `ffmpeg` executable? –  Apr 12 '16 at 14:37
  • Yes I have, I moved this question over from SO – Gerwin Apr 12 '16 at 14:38
  • Try `/path/to/ffmpeg/directory`, as @terdon suggested. –  Apr 12 '16 at 14:42
  • 1
    What Ubuntu version are you using? How did you install `ffmpeg`? If you followed a guide please provide the link. It is likely you will not need to use `export` or edit `~/.profile`, or mess with anything like that. – llogan Apr 12 '16 at 17:44
  • 1
    Possible duplicate of [How to add a directory to my path?](http://askubuntu.com/questions/60218/how-to-add-a-directory-to-my-path) – Dimitri Podborski Apr 24 '16 at 23:47

1 Answers1

2

You need to add the directory where you've installed ffmpeg to your $PATH, the list of directories where executables can be found. The simplest way is to add this line to your ~/.profile:

export PATH="$PATH:$HOME/ffmpeg

Note that you need to add the directory containing the ffmpeg executable and not the executable itself. Then, log out and log back in again (or just run . ~/.profile) and you should be able to execute it from anywhere.

terdon
  • 98,183
  • 15
  • 197
  • 293