[Gllug] Command line tool to find video dimensions?
Nix
nix at esperi.org.uk
Sat Jun 2 17:45:09 UTC 2007
On 1 Jun 2007, salsaman at xs4all.nl uttered the following:
> open MPLAYER, '$mplay_command -identify -v -vo null -ao null -frames 0
> \"$file\" 2>/dev/null </dev/null |';
You want an
or die "can't run mplayer: $!"
on the end of that.
You also probably don't want to throw stderr away, and the stdin
redirection is a bit of a waste of time.
You also also don't want to do $-interpolation inside single quotes, as
these suppress variable interpolation.
If you want to do complex redirections, look at IPC::Run, which lets you
do things like bidirectional piping, redirection through ptys, and so
forth.
--
`On a scale of one to ten of usefulness, BBC BASIC was several points ahead
of the competition, scoring a relatively respectable zero.' --- Peter Corlett
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list