Belgin Fish
Belgin Fish

Reputation: 19837

Have a Unix command/script work on windows?

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

Upvotes: 2

Views: 312

Answers (2)

Frederic Bazin
Frederic Bazin

Reputation: 1529

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

  • see Curl download provide several windows version binary ( don t take the cygwin version.
  • Note that ffmpeg is only available as nightly build for windows. No stable release compiled.

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.

Upvotes: 4

anilmwr
anilmwr

Reputation: 477

Sending the file downloaded by curl to ffmpeg by pipe is the best way, I think.

curl "http://domain.com/file.flv" | ffmpeg -f flv -i - -f mp3 -ab 320k pipe:1

curl & ffmpeg are available for windows.

Upvotes: 0

Related Questions