forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Video Playback

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
thsock



Joined: 25 Sep 2005
Posts: 25

PostPosted: Thu Sep 29, 2005 12:27 pm    Post subject: Video Playback Reply with quote

Does luaplayer have a video playback function? I bet not.
Back to top
View user's profile Send private message
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Fri Sep 30, 2005 7:56 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Fri Sep 30, 2005 8:20 am    Post subject: Reply with quote

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
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Gary13579



Joined: 15 Aug 2005
Posts: 93

PostPosted: Fri Sep 30, 2005 9:35 am    Post subject: Reply with quote

Oh, right, stupid me ^_^
I can't belive I acutally thought that would work..

You could convert everything into pixels and find a way to blit each scene, dunno how fast that would be though.
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Fri Sep 30, 2005 6:13 pm    Post subject: Reply with quote

sorry to get some information from other pages to here but i think this is not offtopic...

Quote:
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.


look at my signature and do what you have to do .oO(grab the code, if available, and put it into luaplayer *grhr*)

greets Lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
2Xtremes2004



Joined: 31 Aug 2005
Posts: 53

PostPosted: Sun Oct 09, 2005 4:22 pm    Post subject: Reply with quote

I totaly agree with LuMo on this one! };-)
_________________
I want my money back!?
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Mon Nov 28, 2005 10:36 pm    Post subject: Reply with quote

Quote:
loading an image sequence from ms isn't that easy, cause loading is bit slow... so movie would lag (think so)

A certain amount of frames can be loaded into RAM at once before playing
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:

--
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


Cheers, Art.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Nov 28, 2005 10:53 pm    Post subject: Reply with quote

Art wrote:
code


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.
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Tue Nov 29, 2005 12:11 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mrn



Joined: 02 Nov 2005
Posts: 116

PostPosted: Tue Nov 29, 2005 3:39 am    Post subject: Reply with quote

Quote:
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...........

^ quoted from:
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
Back to top
View user's profile Send private message
link



Joined: 19 Oct 2005
Posts: 61

PostPosted: Tue Nov 29, 2005 11:18 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Julu Julu



Joined: 01 Nov 2005
Posts: 9
Location: Germany

PostPosted: Thu Dec 01, 2005 5:26 pm    Post subject: Reply with quote

@Shine
"This code really sucks :-) What do you do when you have 1000 images?"
:)


You can load the images in an Array.

barneyPics = { }
for i=1, 1000 do
barneyPics[i] = Image.load("barney" .. i .. ".png")
end
Back to top
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Fri Dec 02, 2005 4:41 am    Post subject: Reply with quote

I think I'd rather see some true video stuff or even gif animation support then 1000 images loaded into an array...
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Fri Dec 02, 2005 4:51 am    Post subject: Reply with quote

MikeHaggar wrote:
I think I'd rather see some true video stuff or even gif animation support then 1000 images loaded into an array...


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.
Back to top
View user's profile Send private message
SiGi



Joined: 20 Oct 2005
Posts: 11
Location: Phoenix, AZ

PostPosted: Fri Dec 02, 2005 1:44 pm    Post subject: Reply with quote

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:




--
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

Back to top
View user's profile Send private message
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Fri Dec 02, 2005 2:07 pm    Post subject: Reply with quote

It may be laughable to some, but everyone starts somewhere!!

Give the beginners a break, or, like you did do... some help :-)
_________________
www.smartwave-wireless.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group