[MEncoder-users] Problem with Avi File not seekable, index broken

Vincent Chimaobi Emeakaroha vincent at e-magine.com
Wed Nov 21 11:38:19 CET 2007


Hi guys

I am using mencoder to copy a certain length of video and Audio from an
avi file. I am doing this with a php script. for the output file I am
using a pipe so that I can download the movie on the fly from the
browser. The problem is that the generated output file is not seekable.
It gives the error message:"Cannot seek in raw AVI streams. (Index
required, try with the -idx
switch.)". If i check the outputted avi file with an ascii editor, the
index section is written but I do not know why it is not seekable.


Here is a cut from the script:

$infile = '/home/vincent/Movies/25299_AVI.avi';
   register_shutdown_function('RemovePipe');
  umask(0);
  posix_mkfifo($pipename, 0666); 
     
   $command = 'mencoder -cache 4096 -ovc copy -oac copy -of avi  -idx
-nobps -o ' .
    $pipename . ' ' . $infile . ' -ss ' . $start1 . ' -endpos ' . $dur1
. 
    ' ' . $infile . ' -ss ' . $start2 . ' -endpos ' . $dur2 . ' >
/tmp/webout.txt 2>&1 &';

set_time_limit(0);
  ob_end_clean();
  
  if ($direct_output)
  {
   header('Expires: ' . gmdate('D, d M Y 12:00:00', time() + 24 * 3600 *
5) . ' GMT');
   header('Accept-Ranges: none');
   header('Content-Type: video/x-msvideo');
   header('Content-Transfer-Encoding: binary');
   header('Content-Disposition: attachment; filename="dynvid.avi";');
  }
  flush();
  shell_exec($command);


If I use the same script but instead of a pipe as output file, i use a
normal file, it works fine and the output is seekable.

Please can someone help me with this problem because I need very much
for my job!

Thanks
Jobby



More information about the MEncoder-users mailing list