homepage Welcome to WebmasterWorld Guest from 54.204.64.152
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / WebmasterWorld / Web Video Creation and Optimization
Forum Library, Charter, Moderators: travelin cat

Web Video Creation and Optimization Forum

    
Mencoder doesn't work when called from PHP
alexey9




msg:3549737
 3:06 pm on Jan 16, 2008 (gmt 0)

Hello,

I'm trying to run Mencoder from PHP script. Everything works fine when I run it
from SSH, but it doesn't work when I run it from PHP:

First pass:
--------------------
system("/usr/local/bin/mencoder -vf scale=448:-3,expand=448:336 -sws 9 -of lavf
-ovc lavc -lavcopts
vcodec=flv:vbitrate=250:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3:vpass=1
-frames 800 -ofps 24000/1001 -oac mp3lame -lameopts abr:br=64:mode=0 -channels 1
-srate 22050 -of lavf -lavfopts format=flv -o ".$outputFile."
/home/re/ff/logo7.avi ".$inputFile);
--------------------

Second pass:
--------------------
system("/usr/local/bin/mencoder -vf scale=448:-3,expand=448:336 -sws 9 -of lavf
-ovc lavc -lavcopts
vcodec=flv:vbitrate=250:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3:vpass=1
-frames 800 -ofps 24000/1001 -oac mp3lame -lameopts abr:br=64:mode=0 -channels 1
-srate 22050 -of lavf -lavfopts format=flv -o ".$outputFile."
/home/re/ff/logo7.avi ".$inputFile);
--------------------

The PHP output is:
--------------------
MEncoder dev-SVN-r25703-4.1.2 (C) 2000-2008 MPlayer Team CPU: Intel(R)
Celeron(R) D CPU 3.20GHz (Family: 15, Model: 6, Stepping: 5) CPUflags: Type: 15
MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled for x86 CPU with
extensions: MMX MMX2 SSE SSE2 success: format: 0 data: 0x0 - 0x206e57e AVI file
format detected. [aviheader] Video stream found, -vid 0 [aviheader] Audio stream
found, -aid 1 VIDEO: [] 448x336 24bpp 23.976 fps 86617.4 kbps (10573.4 kbyte/s)
[V] filefmt:3 fourcc:0x0 size:448x336 fps:23.98 ftime:=0.0417
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 44100 Hz, 2 ch,
s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mp3] afm:
mp3lib (mp3lib MPEG layer-2, layer-3)
========================================================================== OK,
exit Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1,
aspect: 0.000000, round: 1 Opening video filter: [expand w=448 h=336] Expand:
448 x 336, -1 ; -1, osd: 0, aspect: 0.000000, round: 1 Opening video filter:
[scale w=448 h=-3]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request -
448 x 336 (preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening
video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDec: using BGR 24-bit as output csp (no 0)
Opening video filter: [flip] Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality
encoding selected (non-realtime)! VDecoder init failed :( Opening video decoder:
[raw] RAW Uncompressed Video VDec: vo config request - 448 x 336 (preferred
colorspace: BGR 24-bit) VDec: using BGR 24-bit as output csp (no 0) Opening
video filter: [flip] Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality
encoding selected (non-realtime)! VDecoder init failed :( Opening video decoder:
[raw] RAW Uncompressed Video VDec: vo config request - 448 x 336 (preferred
colorspace: BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Packed YUY2) VDec: using Packed YUY2 as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Unknown 0x32565559) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Packed UYVY) VDec: using Packed UYVY as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Planar 444P) VDec: using Planar 444P as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Planar 422P) VDec: using Planar 422P as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Planar YV12) VDec: using Planar YV12 as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [hmblck]
Hauppauge Macroblock/NV12/NV21 Decoder VDec: vo config request - 448 x 336
(preferred colorspace: Unknown 0x0000) VDec: using Planar YV12 as output csp (no
0) Opening video filter: [flip] Movie-Aspect is undefined - no prescaling
applied. videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High
quality encoding selected (non-realtime)! VDecoder init failed :( Opening video
decoder: [hmblck] Hauppauge Macroblock/NV12/NV21 Decoder VDec: vo config request
- 448 x 336 (preferred colorspace: Unknown 0x0000) VDec: using Planar YV12 as
output csp (no 0) Opening video filter: [flip] Movie-Aspect is undefined - no
prescaling applied. videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1])
[VE_LAVC] High quality encoding selected (non-realtime)! VDecoder init failed :(
Opening video decoder: [hmblck] Hauppauge Macroblock/NV12/NV21 Decoder VDec: vo
config request - 448 x 336 (preferred colorspace: Unknown 0x0000) VDec: using
Planar YV12 as output csp (no 0) Opening video filter: [flip] Movie-Aspect is
undefined - no prescaling applied. videocodec: libavcodec (448x336
fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected (non-realtime)!
VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 448 x 336 (preferred colorspace: Planar I420) VDec:
using Planar I420 as output csp (no 0) Opening video filter: [flip] Movie-Aspect
is undefined - no prescaling applied. videocodec: libavcodec (448x336
fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected (non-realtime)!
VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 448 x 336 (preferred colorspace: Planar YVU9) VDec:
using Planar YVU9 as output csp (no 0) Opening video filter: [flip] Movie-Aspect
is undefined - no prescaling applied. videocodec: libavcodec (448x336
fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected (non-realtime)!
VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 448 x 336 (preferred colorspace: BGR 24-bit) VDecoder
init failed :( Read DOCS/HTML/en/codecs.html!
==========================================================================
Exiting... MEncoder dev-SVN-r25703-4.1.2 (C) 2000-2008 MPlayer Team CPU:
Intel(R) Celeron(R) D CPU 3.20GHz (Family: 15, Model: 6, Stepping: 5) CPUflags:
Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled for x86 CPU
with extensions: MMX MMX2 SSE SSE2 success: format: 0 data: 0x0 - 0x206e57e AVI
file format detected. [aviheader] Video stream found, -vid 0 [aviheader] Audio
stream found, -aid 1 VIDEO: [] 448x336 24bpp 23.976 fps 86617.4 kbps (10573.4
kbyte/s) [V] filefmt:3 fourcc:0x0 size:448x336 fps:23.98 ftime:=0.0417
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 44100 Hz, 2 ch,
s16le, 320.0 kbit/22.68% (ratio: 40000->176400) Selected audio codec: [mp3] afm:
mp3lib (mp3lib MPEG layer-2, layer-3)
========================================================================== OK,
exit Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1,
aspect: 0.000000, round: 1 Opening video filter: [expand w=448 h=336] Expand:
448 x 336, -1 ; -1, osd: 0, aspect: 0.000000, round: 1 Opening video filter:
[scale w=448 h=-3]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request -
448 x 336 (preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening
video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDec: using BGR 24-bit as output csp (no 0)
Opening video filter: [flip] Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality
encoding selected (non-realtime)! VDecoder init failed :( Opening video decoder:
[raw] RAW Uncompressed Video VDec: vo config request - 448 x 336 (preferred
colorspace: BGR 24-bit) VDec: using BGR 24-bit as output csp (no 0) Opening
video filter: [flip] Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality
encoding selected (non-realtime)! VDecoder init failed :( Opening video decoder:
[raw] RAW Uncompressed Video VDec: vo config request - 448 x 336 (preferred
colorspace: BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Packed YUY2) VDec: using Packed YUY2 as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Unknown 0x32565559) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Packed UYVY) VDec: using Packed UYVY as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Planar 444P) VDec: using Planar 444P as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Planar 422P) VDec: using Planar 422P as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Planar YV12) VDec: using Planar YV12 as output csp (no 0) Opening video filter:
[flip] Movie-Aspect is undefined - no prescaling applied. videocodec: libavcodec
(448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected
(non-realtime)! VDecoder init failed :( Opening video decoder: [hmblck]
Hauppauge Macroblock/NV12/NV21 Decoder VDec: vo config request - 448 x 336
(preferred colorspace: Unknown 0x0000) VDec: using Planar YV12 as output csp (no
0) Opening video filter: [flip] Movie-Aspect is undefined - no prescaling
applied. videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High
quality encoding selected (non-realtime)! VDecoder init failed :( Opening video
decoder: [hmblck] Hauppauge Macroblock/NV12/NV21 Decoder VDec: vo config request
- 448 x 336 (preferred colorspace: Unknown 0x0000) VDec: using Planar YV12 as
output csp (no 0) Opening video filter: [flip] Movie-Aspect is undefined - no
prescaling applied. videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1])
[VE_LAVC] High quality encoding selected (non-realtime)! VDecoder init failed :(
Opening video decoder: [hmblck] Hauppauge Macroblock/NV12/NV21 Decoder VDec: vo
config request - 448 x 336 (preferred colorspace: Unknown 0x0000) VDec: using
Planar YV12 as output csp (no 0) Opening video filter: [flip] Movie-Aspect is
undefined - no prescaling applied. videocodec: libavcodec (448x336
fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected (non-realtime)!
VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 448 x 336 (preferred colorspace: Planar I420) VDec:
using Planar I420 as output csp (no 0) Opening video filter: [flip] Movie-Aspect
is undefined - no prescaling applied. videocodec: libavcodec (448x336
fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected (non-realtime)!
VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 448 x 336 (preferred colorspace: Planar YVU9) VDec:
using Planar YVU9 as output csp (no 0) Opening video filter: [flip] Movie-Aspect
is undefined - no prescaling applied. videocodec: libavcodec (448x336
fourcc=31564c46 [FLV1]) [VE_LAVC] High quality encoding selected (non-realtime)!
VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 448 x 336 (preferred colorspace: BGR 24-bit) VDecoder
init failed :( Read DOCS/HTML/en/codecs.html!
==========================================================================
Exiting...
--------------------

I wonder how can I fix it? Is it PHP bug or Mencoder bug?

 

Samizdata




msg:3558538
 9:05 am on Jan 26, 2008 (gmt 0)

All questions here deserve a response, but that one took a long time to read...

If SSH works and PHP doesn't then it may be a permissions or PHP memory issue.

My limited experience with mencoder and ffmpgeg has produced very mixed results. I always come away feeling that the projects are admirable and deserve support, but that they are not quite ready for serious production work.

Perhaps I am inadequate. Does anyone else use them successfully for web video projects?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Web Video Creation and Optimization
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved