[MEncoder-users] PHP cannot execute some encoding commands

Leo Liu kkl_sg at yahoo.com
Mon Sep 4 04:30:15 CEST 2006


Hi Ivo, 
   
  Sorry for the late reply. I tried as you suggested. And I got this log file. I am not so sure what exactly is wrong. But the message comes out from log file definately is different from how the message look like when I run the same command on the Linux itself. Sorry for no proper indent. But I don't know if you can tell what's wrong from my log file. I paste the whole log here. Hope you can help me out. 
   
  Regards,
   
  Leo
   
  MPlayer 1.0pre8-4.1.1 (C) 2000-2006 MPlayer Team
CPU: AMD Opteron(tm) Processor 252 (Family: 15, Model: 37, Stepping: 1)
CPUflags:  
MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
get_path('codecs.conf') -> '//.mplayer/codecs.conf'
Reading //.mplayer/codecs.conf: Can't open '//.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
  Using built-in default codecs.conf.
  CommandLine: '-v' '-frames' '5' '-vo' 'jpeg:outdir=../SDC/tempcap:quality=100' '-contrast' '20' '../SDC/products/Test/ddb_gdnp.mpg'
init_freetype
get_path('font/font.desc') -> '//.mplayer/font/font.desc'
font: can't open file: //.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Using nanosleep() timing
get_path('input.conf') -> '//.mplayer/input.conf'
Can't open input config file //.mplayer/input.conf: No such file or directory
Can't open input config file /usr/local/etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config
get_path('ddb_gdnp.mpg.conf') -> '//.mplayer/ddb_gdnp.mpg.conf'
  Playing ../SDC/products/Test/ddb_gdnp.mpg.
get_path('sub/') -> '//.mplayer/sub/'
[file] File size is 1385916 bytes
STREAM: [file] ../SDC/products/Test/ddb_gdnp.mpg
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
AVI file format detected.
list_end=0x13A
======= AVI Header =======
us/frame: 33366  (fps=29.971)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (2320) HAS_INDEX IS_INTERLEAVED TRUST_CKTYPE
frames  total: 300   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  352 x 240
==========================
list_end=0xD4
==> Found video stream: 0
====== STREAM Header =====
Type: vids   FCC: MP42 (3234504D)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 30000/1001 = 29.970
Start: 0   Len: 300
Suggested BufferSize: 22440
Quality 0
Sample size: 0
==========================
Found 'bih', 40 bytes of 40
======= VIDEO Format ======
  biSize 40
  biWidth 352
  biHeight 240
  biPlanes 1
  biBitCount 24
  biCompression 842289229='MP42'
  biSizeImage 253440
===========================
Regenerating keyframe table for DIVX3 video.
list_end=0x13A
==> Found audio stream: 1
====== STREAM Header =====
Type: auds   FCC: P (50)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 16000/1 = 16000.000
Start: 0   Len: 160000
Suggested BufferSize: 8000
Quality 0
Sample size: 1
==========================
Found 'wf', 18 bytes of 18
======= WAVE Format =======
Format Tag: 80 (0x50)
Channels: 2
Samplerate: 48000
avg byte/sec: 16000
Block align: 1
bits/sample: 16
cbSize: 0
==========================================================================
list_end=0x166
hdr=Software  size=23
Software  : MEncoder 1.0pre8-4.1.1
list_end=0x1511B4
Found movie at 0x100C - 0x1511B4
Reading INDEX block, 320 chunks for 300 frames (fpos=1380796).
AVI index offset: 0x1008 (movi=0x100C idx0=0x4 idx1=0x1F4C)
Auto-selected AVI audio ID = 1
Auto-selected AVI video ID = 0
AVI: Searching for audio stream (id:1)
AVI video size=1213960 (300) audio size=160000 (160000)
VIDEO:  [MP42]  352x240  24bpp  29.970 fps  970.2 kbps (118.4 kbyte/s)
[V] filefmt:3  fourcc:0x3234504D  size:352x240  fps:29.97  ftime:=0.0334
Clip info:
 Software: MEncoder 1.0pre8-4.1.1
get_path('sub/') -> '//.mplayer/sub/'
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer.
mp3lib: using generic C decore!
MP3lib: init layer2&3 finished, tables done
MPEG 1.0, Layer II, 48000 Hz 128 kbit Stereo, BPF: 384
Channels: 2, copyright: No, original: Yes, CRC: Yes, emphasis: 0
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
jpeg: Parsing suboptions.
jpeg: Progressive JPEG disabled.
jpeg: Baseline JPEG enabled.
jpeg: optimize --> 100
jpeg: smooth --> 0
jpeg: quality --> 100
jpeg: dpi --> 72
jpeg: outdir --> ../SDC/tempcap
jpeg: Suboptions parsed OK.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
INFO: libavcodec init OK!
Selected video codec: [ffmp42] vfm: ffmpeg (FFmpeg M$ MPEG-4 v2)
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy 
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
ao2: 48000 Hz  2 chans  s16le
audio_setup: using '/dev/dsp' dsp device
audio_setup: using '/dev/mixer' mixer device
audio_setup: using 'pcm' mixer device
alsa-init: requested format: 48000 Hz, 2 channels, 9
alsa-init: using ALSA 1.0.11rc2
alsa-init: setup for 1/2 channel(s)
alsa-init: using device default
[AO SDL] Samplerate: 48000Hz Channels: Stereo Format s16le
   
  
Ivo <ivop at euronet.nl> wrote:
  On Tuesday 29 August 2006 03:24, Ko Ko wrote:
> But when I use this command with PHP
>
> mplayer -frames 5 -vo jpeg:outdir=$outdir:quality=100 -contrast 20
> test.mpg
>
> It doesn't produce any jpeg images from test.mp file.
>
> I try out the same set of command on my Fedora itself as root or normal
> user it is manage to create output directory and produce the jpeg images.
>
> I have no idea why PHP command won't execute this command correctly.
>
> Can anyone help me with this? =(

Try redirecting stdout/stderr to a file. Something like:

exec('mplayer -v -frames 5 -vo jpeg:outdir=somedir:quality=100 -contrast 20 
>logfile.log 2>&1');

Notice that I added -v so the output will be more verbose. Now look at 
logfile.log to see what actually happened and why it failed.

--Ivo
_______________________________________________
MEncoder-users mailing list
MEncoder-users at mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/mencoder-users




Reality starts with Dream 

 		
---------------------------------
 All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.


More information about the MEncoder-users mailing list