Video Playback
Moderators: Shine, Insert_witty_name
Video Playback
Does luaplayer have a video playback function? I bet not.
You could make a function to play custom made movies.
Basically, you need to export your movie frame by frame.
Then make a little function to loop through them all and display them.
After that, all you need to do is export the sound out of the movie and play it in the function!
There probably isn't a movie playing function, nor will there be, because I don't think there is any code out there to play movies.
Basically, you need to export your movie frame by frame.
Then make a little function to loop through them all and display them.
After that, all you need to do is export the sound out of the movie and play it in the function!
There probably isn't a movie playing function, nor will there be, because I don't think there is any code out there to play movies.
loading an image sequence from ms isn't that easy, cause loading is bit slow... so movie would lag (think so)
the only possibility i see is that you implement xvid playback *rofl*
and add that to luaplayer so ppl can just playback xvid files (hell guess some ppl would kill for that :)) )
greets
lumo, who would love xvid playback too :D
the only possibility i see is that you implement xvid playback *rofl*
and add that to luaplayer so ppl can just playback xvid files (hell guess some ppl would kill for that :)) )
greets
lumo, who would love xvid playback too :D
sorry to get some information from other pages to here but i think this is not offtopic...
greets Lumo
look at my signature and do what you have to do .oO(grab the code, if available, and put it into luaplayer *grhr*)gaeko99 has released the PSP Media Player for PSP version 0.0.5. PSP Media Player is a media player which is capable of playing AVI (DivX)/OGG/WMA files, especially DivX AVI files at 480x272 full resolution of the PSP.
greets Lumo
-
- Posts: 53
- Joined: Wed Aug 31, 2005 1:43 am
A certain amount of frames can be loaded into RAM at once before playingloading an image sequence from ms isn't that easy, cause loading is bit slow... so movie would lag (think so)
anything, so if the movie is short enough, the frame rate can be very fast.
I took 36 Worldwind shots of a mountain at 10 degree intervals, shrunk
the images down to 436x333 (to maintain perspective), and converted
them to png.
Granted 36 frames of animation doesn't sound like too much of a movie
for a 360 degree rotating camera but it is very convincing, add joystick control and it is also fun to play with.
Code: Select all
--
xx = 23
uu = -30
dd = 0
dr = 0
--
barney000 = Image.load("barney0.png")
barney010 = Image.load("barney10.png")
barney020 = Image.load("barney20.png")
barney030 = Image.load("barney30.png")
barney040 = Image.load("barney40.png")
barney050 = Image.load("barney50.png")
barney060 = Image.load("barney60.png")
barney070 = Image.load("barney70.png")
barney080 = Image.load("barney80.png")
barney090 = Image.load("barney90.png")
barney100 = Image.load("barney100.png")
barney110 = Image.load("barney110.png")
barney120 = Image.load("barney120.png")
barney130 = Image.load("barney130.png")
barney140 = Image.load("barney140.png")
barney150 = Image.load("barney150.png")
barney160 = Image.load("barney160.png")
barney170 = Image.load("barney170.png")
barney180 = Image.load("barney180.png")
barney190 = Image.load("barney190.png")
barney200 = Image.load("barney200.png")
barney210 = Image.load("barney210.png")
barney220 = Image.load("barney220.png")
barney230 = Image.load("barney230.png")
barney240 = Image.load("barney240.png")
barney250 = Image.load("barney250.png")
barney260 = Image.load("barney260.png")
barney270 = Image.load("barney270.png")
barney280 = Image.load("barney280.png")
barney290 = Image.load("barney290.png")
barney300 = Image.load("barney300.png")
barney310 = Image.load("barney310.png")
barney320 = Image.load("barney320.png")
barney330 = Image.load("barney330.png")
barney340 = Image.load("barney340.png")
barney350 = Image.load("barney350.png")
--
function frame()
if dd == 0 then
screen:blit(xx, uu, barney000, false)
end
if dd == 1 then
screen:blit(xx, uu, barney010, false)
end
if dd == 2 then
screen:blit(xx, uu, barney020, false)
end
if dd == 3 then
screen:blit(xx, uu, barney030, false)
end
if dd == 4 then
screen:blit(xx, uu, barney040, false)
end
if dd == 5 then
screen:blit(xx, uu, barney050, false)
end
if dd == 6 then
screen:blit(xx, uu, barney060, false)
end
if dd == 7 then
screen:blit(xx, uu, barney070, false)
end
if dd == 8 then
screen:blit(xx, uu, barney080, false)
end
if dd == 9 then
screen:blit(xx, uu, barney090, false)
end
if dd == 10 then
screen:blit(xx, uu, barney100, false)
end
if dd == 11 then
screen:blit(xx, uu, barney110, false)
end
if dd == 12 then
screen:blit(xx, uu, barney120, false)
end
if dd == 13 then
screen:blit(xx, uu, barney130, false)
end
if dd == 14 then
screen:blit(xx, uu, barney140, false)
end
if dd == 15 then
screen:blit(xx, uu, barney150, false)
end
if dd == 16 then
screen:blit(xx, uu, barney160, false)
end
if dd == 17 then
screen:blit(xx, uu, barney170, false)
end
if dd == 18 then
screen:blit(xx, uu, barney180, false)
end
if dd == 19 then
screen:blit(xx, uu, barney190, false)
end
if dd == 20 then
screen:blit(xx, uu, barney200, false)
end
if dd == 21 then
screen:blit(xx, uu, barney210, false)
end
if dd == 22 then
screen:blit(xx, uu, barney220, false)
end
if dd == 23 then
screen:blit(xx, uu, barney230, false)
end
if dd == 24 then
screen:blit(xx, uu, barney240, false)
end
if dd == 25 then
screen:blit(xx, uu, barney250, false)
end
if dd == 26 then
screen:blit(xx, uu, barney260, false)
end
if dd == 27 then
screen:blit(xx, uu, barney270, false)
end
if dd == 28 then
screen:blit(xx, uu, barney280, false)
end
if dd == 29 then
screen:blit(xx, uu, barney290, false)
end
if dd == 30 then
screen:blit(xx, uu, barney300, false)
end
if dd == 31 then
screen:blit(xx, uu, barney310, false)
end
if dd == 32 then
screen:blit(xx, uu, barney320, false)
end
if dd == 33 then
screen:blit(xx, uu, barney330, false)
end
if dd == 34 then
screen:blit(xx, uu, barney340, false)
end
if dd == 35 then
screen:blit(xx, uu, barney350, false)
end
end
--
------------------------
-- Start main program --
------------------------
--
while true do
frame()
--dd = dd + 1
--if dd == 36 then dd = 0 end
pad = Controls.read()
if pad:start() then
break
end
if pad:analogY() < -30 then
uu = uu - 1
end
if pad:analogY() > 30 then
uu = uu + 1
end
if pad:analogX() < -30 then
dd = dd + 1
if dd == 36 then dd = 0 end
end
if pad:analogX() > 30 then
dd = dd - 1
if dd == -1 then dd = 35 end
end
screen.waitVblankStart(5)
screen:flip()
end
This code really sucks :-) What do you do when you have 1000 images? Should be possible, if they are small images, e.g. 32x32 pixels. You should take a look at http://www.lua.org/pil/ and especially 2.5: Tables, for-loops and how to create strings. But the best would be, if someone adds mng, gif and some movie formats. Should be added with external PRX modules to avoid a to big Lua Player EBOOT.PBP file.Art wrote:code
^ quoted from:The video information inside MPEG files is stored in the frequency domain rather than in the spatial domain (the images we see). That way, the information is compacted and that compactation can be used to compress (reduce) the amount of information you have to send over the transmission channel. MPEG uses the DCT (Discrete Cosine Transform) to translate spatial information into frequency information. To bring back the spatial information from the MPEG stream you have to apply the iDCT...........
http://www.divx.com/support/glossary.php
So, DCT (for Video) and FFT (for Audio) is smthng what we REALLY NEED.
It would ... no! It will attrack many-many Video and Audio programmers,
and they will use Lua.
Just started a "feature request" thread to close .)
http://forums.ps2dev.org/viewtopic.php?t=4221
cheeeers. mrn
just have several different folders at low res.(unless you have a big ms)
at the end of each sequence just do a "dofile("scene2.lua") and have your next picture sequences code there and at the end of that do "dofile("scene3.lua") and soforth. that should be enough to get started. thats what i did for my ingame cutscenes(which are handdone so they look horrible). matching up the framerate and sound is pretty hard. if its off by just alittle, about 20 seconds into your movie it will look dubbed. I personally used the the basis of the "pixel fixer" but supsotuted the colors for my images. that way it made it easy to change my framerate.
at the end of each sequence just do a "dofile("scene2.lua") and have your next picture sequences code there and at the end of that do "dofile("scene3.lua") and soforth. that should be enough to get started. thats what i did for my ingame cutscenes(which are handdone so they look horrible). matching up the framerate and sound is pretty hard. if its off by just alittle, about 20 seconds into your movie it will look dubbed. I personally used the the basis of the "pixel fixer" but supsotuted the colors for my images. that way it made it easy to change my framerate.
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
For 1000 images with the size 32x32 you'll need to load only 4 images of size 512x512, using the tiling concept, like in my Snake game. At 30 fps this would be half a minute animation.MikeHaggar wrote:I think I'd rather see some true video stuff or even gif animation support then 1000 images loaded into an array...
Art wrote:it's faster than a for next loop :D
I just needed to figure out how to put the filenames in a table for one of
your for next loop that doesn't have any next in it.
This was realy a toy program to see if it fit in RAM.
That code is REALLY laughable. This is how it should look like:
Code: Select all
--
xx = 23
uu = -30
dd = 0
dr = 0
--
barney={}
for i=0,35 do
str="barney" .. (10*i) .. ".png"
barney[i]=Image.load(str)
end
function frame(n)
screen:blit(xx, uu, barney[n], false)
end
while true do
frame(dd)
--dd = dd + 1
--if dd == 36 then dd = 0 end
pad = Controls.read()
if pad:start() then
break
end
if pad:analogY() < -30 then
uu = uu - 1
end
if pad:analogY() > 30 then
uu = uu + 1
end
if pad:analogX() < -30 then
dd = dd + 1
if dd == 36 then dd = 0 end
end
if pad:analogX() > 30 then
dd = dd - 1
if dd == -1 then dd = 35 end
end
screen.waitVblankStart(5)
screen:flip()
end