Jump to content

FFMPEG PHP how


ala888

Recommended Posts

oftentimes, php users will execute ffmpeg in shell alongside a series of variables to designate a specific action that the individual wants to perform. However, I am not quite able to grasp the idea of how ffmpeg grabs the variables passed to it from shell? Is it because it contains inset capability of this? if so, could someone point me to what this type of C++/C programming feature is? Or rather, if its a capability of shell, could someone explain that to me?

 

 

ffmpeg -i in.avi -codec:v libvpx -quality good -cpu-used 0 -b:v 500k -qmin 10 -qmax 42 -maxrate 500k -bufsize 1000k -threads 4 -vf scale=-1:480 -an out.webm

 

like how does ffmpeg grab all these variables from shell?

Link to comment
Share on other sites

It's merely another language. this is command line code, cprompt, DOS. you could open up your command prompt in Windows start menu, set the current directory (the "CD" command) to where ffmpeg is and use the code you just posted. The prompt will know that you are sending a command to the file "ffmpeg" and the flags (delimited via the "-" symbol) will parse out all the variables included.

Link to comment
Share on other sites

each program has their own flags, you can run [program's name] /? or [program's name] /help in cprompt and it will list out all the flags the program can respond to. if you also include the flag then dos should print out some useful description about the flag

Link to comment
Share on other sites

Is it possible to add additional flags to existing programs? say to bypass the GUI for automation purposes? Or is this pointless if I dont have access to the source code and there is no inbuilt support for flags

Link to comment
Share on other sites

Linux shells have several options of their own, for example you can pipe output to a file or somewhere else other than the console, or you can use a file as input for when the program expects input. As far as a writing your own program that checks for command line arguments, in C the number of arguments and the values are passed to the main loop. They are commonly referred to as argc and argv.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...