Here's the code. good luck getting mencoder working properly, I had to
ask a friend to help recompile it. Also, mencoder won't add the
metadata like length to the file so you have to do that with flvtool.
That way the player can show a progress bar.


                                // convert the video to FLV
                                $encoder = "mencoder " . $file["tmp_name"] . "  
-o
../webroot/img/media/videos/"  . $this->Video->id . ".flv -of lavf -oac
mp3lame -lavcopts
vcodec=flv:vbitrate=300:cbp:mv0:mbd=2:trell:v4mv:predia=2:dia=2:last_pred=3
-vf scale=320:240,harddup -lameopts br=64 -ovc lavc -ofps 25 -srate
22050 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames >
/tmp/encoder_log";
                                // add flv metadata

$encoder .= "; /usr/bin/flvtool2 -U ../webroot/img/media/videos/"  .
$this->Video->id . ".flv";
$encoder .= " 2>&1 &";

                                exec($encoder);
                                // make video thumbnail
                                $thumbnail = "mplayer -nosound -vo 
jpeg:quality=100:outdir=/tmp -ss
1 -vf scale=320:240 -frames 3 " . $file["tmp_name"];
                                exec($thumbnail);


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to