php-general Digest 8 Jun 2009 08:25:23 -0000 Issue 6164
Topics (messages 293707 through 293719):
Converting MP3 to FLV On-The-Fly
293707 by: Nitsan Bin-Nun
293708 by: hessiess.hessiess.com
293710 by: Nitsan Bin-Nun
293712 by: Michael Shadle
293713 by: Nitsan Bin-Nun
293714 by: hessiess.hessiess.com
293715 by: Michael Shadle
smallA framework, over 140 characters for twitter ;)
293709 by: Rolando Santamaria Maso
Re: PHP Graphing Libraries...?
293711 by: Richard Heyes
Re: Time limit on recursive procedure?
293716 by: Clancy
Re: List files in a directory using filters and exclusions
293717 by: Clancy
Re: Source Code Analysis
293718 by: Dee Ayy
Re: PHP, OOP and AJAX
293719 by: Julian Muscat Doublesin
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hi Lista
I'm trying to figure how I can turn MP3 files into FLV files on the fly
using PHP.
I'm having a server and I can install 3rd party software in order to
accomplish this conversion.
I have never dealt before with music file comression or anything similar so
I don't know what I should look after or where I should look.
Any idea would be very appreciated!
Thanks!
Nitsan
--- End Message ---
--- Begin Message ---
> Hi Lista
>
> I'm trying to figure how I can turn MP3 files into FLV files on the fly
> using PHP.
> I'm having a server and I can install 3rd party software in order to
> accomplish this conversion.
>
> I have never dealt before with music file comression or anything similar
> so
> I don't know what I should look after or where I should look.
>
> Any idea would be very appreciated!
>
> Thanks!
> Nitsan
>
You may want to use some sort of caching, converting media formats is very
computationally demanding. You could use FFMPEG to do the conversion.
--- End Message ---
--- Begin Message ---
I thought of using FFMPEG but I have a bit of experience with it.
Any links or more specific directions would be great.
On Sun, Jun 7, 2009 at 7:48 PM, <[email protected]> wrote:
> > Hi Lista
> >
> > I'm trying to figure how I can turn MP3 files into FLV files on the fly
> > using PHP.
> > I'm having a server and I can install 3rd party software in order to
> > accomplish this conversion.
> >
> > I have never dealt before with music file comression or anything similar
> > so
> > I don't know what I should look after or where I should look.
> >
> > Any idea would be very appreciated!
> >
> > Thanks!
> > Nitsan
> >
>
> You may want to use some sort of caching, converting media formats is very
> computationally demanding. You could use FFMPEG to do the conversion.
>
>
--- End Message ---
--- Begin Message ---
I would also batch it. Keeping a user waiting (unless you have a
"please wait..." screen, which still can take some time and be a bad
user experience) in my experience hasn't been ideal and won't scale
very well.
On Sun, Jun 7, 2009 at 11:04 AM, Nitsan Bin-Nun<[email protected]> wrote:
> I thought of using FFMPEG but I have a bit of experience with it.
> Any links or more specific directions would be great.
>
> On Sun, Jun 7, 2009 at 7:48 PM, <[email protected]> wrote:
>
>> > Hi Lista
>> >
>> > I'm trying to figure how I can turn MP3 files into FLV files on the fly
>> > using PHP.
>> > I'm having a server and I can install 3rd party software in order to
>> > accomplish this conversion.
>> >
>> > I have never dealt before with music file comression or anything similar
>> > so
>> > I don't know what I should look after or where I should look.
>> >
>> > Any idea would be very appreciated!
>> >
>> > Thanks!
>> > Nitsan
>> >
>>
>> You may want to use some sort of caching, converting media formats is very
>> computationally demanding. You could use FFMPEG to do the conversion.
>>
>>
>
--- End Message ---
--- Begin Message ---
I don't have to let the user wait. The conversions will be done once 3 hours
using a cron job, they all will be listed in a mysql database.
On Sun, Jun 7, 2009 at 8:09 PM, Michael Shadle <[email protected]> wrote:
> I would also batch it. Keeping a user waiting (unless you have a
> "please wait..." screen, which still can take some time and be a bad
> user experience) in my experience hasn't been ideal and won't scale
> very well.
>
> On Sun, Jun 7, 2009 at 11:04 AM, Nitsan Bin-Nun<[email protected]>
> wrote:
> > I thought of using FFMPEG but I have a bit of experience with it.
> > Any links or more specific directions would be great.
> >
> > On Sun, Jun 7, 2009 at 7:48 PM, <[email protected]> wrote:
> >
> >> > Hi Lista
> >> >
> >> > I'm trying to figure how I can turn MP3 files into FLV files on the
> fly
> >> > using PHP.
> >> > I'm having a server and I can install 3rd party software in order to
> >> > accomplish this conversion.
> >> >
> >> > I have never dealt before with music file comression or anything
> similar
> >> > so
> >> > I don't know what I should look after or where I should look.
> >> >
> >> > Any idea would be very appreciated!
> >> >
> >> > Thanks!
> >> > Nitsan
> >> >
> >>
> >> You may want to use some sort of caching, converting media formats is
> very
> >> computationally demanding. You could use FFMPEG to do the conversion.
> >>
> >>
> >
>
--- End Message ---
--- Begin Message ---
These is a PHP binding for FFMPEG here:
http://ffmpeg-php.sourceforge.net/, though most of the tutorials you will
find are for the C API, for example http://www.dranger.com/ffmpeg/, which
demonstrates how to implement a media player.
Personally I would just skip using the API and use the CLI program to
convert the media, and cache/ serve from the resulting file, much easier
to implement.
> I thought of using FFMPEG but I have a bit of experience with it.
> Any links or more specific directions would be great.
>
> On Sun, Jun 7, 2009 at 7:48 PM, <[email protected]> wrote:
>
>> > Hi Lista
>> >
>> > I'm trying to figure how I can turn MP3 files into FLV files on the
>> fly
>> > using PHP.
>> > I'm having a server and I can install 3rd party software in order to
>> > accomplish this conversion.
>> >
>> > I have never dealt before with music file comression or anything
>> similar
>> > so
>> > I don't know what I should look after or where I should look.
>> >
>> > Any idea would be very appreciated!
>> >
>> > Thanks!
>> > Nitsan
>> >
>>
>> You may want to use some sort of caching, converting media formats is
>> very
>> computationally demanding. You could use FFMPEG to do the conversion.
>>
>>
>
--- End Message ---
--- Begin Message ---
On Sun, Jun 7, 2009 at 11:23 AM, <[email protected]> wrote:
> These is a PHP binding for FFMPEG here:
> http://ffmpeg-php.sourceforge.net/, though most of the tutorials you will
> find are for the C API, for example http://www.dranger.com/ffmpeg/, which
> demonstrates how to implement a media player.
> Personally I would just skip using the API and use the CLI program to
> convert the media, and cache/ serve from the resulting file, much easier
> to implement.
+1
the ffmpeg-php module would be great if it got into PECL and got more
support. right now it has some flaws and is not fully featured. it can
be useful for things like identifying media but i am not sure how well
it would be for conversion and other things. A client of mine had a
conversion script created which leveraged ffmpeg-php for
identification of aspect ratio and other things, but then went to
system() for the conversion calls.
>> I thought of using FFMPEG but I have a bit of experience with it.
system("ffmpeg -i $inputfile output.wav"); i think is really a basic
example. tweak the audio specifics as you wish (man ffmpeg - it's got
a ton of options)
--- End Message ---
--- Begin Message ---
This is a very small framework for PHP inspired by the framework of Fabien
Potencier (http://twitto.org/).
<?php
$c = $_GET['c']; //getting controller name
$a = $_GET['a']; //getting action name
if (@include_once('c/'.$c.'.php'))
{
$c = new $c; //controller instance
if (method_exists($c,$a))
$c->$a(); //invoking the action
else
die("A !f"); //controller not found
}
else die("C !f"); //action not found
?>
$c=$_GET['c'];$a=$_GET['a'];if(@include_once('c/'.$c.'.php')){$c=new$c;if(method_exists($c,$a))$c->$a();else
die("A !f");}else die("C !f");
http://twitter.com/kyberneees
Greetings!!!
--- End Message ---
--- Begin Message ---
Hi,
> Correct, but do you notice how although you're plotting multiple lines, they
> all share X values? They all change direction nicely and neatly at the same
> X value. Mine don't do that. I need to plot different X values for each
> data set. So if I'm logging values for time, I won't necessarily have the
> same increment spacing for each data set. I might have an X-coord at
> 5,6,7,8 for one data set, but have another at 5.5,6.5,7.9,9.2 for another
> data set. Most of the existing APIs assume you're going to plot nice neat
> X-coord values for each data set (e.g. 2005, 2006, 2007, 2008, 2009). Mine
> vary for each data set.
> I believe Google Charts chart type "cht=lxy"does what I need. Take a look
> at that example and notice how the X values vary per data set, they're not
> all synchronous.
I'm still not sure I get it. What about a Scatter chart with the
points connected? Would that be reasonable? With this you'd specify a
max X value of say 365 to represent a year, and then plot the values
based on that, ie: 67,57|234,80|57,89 ad infinitum. Then just connect
the points. If there's a pattern, it would become apparent.
--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 6th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp
--- End Message ---
--- Begin Message ---
On Sun, 07 Jun 2009 13:04:20 +0200, [email protected] (Per Jessen) wrote:
>Clancy wrote:
>
>> I have a recursive procedure, and I set the time limit each time I
>> enter it:
>>
>> function rec_scan($directory, ......)
>> {
>> set_time_limit (1);
>>
>> if (is_dir($new_file))
>> {
>> rec_scan ($new_file, ....)
>> }
>>
>> }
>>
>>
>> The way I read the manual, the timer should be reset each time I call
>> rec_scanl,
>
>You keep calling it so as long as the execution time between each call
>is < 1 second, your script will keep going.
>
>/Per
Thanks. That's what I thought. I'm using it to back up my working directory to
another
drive, and a 3 second limit wasn't long enough, so one of the directories must
take longer
than I expected to copy.
--- End Message ---
--- Begin Message ---
On Sat, 6 Jun 2009 21:39:15 -0400 (CDT), [email protected] ("Rolando
Santamaria
Maso") wrote:
>Hi PHP community, here I bring a very simple and interesting function that
>I made for a project, it's objetive is "to list path files in a directory
>with the possibility of using filters and exclusions".
>
>What do you think about?
>-----------------------
>
> function get_files($path, &$result, Array $exclusions, Array $filters)
> {
> @$dir_content = scandir($path);
> if ($dir_content)
> {
> $end = count($dir_content);
> $i = 2;
>
> for ($i; $i < $end; $i++)
> {
> $path_and_element = $path.'/'.$dir_content[$i];
> if (array_search($path_and_element, $exclusions) === false)
> {
> if (array_search(substr($dir_content[$i],
>strlen($dir_content[$i]) - 4), $filters) !== false)
> {
> $result[] = $path_and_element;
> }
>
> if (is_dir($path_and_element))
> {
> get_files($path_and_element, $result, $exclusions,
>$filters);
> }
> }
> }
> }
> }
>
>
> $path = '/var/www';
> $result = array();
> $exclusions = array('/var/www/drupal', '/var/www/wp');
> $filters = array('.php');
>
> get_files($path, $result, $exclusions, $filters);
>
> echo "<pre>";
> print_r($result);
> die();
I have just written a recursive backup program, and used a slightly different
exclusion
procedure:
$exclusions = array ('...drupal' => true, 'Images' =>'true', .... );
if (!isset($exclusions[$file])) { [copy file to backup ] }
This looks simpler, and therefore quicker, but I suspect it is just putting the
complexity
out of sight!
>
>------------------------------------------------------------
>Greetings!!!!
>
--- End Message ---
--- Begin Message ---
On Wed, Oct 22, 2008 at 4:30 PM, Dee Ayy<[email protected]> wrote:
> Thanks regarding the error_reporting. I may have to go this route for
> this specific issue.
> ...
> ... And not only for this specific issue.
I have another need for a SCA tool.
Is there an existing tool similar to a broken link checker, but
instead of looking for links, it would look for "include" and
"require" type commands and list a hierarchy of all files used in the
project, starting from a given input file?
It should get a list of files used in a production deployment
beginning from say "index.php", and compare that to a list of files
used in a project undergoing development from say "index_dev.php"? At
a minimum, (from what I can think of), it would have to resolve
define's that may be referenced in "include/require" as well as links
as in a broken link checker tool.
--- End Message ---
--- Begin Message ---
One final update.
The way one sets the path to required files is very important. I found it is
best to use instead of relative paths.
Regards
Julian
On Fri, Jun 5, 2009 at 2:19 PM, Julian Muscat Doublesin <
[email protected]> wrote:
> Update.
>
> Hello Everyone,
>
> First of all, thank you all for your input. I ran a sinmple test using the
> suggestions you gave me and and require_once.
>
> Using firebug to test the output, I got an internal server error. I found
> out what the problem was.
>
> What I am doing is I have classes which represent the objects, another
> class containing the functions. From the function class I create an instance
> of each object, manipulate the information, return the HTML result. Finally
> I have a runner class that creates an instance of the function class, calls
> the function required and outputs the information.
>
> What the problem was for some reason I was did not create an instance of
> the function class, just was calling the function. Well by creating the
> runner class I solved the problem.
>
> Thanks all for your help.
>
> Regards
>
> Julian
>
--- End Message ---