I have this command that is using a unix pipe
system("curl " . escapeshellarg($flv['dl']) . " | ffmpeg -f flv -i - -f mp3 -ab 320k pipe:1");
what could I do to make the same thing happen in windows?
Thanks
If you are not concerned with performance, the easiest way to port a unix script to windows is by installing cygwin.
It's a Unix API emulation layer over Windows likewise Wine emulates win32 on linux.
You could also download windows version of each command line tools
This approach requires to find specific download url for each tool and sometimes even leads you to compile binary from source code ! It is still reasonable when you only need 2 or 3 tools. But otherwise, it is so uncertain and time consuming that you should only consider when performance or low dependancy deployment is an issue.
system()call implies you're executing this shell statement from some other language... the.suggests perl. Even the Windows command prompt supports pipes, so if you change the above to simply print the commandline, you can try executing the same thing manually from the Windows command prompt. Your real issue may well be gettingcurlandffmpeginstalled and their paths added to your PATH environment variable, without needing to a UNIX-style shell.systemalso just passes the instruction through to the OS's default command interpreter without internally handling the pipe, so it still seems to be a matter of getting curl and ffmpeg installed and in the PATH, without any change to the PHP code necessary....