Skip Menu |

This queue is for tickets about the FFmpeg-Command CPAN distribution.

Report information
The Basics
Id: 58206
Status: resolved
Priority: 0/
Queue: FFmpeg-Command

People
Owner: Nobody in particular
Requestors: boftx [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Fails to find ffmpeg executable and flag handling
Date: Mon, 7 Jun 2010 10:58:26 -0700
To: <bug-ffmpeg-command [...] rt.cpan.org>
From: "Jim Bacon" <boftx [...] hotmail.com>
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
Hi, Thanks for your comment. Could you send me a patch, please? On Mon Jun 07 13:58:37 2010, boftx@hotmail.com wrote: Show quoted text
> I found it necessary to disable the test in "new" since my version of
ffmpeg Show quoted text
> 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 Show quoted text
> 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 Show quoted text
> any) instead of restricting them to a pre-defined list in the code. > > > > Jim Bacon > > >
Show quoted text
> I think there should be a means to pass any option (and associated
value, if Show quoted text
> any) instead of restricting them to a pre-defined list in the code.
You can pass any options like this. $ffmpeg->options( '-y', '-f' => 'image2', '-pix_fmt' => 'jpg', '-vframes' => 1, '-ss' => 30, '-s' => '320x240', '-an', ); Please see the SYNOPSIS. http://search.cpan.org/~mizzy/FFmpeg-Command/lib/FFmpeg/Command.pm#SYNOPSIS
Subject: RE: [rt.cpan.org #58206] Fails to find ffmpeg executable and flag handling
Date: Tue, 8 Jun 2010 01:34:23 -0700
To: <bug-FFmpeg-Command [...] rt.cpan.org>
From: "Jim Bacon" <boftx [...] hotmail.com>
I must be blind, I just read the code and docs again, and saw the "options" method. I thought I saw something like that when I first them, but then didn't see it when I needed it for the -sameq option. Please disregard my comment about specifying options directly, you already have it. I'm still checking why the test in "new" fails. 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 > > >
Subject: RE: [rt.cpan.org #58206] Fails to find ffmpeg executable and flag handling
Date: Tue, 8 Jun 2010 01:54:17 -0700
To: <bug-FFmpeg-Command [...] rt.cpan.org>
From: "Jim Bacon" <boftx [...] hotmail.com>
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 > > >
Subject: RE: [rt.cpan.org #58206] Fails to find ffmpeg executable and flag handling
Date: Tue, 8 Jun 2010 01:59:35 -0700
To: <bug-FFmpeg-Command [...] rt.cpan.org>
From: "Jim Bacon" <boftx [...] hotmail.com>
I just ran a quick test with a non-existent path to ffmpeg, here are the results: # ./testffmpeg.pl exval: 32512 child exited with value 127 So you might need to accept a return of "0" or "1", and anything else would indicate the executable can not be found. In any event, according to the perl docs you should be testing $? Instead of the direct return value from "system". http://perldoc.perl.org/functions/system.html 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 > > >
I see that older version of ffmpeg returns exit code 1 instead of 0. So I will fix my module to accept "1". Thanks. On Tue Jun 08 04:59:48 2010, boftx@hotmail.com wrote: Show quoted text
> I just ran a quick test with a non-existent path to ffmpeg, here are > the results: > > # ./testffmpeg.pl > exval: 32512 > child exited with value 127 > > So you might need to accept a return of "0" or "1", and anything else > would indicate the executable can not be found. > > In any event, according to the perl docs you should be testing $? > Instead of the direct return value from "system". > http://perldoc.perl.org/functions/system.html > > > Jim > > > > -----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 > > > > > >
> > > >
Now I've fixed and uploaded to CPAN as version 0.15. Please check it. Thanks.
Subject: RE: [rt.cpan.org #58206] Fails to find ffmpeg executable and flag handling
Date: Tue, 8 Jun 2010 09:14:08 -0700
To: <bug-FFmpeg-Command [...] rt.cpan.org>
From: "Jim Bacon" <boftx [...] hotmail.com>
That fixed it, installed clean. Thanks! Jim Show quoted text
-----Original Message----- From: Gosuke Miyashita via RT [mailto:bug-FFmpeg-Command@rt.cpan.org] Sent: Tuesday, June 08, 2010 3: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 > Now I've fixed and uploaded to CPAN as version 0.15. Please check it. Thanks.
Thanks for your report very match.I close this ticket.