How to play avi/mp4 etc, programmatically

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
polomint
Posts: 5
Joined: Sat Mar 11, 2006 12:25 am
Location: Colne, Lancashire, UK
Contact:

How to play avi/mp4 etc, programmatically

Post by polomint »

Hi,

I'm working on a PSP version of 'Deal or No Deal', but would like to have a video intro for it. Is there a way to play video files through my own code? If anyone wants to know what 'Deal or No Deal' is then take a look at http://www.channel4.com/deal
It's the UK version of a US show.

Thanks in advance for any help,

Polo
__________________
In development: Deal or No Deal on PSP
In development: UK TV Guide on PSP
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

I also want to know if this is yet possible or if it isn't, i'm also making a game with a movie intro but don't know how to play it.

thanks in advance
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

you can use PMPMod, but there are some consequences:
- release your work under GPL licence
- your executables size will raise of about 2MB
- works only on fw 1.5
polomint
Posts: 5
Joined: Sat Mar 11, 2006 12:25 am
Location: Colne, Lancashire, UK
Contact:

Post by polomint »

jonny wrote:you can use PMPMod, but there are some consequences:
- release your work under GPL licence
- your executables size will raise of about 2MB
- works only on fw 1.5

Thanks for that, I'll have to take a look at it. i'm not too bothered about filesize as there may be quite a chunk of audio/video in my game..
Thanks again..
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

found an example that show how to play:

http://forums.ps2dev.org/viewtopic.php?p=32268#32268

(also reducing the max allocation in pmp_decode.h will be probably required)
polomint
Posts: 5
Joined: Sat Mar 11, 2006 12:25 am
Location: Colne, Lancashire, UK
Contact:

Post by polomint »

Ta. :)
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

jonny wrote:you can use PMPMod, but there are some consequences:
- release your work under GPL licence
- your executables size will raise of about 2MB
- works only on fw 1.5
Compile PMPMod as a PRX, and let your program pass an argument to the PRX to start the video. Then just release the PRX + source code.
That should keep it GPL-legal, correct?
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

afaik, in this case only eventual modification in the module need to be released.

the negative point of this method is that, the first time gets called, the mp3 lib takes ~6 seconds to initialize some static data (so you'll have to wait this for every video instead of only for the first one)

actually, if someone want to statically link pmpmod but don't want to release the source, can always ask/discuss this with me (if the project is completely free/there is no money involved, i will probably agree)
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

Hmm.. Wouldn't it be possible to load the static MP3 stuff in the very begining of your program (pass a special argument to the PRX), then let the PRX run in the background?
Somehow communicate to the PRX, using message boxes (if possible).

Not sure if any of this is possible, just speculation.
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

really dunno if it's possible (but the type of iteration you describe probably violate gpl / it's a sort of dinamically linking)
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

since when is dynamic linking violating the gpl? *shrug*
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

afaik since always

http://www.fsf.org/licensing/licenses/g ... luginsInNF
(see: "Can I apply the GPL when writing a plug-in for a non-free program?" & "Can I release a non-free program that's designed to load a GPL-covered plug-in?")

this seems also logical.
suppose you are writing, for example, a video encoder, using the XviD library (XviD is GPLed).
linking it statically or dinamically doesn't change things too much, actually you are creating a single program that use GPL code.

the permitted limit is when your program use GPL code "as an external program".
in the example above: i could write a command line encoder and release it under GPL; after this i could write a GUI for the encoder, in this case i'm not in need to release the GUI under GPL (but the only things the GUI can do are call the encoder with parameters, wait for end and check for eventual return codes)
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

ehrm. if dynamic linking to something that is not gpl would be a gpl violation, then what about
- binary drivers (links against the linux kernel)
- anything compiled for windows (links against various windows libs)

?

(maybe the link you were giving talks about the v2 gpl, which is a lot more restrictive?)
jonny
Posts: 351
Joined: Thu Sep 22, 2005 5:46 pm
Contact:

Post by jonny »

ehrm. if dynamic linking to something that is not gpl would be a gpl violation
?
we are talking about dynamically linking something that IS under gpl (and yes, v2)
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

we are talking about dynamically linking something that IS under gpl (and yes, v2)
err yes ofcourse, link something that isnt gpl with something that is. (if both would be gpl then there would obviously be no problem at all :))

in any case that only proves the point why i dont like gpl (and even less v2)
Post Reply