FFmpeg is not recognized as an internal or external command

Questions involving a Windows version of FFmpeg.
Post Reply
synicade
Posts: 3
Joined: Wed Nov 02, 2011 4:32 am

FFmpeg is not recognized as an internal or external command

Post by synicade » Wed Nov 02, 2011 4:41 am

Meh, I keep getting this error every time I try to do something when I open the FFmpeg.exe folder.
"FFMPEG is not recognized as an internal or external command, operable program or batch file.".
Note that I DO so the FFmpeg menus, info, "use -h to get help" and so on. The problem appears every time I try to run a command.

Also, I cannot seem to run ffmpeg outside of the folder containing the FFmpeg.exe file.
I came over from Linux not that long ago, and I'm pretty sure there is an easy fix, but it's something so obvious that no one ever bothers to post/talk about it.

All I did was download the Static Win 64 build, and try to run it. Is there anything else I'm missing? Thank you very much!

Nologic
Posts: 82
Joined: Mon Aug 15, 2011 4:47 am

Re: FFmpeg is not recognized as an internal or external comm

Post by Nologic » Mon Nov 07, 2011 9:33 pm

Okay this is one of those fundamental differences between Nix & Win...with Nix based OS's nearly all executable's are placed in ether /Bin or /User/Bin and are accessible everywhere by terminal/console applications.

With Win based OS's this is not the case...executable's are thrown all over the place...and the only two places where executable's are naturally executable by terminal/console applications are in /Windows and /System32...nether of which you want to toss stuff into typically because of how libraries and other resources are handled.

Given that you are using a static build of FFMpeg you could toss it into /Windows or /System32...but if you were to use a shared build...or pipe into other terminal/console applications you would likely be better off putting FFMpeg into the /Program Files/ folder.

While executables placed in the /Program Files/ folder are not directly accessible from terminals...you can add them to the registry under "App Paths" to allow them to be called.

Now you can run RegEdit and make the changes yourself or you can use a Reg file to make the changes...under Vista & Win7 you'll need to have Admin privileges to make changes to the Registry in ether case.

Sample Reg file:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\FFMpeg.exe]
@="C:\\Program Files\\FFMpeg\\FFMpeg.exe"
"Path"="C:\\Program Files\\FFMpeg"
If you use the Reg file be sure the pathing is correct for your system...and that you use two backslashes rather than the typical single backslash to denote folder structure.

There are probably a few other ways to allow you to call FFMpeg from anywhere...but this is what I recommend.

Now I think Win7 added accessing the console via the right click context menu...but in all others one needs to ether make Registry edits or use a Shell Extension...I personally prefer this Shell Extension when on a system that doesn't run Directory Opus as it's File Manager.

ContextConsole Shell Extension

Or here is the Reg Files -

Normal:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Shell\Command Console]
@="Command Console Here"

[HKEY_CLASSES_ROOT\Directory\Shell\Command Console\Command]
@="cmd.exe /t:1E /k \"pushd %L && title Command Console\""

[HKEY_CLASSES_ROOT\Drive\Shell\Command Console]
@="Command Console Here"

[HKEY_CLASSES_ROOT\Drive\Shell\Command Console\Command]
@="cmd.exe /t:1E /k \"pushd %L && title Command Console\""
As Admin:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Shell\Runas]
@="Open Command Console Here (Admin)"

[HKEY_CLASSES_ROOT\Directory\Shell\Runas\Command]
@="cmd.exe /t:4E /s /k \"pushd %L && title Command Console (Admin)\"" 

[HKEY_CLASSES_ROOT\Drive\Shell\Runas]
@="Open Command Console Here (Admin)"

[HKEY_CLASSES_ROOT\Drive\Shell\Runas\Command]
@="cmd.exe /t:4E /s /k \"pushd %L && title Command Console (Admin)\""
Keep in mind that Reg files...must have the file extension ".reg" and can be created in Notepad...as they are just typical ASCII text files.

Once created simply right click on them...and in the context menu you should see an entry to Merge...select Merge and in a second the change should be applied and be ready to be used.


*Update 1* !!!DOH!!!
======================================
I forgot to mention that once you've done this simply referencing FFMpeg won't make it work....when in the console type:

Start FFMpeg -i .\Input.avi -c copy .\Output.avi

You must use the Start command to make it work as expected.

*Update 2*
======================================
Okay did up some minor AutoIt app's to make this stuff a breeze. (may or may not work with vista & win7)

[Linky]

Download and extract anywhere...but keep in mind they will be staying wherever for a while.

Next double click on each one you want to use...this will cause the executable's to create shortcuts in your UserProfile/SendTo/ folder, which is how these are meant to be used.

These are fairly straight forward they ether add or remove a path in one of three area's.

Application Path:
Which typically requires the DOS command Start to execute the application from the Console but will run directly from the Run Dialog.

User Environment Path:
This allows the application to be executed only from the User Account it was added to via the Console or Run Dialog with no DOS Start command needing to be used. Note this can slow down the loading of a User Profile if a lot of paths are added.

System Environment Path:
This allows the application to be executed from Any Account via the Console or Run Dialog with no DOS Start command needing to be used. Note this can slow down the loading of whole System if a lot of paths are added.

With User & System if a Folder is selected then the path to and including that folder is added...if a file inside a folder is selected then the path to the Parent folder is added.

With Application...a EXE must be selected bar none.

Additional Notes....User values being added require the user to Log Out and then Log In before they will take effect. System values require a reboot to take effect.

Note these are HUGE for what they are...maybe Zeranoe will code up something in C or C++ that is MUCH smaller...that said source code is included for those that want to tinker around with AutoIt.

synicade
Posts: 3
Joined: Wed Nov 02, 2011 4:32 am

Re: FFmpeg is not recognized as an internal or external comm

Post by synicade » Mon Nov 14, 2011 8:17 am

Ahhh, thank you so much!
Seems kind of backwards, but in Linux, everything is done for me, haha
I'll try it out now, I'll be back with an update soon :)

synicade
Posts: 3
Joined: Wed Nov 02, 2011 4:32 am

Re: FFmpeg is not recognized as an internal or external comm

Post by synicade » Thu Nov 17, 2011 3:06 am

Ahhh thanks a lot again! It worked!
Sadly, I still can't quite work with FFMpeg since I can't stand cmd.exe, but I'll get use to it eventually, thanks again! I'm gonna save your reply as a .txt for future reference

Nologic
Posts: 82
Joined: Mon Aug 15, 2011 4:47 am

Re: FFmpeg is not recognized as an internal or external comm

Post by Nologic » Thu Nov 17, 2011 5:54 am

You are most welcome.

Well you don't have to use CMD...as there are others out there.

PowerShell
Take Command & TCC/LE
WinBash
Console
PowerCMD
PromptPal

There are probably others as well...the above list shouldn't be treated as a complete by any means.

Oh here is a handy site for some cool tips on all command lines....and another.

Windows Command Line Reference

Basic DOS Tutorial

Most of the above you'll likely never need...but it's good reference material.

One Shell Extension I make heavy use of while working with the command line is FileMenu Tools as it offers several useful tools...but mainly I make use of the copy File Path menu item...so that I can paste it into the Console. Since I mover around more with my File Manager rather than through the Console.

Anyways that will likely keep you side tracked for a while. :p

hehe catch you later.

dcaebo
Posts: 1
Joined: Sun Jul 08, 2018 1:21 pm

Re: FFmpeg is not recognized as an internal or external command

Post by dcaebo » Sun Jul 08, 2018 1:39 pm

Say, for the sake of this example your ffmpeg.exe is installed in "d:\ffmpeg\bin\"
Navigate to that folder and shift-rightclick somewhere in that folder. You'll get a menu; start PowerShell.

Then type:

d:\ffmpeg\bin\ffmpeg.exe -i examplemovie.mp4 -argument1 -argument2 etc

Note that, for this example, the inputfile "examplemovie.mp4" should reside in the same folder for this to work.

Post Reply