Here is the info on my version of ffmpeg. I always get an exit value of "1", which causes "new" to fail.
root@fhs4:/Sites/reboundrevenge.com/bin# ffmpeg -version
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-libmp3lame
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jun 5 2010 11:09:32, gcc: 4.0.3
ffmpeg SVN-rUNKNOWN
libavutil 3212288
libavcodec 3352580
libavformat 3345409
root@fhs4:/Sites/reboundrevenge.com/bin# echo $?
1
I simply disabled your test to make it work.
if ( 0 && (system("$self->{ffmpeg} -version > /dev/null 2>&1") != 0) ) {
carp "Can't find ffmpeg command.";
exit 0;
}
And here is a simple test script to see what perl sees and the output from it:
root@fhs4# cat testffmpeg.pl
#!/usr/bin/perl
use strict;
use Carp;
use FFmpeg::Command;
my $fname = 'carmellabj.mpg';
#my $ffmpeg = FFmpeg::Command->new('/usr/bin/ffmpeg');
my $exval =system("/usr/bin/ffmpeg -version > /dev/null 2>&1");
print "exval: $exval\n";
if ($? == -1) {
print "failed to execute: $!\n";
}
elsif ($? & 127) {
printf "child died with signal %d, %s coredump\n",
($? & 127), ($? & 128) ? 'with' : 'without';
}
else {
printf "child exited with value %d\n", $? >> 8;
}
exit;
__END__
root@fhs4# ./testffmpeg.pl
exval: 256
child exited with value 1
root@fhs4#
I don't know if this is new in ffmpeg or what, but that test in "new" will never succeed, at least on my machines.
Jim
Show quoted text-----Original Message-----
From: Gosuke Miyashita via RT [mailto:bug-FFmpeg-Command@rt.cpan.org]
Sent: Tuesday, June 08, 2010 1:23 AM
To: boftx@hotmail.com
Subject: [rt.cpan.org #58206] Fails to find ffmpeg executable and flag handling
<URL:
https://rt.cpan.org/Ticket/Display.html?id=58206 >
Hi, Thanks for your comment.
Could you send me a patch, please?
On Mon Jun 07 13:58:37 2010, boftx@hotmail.com wrote:
> I found it necessary to disable the test in "new" since my version of
ffmpeg
> always returns a value with the -version switch, thus preventing the "new"
> method from succeeding.
>
>
>
> Also, I added a tweak to the options handling code so I could pass in the
> "-sameq" option. Since this is a flag with no params, I simply added
a test
> for that name and pushed the single value on the array instead of a
> key,value pair.
>
>
>
> I think there should be a means to pass any option (and associated
value, if
> any) instead of restricting them to a pre-defined list in the code.
>
>
>
> Jim Bacon
>
>
>