I am trying to figure the best way to login via php command to a remote server and run a command to convert a FLV file into an MP3 (and then possibly moving it to the local server)?
I can always move the file later but I need to do it in this order as the remote server hosts ffmpeg.
Using this will do it locally:
exec(ffmpeg -i vid.flv -acodec copy output.mp3);
How can I do it remotely?
Thanks!
You need to do the following in order
if you send your file to the server via ftp, and then create a script on the server that you have just transferred the file to, you can ping the script with the hash code for the file, and tell it to convert.
the conversion script would take a file name, and then look in the local directory for the file, when it finds it, it will convert.
if you wish for the local server to know when the conversion is completed then you would also have to send an id to the conversion script and you would store that id both sides, so the server can ping back to your local script (WARNING!) with the id and you can fetch it back from server.
The reason for the warning is because its hard to get a server to ping threw to your localhost if your behind a router / firewall you would have to set up port forwarding etc on router and allow port 80 to be accessed externally.
hope this gives you some clue on how to handle this situation.