[FFmpeg-devel] Problem with 2pass X264 Encoding with ffmpeg (passlogfile bug)

Craig Whitmore lennon
Fri Aug 15 22:46:12 CEST 2008


I am using apache to run in the background via a php @exec call a ffmpeg
instance to transcode data.. The problem is the passlogfile command is
"broken" for x264 .

Running from the command line it make 2 files..
/www/virtual/bcast.co.nz/htdocs/uploads/ZWdWMTDM3HwnkIQIJraF.log which
is blank and x2642pass.log which actually has the info in it (seems the
x264 2 pass encoding ignores the --passlogfile and uses its own.

When I run from php on apache it cannot make up the x2642pass.log file
so then craps out.

Anyone have a fix for the log file to be passed to the x264 or
suggestion for apache in the mean while?

<?php

$torun =  "/usr/local/bin/ffmpeg -y
-i /www/virtual/bcast.co.nz/htdocs/uploads/avi/ZWdWMTDM3HwnkIQIJraF.wmv
-threads 2 -pass 1 -an -vcodec
libx264 -b 500000 -r 25 -s 640x480 -bf 3 -qcomp 0.7 -g 250 -keyint_min
25 -refs 5 -loop 1 -flags +4mv -cmp 256 -coder 0 -me_range 16 -sc_th
reshold 40 -i_qfactor 0.71 -level 30 -qmin 10 -qmax 51 -qdiff 4
-padcolor 000000 -padtop 0 -padbottom 0 -padleft 0 -padright 0 -subq 1
-me
hex -partitions 0 -trellis 0 -flags2 +mixed_refs
-passlogfile /www/virtual/bcast.co.nz/htdocs/uploads/ZWdWMTDM3HwnkIQIJraF.log /www/virtual
/bcast.co.nz/htdocs/uploads/ZWdWMTDM3HwnkIQIJraF.flv";

echo "RUNNING:<br>".$torun."<br>";
@exec ("$torun 2>&1",$output);
//system("$torun 2>&1",$output);
echo "OUTPUT:<br>";

foreach ($output as $outputline) {
        echo ("$outputline<br>");
        }

and gives out:



FFmpeg version SVN-r14685, Copyright (c) 2000-2008 Fabrice Bellard, et
al.
configuration: --enable-postproc --enable-gpl --enable-memalign-hack
--enable-libx264 --enable-pthreads --enable-libfaac
libavutil version: 49.8.0
libavcodec version: 51.63.0
libavformat version: 52.20.0
libavdevice version: 52.1.0
built on Aug 15 2008 21:10:47, gcc: 4.2.3 20071014 (prerelease) (Debian
4.2.2-3)

Seems stream 1 codec frame rate differs from container frame rate:
1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from
'/www/virtual/bcast.co.nz/htdocs/uploads/avi/ZWdWMTDM3HwnkIQIJraF.wmv':
Duration: 00:00:37.57, start: 3.000000, bitrate: 140 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, mono, s16, 32 kb/s
Stream #0.1: Video: wmv3, yuv420p, 320x240 [PAR 9:10 DAR 6:5], 90 kb/s,
29.97 tb(r)
Output #0, flv, to
'/www/virtual/bcast.co.nz/htdocs/uploads/ZWdWMTDM3HwnkIQIJraF.flv':
Stream #0.0: Video: libx264, yuv420p, 640x480 [PAR 9:10 DAR 6:5],
q=10-51, pass 1, 500 kb/s, 25.00 tb(c)
Stream mapping:
Stream #0.1 -> #0.0
[libx264 @ 0x8898720]using SAR=9/10
[libx264 @ 0x8898720]using cpu capabilities: MMX2 Cache32
[libx264 @ 0x8898720]ratecontrol_init: can't open stats file
Error while opening codec for output stream #0.0 - maybe incorrect
parameters such as bit_rate, rate, width or height







More information about the ffmpeg-devel mailing list