php-general Digest 28 Jul 2008 22:15:47 -0000 Issue 5594

Topics (messages 277376 through 277404):

getting info from video formats
        277376 by: Rene Veerman
        277377 by: Aschwin Wesselius
        277378 by: Aschwin Wesselius
        277379 by: Aschwin Wesselius
        277399 by: mike
        277400 by: Chris Scott
        277401 by: mike
        277403 by: Chris Scott

Why PHP4?
        277380 by: Richard Heyes
        277382 by: n3or
        277383 by: Per Jessen
        277385 by: Eric Butera
        277386 by: Richard Heyes
        277387 by: Aschwin Wesselius
        277388 by: Richard Heyes
        277389 by: Per Jessen
        277398 by: mike
        277402 by: Richard Heyes

Web2.0 style tags - where to start?
        277381 by: Paul Jinks
        277384 by: Richard Heyes
        277390 by: Paul Jinks
        277391 by: Jason Norwood-Young

Re: Code beautifier
        277392 by: Philip Thompson
        277393 by: tedd
        277394 by: Jason Pruim
        277395 by: tedd

Programming With Revision History
        277396 by: Nate Tallman
        277397 by: Eric Butera

Problem with using array_diff  and array_combine
        277404 by: Richard Kurth

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.

I want to enable video and flash for my CMS, but that requires that i can
read at least the dimensions of a video file..

ImageMagick's "identify" command supposedly reads AVI and MPEG, but i can't
get it to work on my avi's:

C:\Users\rene\Documents\Downloads>identify
Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi
identify: Not enough pixel data
`Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi'.


So if ImageMagick isn't the tool to use for video files, i wonder if there
is any other tool that i can use to determine the size of video files.

I'd like to be able to read as many of the major video formats (AVI, XVID,
DIVX, QT, etc) as possible.

--- End Message ---
--- Begin Message ---
Rene Veerman wrote:
Hi.

I want to enable video and flash for my CMS, but that requires that i can
read at least the dimensions of a video file..

ImageMagick's "identify" command supposedly reads AVI and MPEG, but i can't
get it to work on my avi's:

C:\Users\rene\Documents\Downloads>identify
Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi
identify: Not enough pixel data
`Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi'.


So if ImageMagick isn't the tool to use for video files, i wonder if there
is any other tool that i can use to determine the size of video files.

I'd like to be able to read as many of the major video formats (AVI, XVID,
DIVX, QT, etc) as possible.

Hi,

Maybe this is something for you:

http://getid3.sourceforge.net

I've used an older version a while ago, but it did some video recognition too as far as I know.

It's PHP, so you can look at the source too.
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

--- End Message ---
--- Begin Message ---
Aschwin Wesselius wrote:
Rene Veerman wrote:
Hi.

I want to enable video and flash for my CMS, but that requires that i can
read at least the dimensions of a video file..

ImageMagick's "identify" command supposedly reads AVI and MPEG, but i can't
get it to work on my avi's:

C:\Users\rene\Documents\Downloads>identify
Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi
identify: Not enough pixel data
`Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi'.


So if ImageMagick isn't the tool to use for video files, i wonder if there
is any other tool that i can use to determine the size of video files.

I'd like to be able to read as many of the major video formats (AVI, XVID,
DIVX, QT, etc) as possible.

Hi,

Maybe this is something for you:

http://getid3.sourceforge.net

I've used an older version a while ago, but it did some video recognition too as far as I know.

It's PHP, so you can look at the source too.
Hi,

I took a second look at the project demo and it provides the resolution of the video frame.... So, I think it helps.
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/

--- End Message ---
--- Begin Message ---
Rene Veerman wrote:
USD 1500 for a commercial license :(
That's prohibitively expensive for me atm..

Any other packages that might do the trick?

Well, there's nothing wrong with taking a peek at the source code and get some idea of how they did the information gathering.

Then, build your own downsized version of such a library and use it as you see fit.


On Mon, Jul 28, 2008 at 11:41 AM, Aschwin Wesselius <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Rene Veerman wrote:
    Hi.

    I want to enable video and flash for my CMS, but that requires that i can
    read at least the dimensions of a video file..

    ImageMagick's "identify" command supposedly reads AVI and MPEG, but i can't
    get it to work on my avi's:

    C:\Users\rene\Documents\Downloads>identify
    Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi
    identify: Not enough pixel data
    `Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi'.


    So if ImageMagick isn't the tool to use for video files, i wonder if there
    is any other tool that i can use to determine the size of video files.

    I'd like to be able to read as many of the major video formats (AVI, XVID,
    DIVX, QT, etc) as possible.

    Hi,

    Maybe this is something for you:

    http://getid3.sourceforge.net

    I've used an older version a while ago, but it did some video
    recognition too as far as I know.

    It's PHP, so you can look at the source too.
--
    Aschwin Wesselius

    /'What you would like to be done to you, do that to the other....'/




--- End Message ---
--- Begin Message ---
On 7/28/08, Rene Veerman <[EMAIL PROTECTED]> wrote:

> ImageMagick's "identify" command supposedly reads AVI and MPEG, but i can't
> get it to work on my avi's:

i wouldn't rely on it; i'd rely on it for "Image"s :)

> C:\Users\rene\Documents\Downloads>identify
> Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi
> identify: Not enough pixel data
> `Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi'.

you naughty pirater :P

> So if ImageMagick isn't the tool to use for video files, i wonder if there
> is any other tool that i can use to determine the size of video files.
>
> I'd like to be able to read as many of the major video formats (AVI, XVID,
> DIVX, QT, etc) as possible.

ffmpeg is probably the best bet. i believe it has an option to get
video info and not try to process it.

also look at the mencoder/mplayer suite of tools.

maybe even transcode.

--- End Message ---
--- Begin Message ---
I agree.

I use MPlayer to process videos. One script gets the video length like this.

//use mplayer to pull some info from the video
$info = exec("\"$mplayer\" $videoPath/$videoName -identify -nosound -frames 0 > 
$tmpInfoFile");
//and open the file it stores the data in
$infoFile = fopen("$tmpInfoFile", "rb");
//then parse for the video length
while(! feof($infoFile) )
{
        $lineBuffer = fgets($infoFile);
        if(preg_match("/ID_LENGTH=/", $lineBuffer))
        {
                $videoLength = (int) preg_replace("/ID_LENGTH=/", "", 
$lineBuffer);
        }
}

> -----Original Message-----
> From: mike [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 28, 2008 1:12 PM
> To: Rene Veerman
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] getting info from video formats
> 
> On 7/28/08, Rene Veerman <[EMAIL PROTECTED]> wrote:
> 
> > ImageMagick's "identify" command supposedly reads AVI and MPEG, but i can't
> > get it to work on my avi's:
> 
> i wouldn't rely on it; i'd rely on it for "Image"s :)
> 
> > C:\Users\rene\Documents\Downloads>identify
> > Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi
> > identify: Not enough pixel data
> > `Stargate.Atlantis.S05E02.HDTV.XviD-0TV.avi'.
> 
> you naughty pirater :P
> 
> > So if ImageMagick isn't the tool to use for video files, i wonder if there
> > is any other tool that i can use to determine the size of video files.
> >
> > I'd like to be able to read as many of the major video formats (AVI, XVID,
> > DIVX, QT, etc) as possible.
> 
> ffmpeg is probably the best bet. i believe it has an option to get
> video info and not try to process it.
> 
> also look at the mencoder/mplayer suite of tools.
> 
> maybe even transcode.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
On 7/28/08, Chris Scott <[EMAIL PROTECTED]> wrote:
> I agree.
>
> I use MPlayer to process videos. One script gets the video length like this.
>
> //use mplayer to pull some info from the video
> $info = exec("\"$mplayer\" $videoPath/$videoName -identify -nosound -frames 0 
> > $tmpInfoFile");
> //and open the file it stores the data in
> $infoFile = fopen("$tmpInfoFile", "rb");
> //then parse for the video length
> while(! feof($infoFile) )
> {
>        $lineBuffer = fgets($infoFile);
>        if(preg_match("/ID_LENGTH=/", $lineBuffer))
>        {
>                $videoLength = (int) preg_replace("/ID_LENGTH=/", "", 
> $lineBuffer);
>        }
> }

you could probably skip piping it to a tempfile - and just use popen()
to open the process...

--- End Message ---
--- Begin Message ---

> -----Original Message-----
> From: mike [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 28, 2008 2:17 PM
> To: Chris Scott
> Cc: [EMAIL PROTECTED]
> Subject: Re: FW: [PHP] getting info from video formats
> 
> On 7/28/08, Chris Scott <[EMAIL PROTECTED]> wrote:
> > I agree.
> >
> > I use MPlayer to process videos. One script gets the video length like this.
> >
> > //use mplayer to pull some info from the video
> > $info = exec("\"$mplayer\" $videoPath/$videoName -identify -nosound -frames > > 0
> > $tmpInfoFile");
> > //and open the file it stores the data in
> > $infoFile = fopen("$tmpInfoFile", "rb");
> > //then parse for the video length
> > while(! feof($infoFile) )
> > {
> >        $lineBuffer = fgets($infoFile);
> >        if(preg_match("/ID_LENGTH=/", $lineBuffer))
> >        {
> >                $videoLength = (int) preg_replace("/ID_LENGTH=/", "", 
> > $lineBuffer);
> >        }
> > }
> 
> you could probably skip piping it to a tempfile - and just use popen()
> to open the process...


Yeah thanks.

I didn't like the way I was doing it!

--- End Message ---
--- Begin Message ---
I'm interested - why are people still using PHP4? It's been over 4
years (I think) - plenty of time to upgrade to five.

-- 
Richard Heyes
http://www.phpguru.org

--- End Message ---
--- Begin Message ---
Compatibility to older Software of the hosters and sloth of the developers

Richard Heyes schrieb:
I'm interested - why are people still using PHP4? It's been over 4
years (I think) - plenty of time to upgrade to five.
--
Viele Grüße

Dominik Strauß - www.n3or.de
Webentwicklung, PHP und Linux

Mobil: 0178 4940605
Internet: www.n3or.de
E-Mail: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Richard Heyes wrote:

> I'm interested - why are people still using PHP4? It's been over 4
> years (I think) - plenty of time to upgrade to five.

Migration issues for instance - we have quite a bit of code that uses
sablotron - in PHP5 that's been changed to libxslt, which requires
extensive code-changes. 

Also, something about setlocale() got regressed (and never fixed) in
4.3.10 or thereabouts, which means we have at least one app that's
running on 4.3.8. 

Finally - why migrate? What's the rush?  Lots of people are still
running back-level software - e.g. apache, mysql, php, gcc, linux, you
name it.  In our shop, migrating working PHP code has one of the lowest
priorities.


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
On Mon, Jul 28, 2008 at 8:12 AM, Richard Heyes <[EMAIL PROTECTED]> wrote:
> I'm interested - why are people still using PHP4? It's been over 4
> years (I think) - plenty of time to upgrade to five.
>
> --
> Richard Heyes
> http://www.phpguru.org

Why is COBOL still in use? :)

--- End Message ---
--- Begin Message ---
> Why is COBOL still in use? :)

What is COBOL? :-)

-- 
Richard Heyes
http://www.phpguru.org

--- End Message ---
--- Begin Message ---
n3or wrote:
Compatibility to older Software of the hosters and sloth of the developers

Richard Heyes schrieb:
I'm interested - why are people still using PHP4? It's been over 4
years (I think) - plenty of time to upgrade to five.

I think because retro is hot these days....or was....or will be again within short notice....... ;-)
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other....'/


--- End Message ---
--- Begin Message ---
> Finally - why migrate? What's the rush?  Lots of people are still
> running back-level software

That I can understand. I'm still running Apache 1.3.33 (I think) along
with PHP 5.0.4.

-- 
Richard Heyes
http://www.phpguru.org

--- End Message ---
--- Begin Message ---
Richard Heyes wrote:

>> Finally - why migrate? What's the rush?  Lots of people are still
>> running back-level software
> 
> That I can understand. I'm still running Apache 1.3.33 (I think) along
> with PHP 5.0.4.

Right, you've answered your own question.  You're still on Apache 1.3.33
because you've had no time or reason to upgrade.  


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
On 7/28/08, n3or <[EMAIL PROTECTED]> wrote:
> Compatibility to older Software of the hosters and sloth of the developers

i think this is a cop-out, any halfass open source package should be
compatible with php5 now.

i've been running php5 since it came out and everything i have tried
never has a single issue due to php versions. and i've tried a lot of
stuff :P

actually, a lot of stuff is finally saying "php5 only" now ... in
theory lazy hosters may be creating a poor hosting environment the
longer they sit on it.

--- End Message ---
--- Begin Message ---
> actually, a lot of stuff is finally saying "php5 only" now ...

Just in time for PHP6... :-)

-- 
Richard Heyes
http://www.phpguru.org

--- End Message ---
--- Begin Message ---
Hi

I'm working on a project where we're building a collection of videos in
Flash and the idea has been mooted that it would improve usability if we
were to allow users to tag videos they've seen a la last.fm, flickr
youtube etc.

It's still very early days and I'm quite interested in putting something
together quickly to see if it's really the way we want to go (also because
it might be useful for other projects).

Does anyone know of any good resources on building a tagging system? The
video for now will be held on a normal LAMP machine as will everything
else.

TIA

Paul




--- End Message ---
--- Begin Message ---
> I'm working on a project where we're building a collection of videos in
> Flash and the idea has been mooted that it would improve usability if we
> were to allow users to tag videos they've seen a la last.fm, flickr
> youtube etc.

If you're thinking of trying re-invent a UI - my advice would be
don't. Your visitors are more likely to know and understand their own
PCs UI as opposed to one that you invent. Any UI you come up with is
not going to be as easily used no matter how good it is.

-- 
Richard Heyes
http://www.phpguru.org

--- End Message ---
--- Begin Message ---
On Mon, July 28, 2008 2:04 pm, Richard Heyes wrote:
>> I'm working on a project where we're building a collection of videos in
>> Flash and the idea has been mooted that it would improve usability if we
>> were to allow users to tag videos they've seen a la last.fm, flickr
>> youtube etc.
>
> If you're thinking of trying re-invent a UI - my advice would be
> don't. Your visitors are more likely to know and understand their own
> PCs UI as opposed to one that you invent. Any UI you come up with is
> not going to be as easily used no matter how good it is.
>
> --
> Richard Heyes
> http://www.phpguru.org
>
Hi Richard

I think my first post was ambiguous. What we're thinking of is to build a
site on which people can view videos with the option to add metadata to a
video after viewing it.

We think that the content we have will be of wide interest to a lot of
people and the best way to index it is for users to 'tag' it themselves,
since it's hard for us to anticipate the uses that people may have for the
content.

Last.fm allows users to tag bands and songs for example; here's the tag
page for Joy Division:
http://www.last.fm/music/Joy+Division/+tags

The idea being that if you're interested in post-punk, for example, you
can click on that tag and be taken to the pages of similarly genred bands.
So it encourages use of the content and serendipitous connections (maybe).

I'm not convinced that this is the way to go, but I'd like to pilot the
idea and am looking for signposts for where to start.

Paul

Ps. I was wrong about youtube, by the way, it doesn't look like they do
tagging.



--- End Message ---
--- Begin Message ---
On Mon, 2008-07-28 at 14:48 +0100, Paul Jinks wrote:
> I think my first post was ambiguous. What we're thinking of is to build a
> site on which people can view videos with the option to add metadata to a
> video after viewing it.
> 
> We think that the content we have will be of wide interest to a lot of
> people and the best way to index it is for users to 'tag' it themselves,
> since it's hard for us to anticipate the uses that people may have for the
> content.

How do you plan to have users enter the info? Through the Flash player,
through some kinda Ajax form, through a form in a frame or just a static
form? 

Also, would the tags be predefined by you (eg. genres like the ID3 tag
genres) or would people be able to add their own tags?

The way I'd do it would be to let the users enter the info through an
Ajax form below the video, with suggestions popping up as they type.
Then save it in a separate table (I assume all your vids are in their
own table) with a link table between the vids table and the tags table
(M2M relationship). This means that if the tag is already in there and
linked to one vid, you don't replicate it for a second vid. It's also
very easy to do lookups of similar items. I'd also add a weighting to
the tags in the links table, maybe with the more people that add a
specific tag, the more weight that tag gets. 

Also check out http://www.music-map.com/ as an example of showing
similar music - you might even be able to plug into this data.


--- End Message ---
--- Begin Message ---
On Jul 24, 2008, at 5:48 AM, Richard Heyes wrote:

Anyone know of an unintrusive code beautifier written specifically with in
mind?


With 'what' in mind?

Sorry, PHP.

Not that this thread got off topic at all, but here's a listing (more than PHP):

http://en.wikipedia.org/wiki/Prettyprint#Code_Beautifiers

~Philip


--- End Message ---
--- Begin Message ---
At 9:06 AM +0100 7/28/08, Peter Ford wrote:
At 6:47 PM -0400 7/25/08, Daniel Brown wrote:
On Fri, Jul 25, 2008 at 6:29 PM, tedd <[EMAIL PROTECTED]> wrote:
 But, there's nothing wrong with starting a sentence with but.

    Correct, as I said, in "Reader's Digest" English.  In proper
grammar, it's tantamount to ending a sentence with a preposition[1].
However, even in Reader's Digest English (RDE[TM]), heading a word
with "but" is acceptable.... but following it immediately with a comma
is not[2].

It's arguably more correct in this case to use ellipsis:

Okay, who said an old dog can't learn new tricks? Both you and Daniel have convinced me to stop using "But," and start using "But ..."

As I've said many times before:

"I've learned something new every day of my life... and I'm getting damned tried of it!"

Thanks,

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---

On Jul 28, 2008, at 11:10 AM, tedd wrote:

At 9:06 AM +0100 7/28/08, Peter Ford wrote:
At 6:47 PM -0400 7/25/08, Daniel Brown wrote:
On Fri, Jul 25, 2008 at 6:29 PM, tedd <[EMAIL PROTECTED]> wrote:
But, there's nothing wrong with starting a sentence with but.

   Correct, as I said, in "Reader's Digest" English.  In proper
grammar, it's tantamount to ending a sentence with a preposition[1].
However, even in Reader's Digest English (RDE[TM]), heading a word
with "but" is acceptable.... but following it immediately with a comma
is not[2].

It's arguably more correct in this case to use ellipsis:

Okay, who said an old dog can't learn new tricks? Both you and Daniel have convinced me to stop using "But," and start using "But ..."

As I've said many times before:

"I've learned something new every day of my life... and I'm getting damned tried of it!"

Butt... You're still alive to be apart of it :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]





--- End Message ---
--- Begin Message ---
At 11:20 AM -0400 7/28/08, Jason Pruim wrote:
On Jul 28, 2008, at 11:10 AM, tedd wrote:
As I've said many times before:

"I've learned something new every day of my life... and I'm getting damned tried of it!"

Butt... You're still alive to be apart of it :)

As long as my butt is, I guess you're right.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Hey guys,
Does anyone know of any good literature on programming revision history into
an application? I'm looking for something covering theory around revision
history.

For a little background info, I'm dealing with lesson plans that will need
to be edited by many different sources. I like the way wikimedia handles
revision history, but I'm just curious what my options are.

Thanks,

Nate

--- End Message ---
--- Begin Message ---
On Mon, Jul 28, 2008 at 11:58 AM, Nate Tallman
<[EMAIL PROTECTED]> wrote:
> Hey guys,
> Does anyone know of any good literature on programming revision history into
> an application? I'm looking for something covering theory around revision
> history.
>
> For a little background info, I'm dealing with lesson plans that will need
> to be edited by many different sources. I like the way wikimedia handles
> revision history, but I'm just curious what my options are.
>
> Thanks,
>
> Nate
>

I don't have any links for you, but I do have a question.  How is your
data being stored?  Is it a single text value?  Is it a lot of join
records spanning multiple tables?  Depending on your answer you're
going to have to handle things quite differently.  Duplicating a
single record is much easier.

Text based revisions are a bit different than a HTML revision too.
With HTML all sorts of code changes could have happened without a
single visual change.  In that case should you really show the user a
difference?  It depends on your target.

--- End Message ---
--- Begin Message ---
I hope I can explain what I am trying to do.
I have two tables the first one has the custom form elements


elements_id elements_field_type elements_field_caption members_id
      35          text                   test              8
      36          text                   test2             8


The second one has the customer id and the field value withe the field name

dbelements_field_name   dbelements_field_value  members_id customer_id
          35               Test This Field           8        346
          36                                         8        346
          36               Test2                     8        347


If you look at the second table you will see that one field name is
related to two different customers and one field name on relates to one customer.
I am trying to look at these two tables and find customer that do not
have a row for each field name.

I have been trying with

array_combine($dbelements_field_array,$dbelements_id_array)
and also array_diff($customf_array,$dbelements_field_array)

This are the tables  I /am using to create the arrays

/$contactsql = "SELECT * FROM contacts WHERE members_id = '8'";
$contact_result = |mysql_query|($contactsql);
while($contact_row=mysql_fetch_array($contact_result)){
$contactid_array[] = $contact_row['id'];
}
$sql1 = "SELECT * FROM dbelements WHERE members_id = '8'";
$sql_result1 = |mysql_query|($sql1);
while($row1=mysql_fetch_array($sql_result1)){
$dbelements_field_array[]=$row1["customer_id"];
$dbelements_field_array[].=$row1["dbelements_field_name"];
}

$sql2 = "SELECT * FROM customformelements WHERE members_id = '8'";
$sql_result2 =  |mysql_query|($sql2);
while($row2=mysql_fetch_array($sql_result2)){
$customf_array[]=$row2["formelements_id"];
}

Could somebody get me going in the right directions




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---

Reply via email to