PDA

View Full Version : multiple encodes per script in php


mmarano
11-14-2006, 11:58 AM
I've been hacking at the php sample that comes with flix linux engine 8.0.6.0. I'm trying to simply loop, and encode a video multiple times. Really, I'd like to loop over a list of files, and encode each video multiple times, but I can't get even one of the loops to work. I've attached my code if you want to take a look. I get the output noted below. I've tried having my flix handle creation, and the subsequent clean up code happen both inside the loop, and outside the loop. No matter what, any subsequent encodings fail. The first one works, the rest die. Can anyone give me any pointers?


[mmarano@fnmiscdev flixdemo]$ ./multi.php
Loading flix: flixengine2.php
Flix Engine client library v8.0.6.0_DEMO
Powered by On2 TrueMotion video technology.
(c) 1992-2006 On2 Technologies, Inc. All Rights Reserved.
For more information, visit: http://www.on2.com.

Input File : /home/httpd/vhosts/default/httpdocs/flixdemo/test_inputs/0SneakKing_061106trailer_360_16x9_700.wmv
Width: 426
Height: 240
Duration: 63000ms
Output File : /home/httpd/vhosts/default/httpdocs/flixdemo/test_outputs/0SneakKing_061106trailer_360_16x9_700_low.flv

Encoding...100% Done!

Encoder Status
state: 0
sc:0 Flix2_Errno(flixerrno:0, syserrno:0)
ErrNone

Input File : /home/httpd/vhosts/default/httpdocs/flixdemo/test_inputs/NFSCarbon_Fortuna_BIG.mov
Width: 648
Height: 486
Duration: 62549ms
Output File : /home/httpd/vhosts/default/httpdocs/flixdemo/test_outputs/NFSCarbon_Fortuna_BIG_low.flv

Encoding...100% Done!

Encoder Status
state: 0
sc:0 Flix2_Errno(flixerrno:-2, syserrno:2)
ErrFileIO
[mmarano@fnmiscdev flixdemo]$ ls -l test_outputs/
total 4184
-rw-r--r-- 1 root root 4266746 Nov 14 08:22 0SneakKing_061106trailer_360_16x9_700_low.flv
-rw-r--r-- 1 root root 370 Nov 14 08:22 NFSCarbon_Fortuna_BIG_low.flv

mmarano
11-14-2006, 12:18 PM
I think I may be getting closer. It looks like I need to create a new flix handle each time. (working on my loops here...). Can anyone confirm this?

kerrizor
11-16-2006, 12:11 PM
I think I may be getting closer. It looks like I need to create a new flix handle each time. (working on my loops here...). Can anyone confirm this?

That was going to be my first suggestion, actually.

It's "better" to abstract all the flix code to their own functions, and pass it in the name/location of a file to encode; much easier, cleaner code.

Dntspa
11-21-2006, 03:30 AM
if you want multiple encodes - just write some script that would start two (or more) copies of your encoding script with different parameters. :cool: