pantson.MPEG

BlitzMax Forums/BlitzMax Programming/pantson.MPEG

PantsOn(Posted 2007) [#1]
Hi

Theres has now been a huge update to this module and for pantson.YUV.

Playback is a lot quicker so movies with a greater resolution will keep to the 25fps/30fps.

Playback can now be drawn directly onto images so alpha scaling and rotation is easily done.

To make the playback quicker, I have re-written the YUV convertor in C and also using lookup tables. (approx 32MB of extra memory)

Also if creating a pixmap.. the format to use is PF_STDFORMAT now, as this is the default for images too.
Movie will only draw to its correct size. No scaling.
Use setscale for this. (I may rewrite this in a later version)

again it can only do true MPEG streams.. you may have to use ffmpeg to convert your movies.

still no sound support.

command reference..
OpenMPEG
DrawMPEG
DrawMPEGimage
PauseMPEG
MPEGfullscreen
CloseMPEG
MPEGwidth
MPEGheight
StartMPEG
EOM

This lib is under the GPL license.


tonyg(Posted 2007) [#2]
This is getting to be very very good.


Grey Alien(Posted 2007) [#3]
I'm waiting for the go ahead to use this in my game. Currenty it's either MPEG or me manually animating the intro and outro....pros and cons.


PantsOn(Posted 2007) [#4]

I'm waiting for the go ahead to use this in my game


who from?? is there licensing issues?


tonyg(Posted 2007) [#5]
What would the cons be?
How do you extract an ogg for the sync'ed sound?


jhans0n(Posted 2007) [#6]
Strange. The included pixmap demos work fine, but on my PPC Mac, the image demos show white boxes instead of the video. The workaround seems to be to put a drawtext command in there after the video is drawn. Then it works.

Video playback is MUCH smoother than before. Great job!


LAB[au](Posted 2007) [#7]
Strange ... on vista too. Needs the same workaround as on PPC Mac.


PantsOn(Posted 2007) [#8]
argghhh.. i've just noticed that too..
hmmm

if it uses openGL then the first frame is good, every other frame after that is a white box.

On the case for a fix... hang on
apologies


Grey Alien(Posted 2007) [#9]
TonyG: Pros and Cons...

Pros:

- Artist has more flexibility as to what he can do.
- It saves me time as I don't need to code all the animation parts, I can just play a movie. Although I still have to investigate the technology.

Cons:

- Not sure how big file sizes would be compared to if I had pure images and animated them... It could actually turn out similar anyway with well compress files.
- Compressed Mpegs may not look "great". If I animated it manually, it would be perfect quality but Artist would need to keep the anims simple.
- Sound people would need to make a "sound track" for the intro. If I animate manually I can "trigger" the sounds at key points...


PantsOn(Posted 2007) [#10]
the archive has been updated to 1.21
This contains a temporary fix for OpenGL systems.


bruZard(Posted 2007) [#11]
thank you for share!! :)


jhans0n(Posted 2007) [#12]
Your newest version works great in all my test cases. Thanks again for this great module. :)


gameshastra(Posted 2007) [#13]
Hi,
I am not able to play my mpg files. I tried converting my file using ffmpeg but the ffmpeg tool gives an error message unknown codec mpegvideo
Please help.
Regards,
Ramesh


gameshastra(Posted 2007) [#14]
Hi,
Is sound support not included in the mpeg module?
Regards,
Ramesh


gameshastra(Posted 2007) [#15]
Hi,
I am not able to play my mpg files. I tried converting my file using ffmpeg but the ffmpeg tool gives an error message unknown codec mpegvideo
Please help.
Regards,
Ramesh


PantsOn(Posted 2007) [#16]
the lastest ffmpeg doesn't need the -vcodec or -b options.
just use

ffmpeg -i movie.avi -sameq -an -f mpeg2video output.mpg




gameshastra(Posted 2007) [#17]
Thank You very much. That worked. I have a doubt, In the converted mpeg file I am not able to extract the audio whereas it is possible on the original file. Thanks a lot anyway for your help.
Regards,
Ramesh


gameshastra(Posted 2007) [#18]
I have a c++ code for extracting a .PPM file from mpeg. How do I pass this image back to BlitzMax so that it can be used as a TImage


PantsOn(Posted 2007) [#19]
gameshastra..
Thats a whole new topic of C integration with Blitz.
In theory you need to send a mem pointer to Blitz so that Blitz then can convert the ppm data and draw it onto the pixmap of the image.
Or get C to draw onto the pixmap by sending the pointer of the pixmap in the image to the C code.

Kinda like how by YUV to pixmap functions work.

PS I have now released version 1 of the Theora movie player.
This is free for commercial unlike the MPEG you don't have to provide code.


badbrad(Posted 2007) [#20]
on linux box i keep getting "cant find interface for module pantson.mpeg".. where do i put this thing?!?!


iprice(Posted 2007) [#21]
Sorry to sound like a complete simpleton, but how do I use this module? Do I have to place certain files/folders in certain areas of BMax?

There doesn't appear to be a ReadMe for usage.


tonyg(Posted 2007) [#22]
Create a panston/mpeg directory under mod and put the files in it. You might need to build modules which will need MinGW


badbrad(Posted 2007) [#23]
thanks tonyg..

ok i made a BlitzMax/mod/pantson/mpeg dir and copied files to it.. no joy :(
apparently if running linux (as i am) u dont need MinGW.. i tried building module via ide menu and it appears to compile nothing.
anybody got this running under linux?


iprice(Posted 2007) [#24]
Cheers tonyg and many thanks to Rich for crerating this.


xlsior(Posted 2007) [#25]
ok i made a BlitzMax/mod/pantson/mpeg dir and copied files to it.. no joy :(


It should be under: blitzmax/mod/pantson.mod/mpeg.mod

(Look at some of the other subfolders under /mod/ and see what their filestructure is.)


badbrad(Posted 2007) [#26]
right ive made a blitmax/mod/pantson.mod/mpeg.mod drawer and plonked the mpeg stuff there and have got a little further.. :) its looking like blitz is happy with the mpeg stuff but is now complaining about being unable to find yuv interface.. (i thought the yuv was included in the mpeg module).. anyways i downloaded pantson.yuv and created blitzmax/mod/pantson.mod/yuv.mod and put it there but no joy.. it cant find the interface for module pantson.yuv


gameshastra(Posted 2007) [#27]
Is it not possible to get a version of the MPEG mods under the LGPL license? Since ffmpeg is under the LGPL license.
By using only the features of ffmpeg under LGPL shouildn't it be possible to develop a LGPL version. This would be a good option for developers.

My Regards


gameshastra(Posted 2007) [#28]
Is it not possible to get a version of the MPEG mods under the LGPL license? Since ffmpeg is under the LGPL license.
By using only the features of ffmpeg under LGPL shouildn't it be possible to develop a LGPL version. This would be a good option for developers.

My Regards


xlsior(Posted 2007) [#29]
Is it not possible to get a version of the MPEG mods under the LGPL license


Of course it's possible -- except until now no one has actually written a mod for blitzmax based on it. :-?
(Or if they did, they haven't mentioned it anywhere on the forums)

Chis Camacho also created an mpeg player for BlitzMax, but it is based on LibMPEG2, and is also under GPL.


PantsOn(Posted 2007) [#30]
i have had this running under linux.. will test again later.
(PS I use MEPIS, if that makes a differnce)

Persinally I wouldn't use MPEG due to the license limitations.