Simer Simer - 2 months ago 16
PHP Question

which path should be given in shell comand? relative path or diretcory path?

For eg: I am executing a shell command:

"ffmpeg -i input.flv -ss 00:00:14.435 -vframes 1 out.png"


here input.flv path should be like -> images\input.flv or D:\wamp\www\proj_name\public\images\input.flv ?

Answer

This depends on your current working directory. Generally speaking giving absolute paths is better as they are not ambiguous.

If your path is relative to your working directory (where you call the PHP script) it will work. However sometimes in production that value changes, leading to weird errors. If you can generate an absolute path somehow (e.g. through realpath()) it is preferred.

Comments