Thread: [Ffmpeg-php-user] togdimage() not working on BSD
Brought to you by:
tkirby
From: Scott L. <sl...@io...> - 2005-03-21 19:16:28
|
I'm running the following script on a RH Linux 3ES machine with no problems, however when moving the script to a FreeBSD machine I get this error: [21-Mar-2005 10:58:00] PHP Warning: togdimage(): supplied resource is not a valid Image resource in /usr/local/www/data-dist/ffmpeg/bar.php on line 16 Here is the script I'm testing with: <?php header("Content-type: image/jpeg"); $file = "qt/video.mov"; $movie = new ffmpeg_movie($file); $total = $movie->getFrameCount(); $bitrate = $movie->getBitRate(); $type = $movie->getVideoCodec(); $id = round($total/2); $frame = $movie->getFrame($id); $width = $frame->getWidth($frame); $height = $frame->getHeight($frame); $image = $frame->togdimage(); imagejpeg($image,'',100); ?> The only underlying difference is the OS. Both machines run PHP 4.3.10, ffmpeg 0.4.9p1, and ffmpeg-php 0.4.3, and in both cases ffmpeg-php is built as a dynamic extension. An interesting thing to note is that on the troublesome BSD machine, all the other functions seem to work. It correctly gets the frame count, bit rate, video codec, width and height. -- Scott Larson Network Administrator IOWA LLC T:310.823.8238 F:310.823.7108 E: su...@io... www.iowalab.com |
From: Rob C. <ro...@ma...> - 2005-03-21 20:08:50
|
I assume you're using the same version of libavcodec and/or libavformat since you're using ffmpeg 0.4.9p1 on both machines. One thing I could think of is that your video.mov has it's headers compressed with zlib. Make sure that ffmpeg is compiled with zlib support. Could you give us a link to the file you tested with (video.mov) ? -ROB -----Original Message----- From: ffm...@li... [mailto:ffm...@li...] On Behalf Of Scott Larson Sent: maandag 21 maart 2005 20:16 To: ffm...@li... Subject: [Ffmpeg-php-user] togdimage() not working on BSD I'm running the following script on a RH Linux 3ES machine with no problems, however when moving the script to a FreeBSD machine I get this error: [21-Mar-2005 10:58:00] PHP Warning: togdimage(): supplied resource is not a valid Image resource in /usr/local/www/data-dist/ffmpeg/bar.php on line 16 Here is the script I'm testing with: <?php header("Content-type: image/jpeg"); $file = "qt/video.mov"; $movie = new ffmpeg_movie($file); $total = $movie->getFrameCount(); $bitrate = $movie->getBitRate(); $type = $movie->getVideoCodec(); $id = round($total/2); $frame = $movie->getFrame($id); $width = $frame->getWidth($frame); $height = $frame->getHeight($frame); $image = $frame->togdimage(); imagejpeg($image,'',100); ?> The only underlying difference is the OS. Both machines run PHP 4.3.10, ffmpeg 0.4.9p1, and ffmpeg-php 0.4.3, and in both cases ffmpeg-php is built as a dynamic extension. An interesting thing to note is that on the troublesome BSD machine, all the other functions seem to work. It correctly gets the frame count, bit rate, video codec, width and height. -- Scott Larson Network Administrator IOWA LLC T:310.823.8238 F:310.823.7108 E: su...@io... www.iowalab.com ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Ffmpeg-php-user mailing list Ffm...@li... https://lists.sourceforge.net/lists/listinfo/ffmpeg-php-user |
From: Scott L. <sl...@io...> - 2005-03-21 22:45:10
|
Yes indeed, the same version of libavcodec on both boxes. I double checked the config on the FreeBSD machine and it does have zlib support enabled, I'll include the configure output. Here's a link to the test video: http://thor.iowalab.com/ffmpeg/qt/video.mov Install prefix /usr/local Source path /usr/ports/multimedia/ffmpeg/work/ffmpeg-0.4.9-pre1 C compiler cc make gmake CPU x86 (generic) Big Endian no inttypes.h yes broken inttypes.h no MMX enabled yes Vector Builtins yes gprof enabled no zlib enabled yes mp3lame enabled no vorbis enabled no faad enabled no faadbin enabled no faac enabled no a52 support yes a52 dlopened no pp support no debug symbols no optimize yes shared pp yes Video hooking yes SDL support no risky / patent encumbered codecs yes Imlib2 support no freetype support yes Sun medialib support no pthreads support no AMR-NB float support no AMR-NB fixed support no AMR-WB float support no License: GPL On Mon, 2005-03-21 at 21:08 +0100, Rob Coenen wrote: > I assume you're using the same version of libavcodec and/or libavformat > since you're using ffmpeg 0.4.9p1 on both machines. > > One thing I could think of is that your video.mov has it's headers > compressed with zlib. Make sure that ffmpeg is compiled with zlib support. > > Could you give us a link to the file you tested with (video.mov) ? > > -ROB > -- Scott Larson Network Administrator IOWA LLC T:310.823.8238 F:310.823.7108 E: su...@io... www.iowalab.com |
From: Todd.Kirby <dou...@pa...> - 2005-03-24 06:29:01
|
Scott Larson wrote: > I'm running the following script on a RH Linux 3ES machine with no >problems, however when moving the script to a FreeBSD machine I get this >error: > >[21-Mar-2005 10:58:00] PHP Warning: togdimage(): supplied resource is >not a valid Image resource in /usr/local/www/data-dist/ffmpeg/bar.php on >line 16 > > Here is the script I'm testing with: > ><?php > >header("Content-type: image/jpeg"); > >$file = "qt/video.mov"; > >$movie = new ffmpeg_movie($file); >$total = $movie->getFrameCount(); >$bitrate = $movie->getBitRate(); >$type = $movie->getVideoCodec(); >$id = round($total/2); >$frame = $movie->getFrame($id); >$width = $frame->getWidth($frame); >$height = $frame->getHeight($frame); > > $image = $frame->togdimage(); > imagejpeg($image,'',100); > >?> > > The only underlying difference is the OS. Both machines run PHP >4.3.10, ffmpeg 0.4.9p1, and ffmpeg-php 0.4.3, and in both cases >ffmpeg-php is built as a dynamic extension. An interesting thing to >note is that on the troublesome BSD machine, all the other functions >seem to work. It correctly gets the frame count, bit rate, video codec, >width and height. > > > Hi Scott, togdimage() is the only function that interacts with gd so it's likely a problem with the gd/ffmpeg-php integration (which is pure voodoo thanks to the way gd is bundled into the php sources). Which version of gd are you using? Is gd built into php or as an extension? BTW: I work at a large media company in Burbank and know some folks who might be interested in WiredrivePro/Hub. Are these apps web based? -Todd |
From: Scott L. <sl...@io...> - 2005-03-24 19:45:27
|
The version of GD in use is the bundled version in PHP, 2.0.28, and currently it's being loaded as an extension. It should be fairly trivial for me to modify the port and build it directly into PHP and give that a try. Wiredrive Pro and Hub are web based apps, we just rolled out version 1.8 a couple months back with 2.0 currently in the works. If the people you know want to talk to someone in depth about it have them give a call to the number in my sig and ask for either Bill Sewell or Erika Levy, and access to the demo system can be set up. On Wed, 2005-03-23 at 22:28 -0800, Todd.Kirby wrote: > Hi Scott, > > togdimage() is the only function that interacts with gd so it's likely a > problem with the gd/ffmpeg-php integration (which is pure voodoo thanks > to the way gd is bundled into the php sources). Which version of gd are > you using? Is gd built into php or as an extension? > > BTW: I work at a large media company in Burbank and know some folks who > might be interested in WiredrivePro/Hub. Are these apps web based? > > -Todd -- Scott Larson Network Administrator IOWA LLC T:310.823.8238 F:310.823.7108 E: su...@io... www.iowalab.com |
From: Scott L. <sl...@io...> - 2005-03-24 20:28:33
|
A follow-up on building GD directly into PHP rather than as an extension: the bar.php script I posted earlier causes the Apache process handling the request to segfault. It would seem that PHP/GD doesn't play nicely on BSD. -- Scott Larson Network Administrator IOWA LLC T:310.823.8238 F:310.823.7108 E: su...@io... www.iowalab.com |
From: Todd.Kirby <dou...@pa...> - 2005-03-25 02:55:46
|
Scott Larson wrote: > A follow-up on building GD directly into PHP rather than as an >extension: the bar.php script I posted earlier causes the Apache process >handling the request to segfault. It would seem that PHP/GD doesn't >play nicely on BSD. > > Try running the script from the command line? You may get a more useful error report. php bar.php If it still segfaults, run it in a debugger... gdb ---args php bar.php ...and type 'bt' after the segfault to generate a stack trace. Thanks, -Todd |
From: Scott L. <sl...@io...> - 2005-03-25 20:16:32
|
Well I've managed to get this working. The major problems were avcodec.h trying to #include <ffmpeg/common.h> and some strangeness with gd/zlib being loaded as modules. After fixing the include (which seems to not be a problem in the latest cvs), and statically building in gd & zlib then all the problems went away and the script has access to togdimage(); On Thu, 2005-03-24 at 18:55 -0800, Todd.Kirby wrote: > Scott Larson wrote: > > > A follow-up on building GD directly into PHP rather than as an > >extension: the bar.php script I posted earlier causes the Apache process > >handling the request to segfault. It would seem that PHP/GD doesn't > >play nicely on BSD. > > > > > Try running the script from the command line? You may get a more useful > error report. > > php bar.php > > If it still segfaults, run it in a debugger... > > gdb ---args php bar.php > > ...and type 'bt' after the segfault to generate a stack trace. > > Thanks, > > -Todd > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Ffmpeg-php-user mailing list > Ffm...@li... > https://lists.sourceforge.net/lists/listinfo/ffmpeg-php-user -- Scott Larson Network Administrator IOWA LLC T:310.823.8238 F:310.823.7108 E: su...@io... www.iowalab.com |