pantson.theora v1.1

BlitzMax Forums/BlitzMax Programming/pantson.theora v1.1

PantsOn(Posted 2007) [#1]
Hi

New update of the theora module.
new command
TheoraFullscreen - sets drawing scale

fixed in this version
docs and memory (de)allocation

have fun


xlsior(Posted 2007) [#2]
Nice!

Sound seems to be in sync as well.

Any idea how the CPU utilization scales across various computers? Taskmanager shows about 45% used on my Core 2 Duo E6600 (2.4GHz), but I'm kind of curious how it behaves on a lower end computer...


PantsOn(Posted 2007) [#3]
it should use as much processor as required...
if it can't draw as fast as it should be able to, the frame rate will drop.

On my machine the processor is at 100%.


mongia2(Posted 2007) [#4]
for a audio in a mpg?


PantsOn(Posted 2007) [#5]
mongia2... this for drawing a theora format movie

PS a new version has been upload.
Theora v1.2
- PauseTheora now working
- CloseThoera now working correctly. sets movie to NULL after
- All YUV now in pantson.theora (works a bit faster). no longer need pantson.YUV


popcade(Posted 2007) [#6]
Thans PantsOn, this is definitely the most powerful video playback module.

It's a pity BlitzMax has no it's own audio streaming.


xlsior(Posted 2007) [#7]
it should use as much processor as required...
if it can't draw as fast as it should be able to, the frame rate will drop.


Will it simply draw them slower, or will it also skip frames in the process?

If the former, I'd expect the audio and video to get out of sync?


PantsOn(Posted 2007) [#8]
xlisor....

it will skip frames.

The easy test is to drap the window around in the sound.bmx example.. this will delay the drawing, but the picture will be back in sync once you let go of the mouse button.

The only time it will get out of sync is if you pause the movie without pausing the sound.


xlsior(Posted 2007) [#9]
Nice.

definitely sounds like a very useful mod, and I'm impressed by how fast you managed to implement it, too.

It would be interesting to see this as an 'official' addition to bmax.


PantsOn(Posted 2007) [#10]
cheers for the feedback.
A lot of the work was done in the last month for the pantson.yuv and pantson.mpeg modules.
The hard bit of the theora module was getting a yuv picture out of the file. Once i had that, I called the YUV mem references with pantson.yuv module and that drew the picture.
All the timing stuff was done in the mpeg module so that was a copy and paste.

I'm just glad there is a license free movie player for blitz now.


gameshastra(Posted 2007) [#11]
Is there sound support in theora?


PantsOn(Posted 2007) [#12]
there is sound support in the theora format, but not in this module. I will be looking into it, but not for a while. Till then there is a workaround as shown in the examples.

There is no extra DLL/code needed for theis to work on other platforms.


PantsOn(Posted 2007) [#13]
to convert your movies, use ffmpeg2theora
http://v2v.cc/~j/ffmpeg2theora/


gameshastra(Posted 2007) [#14]
How can I check if the current frame is the last frame of movie and what do I do to Fast Forward the movie


gameshastra(Posted 2007) [#15]
While we play the video and audio separately. How do we achieve synchronism. When for example the video slows down due to CPU usage. I don't yet have a strategy to handle this.


xlsior(Posted 2007) [#16]
While we play the video and audio separately. How do we achieve synchronism. When for example the video slows down due to CPU usage. I don't yet have a strategy to handle this.


I haven't tried this yet myself, but from what PantsOn said above:


it will skip frames.

The easy test is to drap the window around in the sound.bmx example.. this will delay the drawing, but the picture will be back in sync once you let go of the mouse button.



So... supposedly it's already taken care of. :-?


gameshastra(Posted 2007) [#17]
How can I check if the current frame is the last frame of movie


gameshastra(Posted 2007) [#18]
When will there be Theora support for MAC. Our project requires to be compiled on multiple platforms. We need video support for MAC without a GPL restriction


PantsOn(Posted 2007) [#19]
HI everyone..

I'm back from holiday now.
Just to answer a few questions about pantson.theora.

1) For those who don't know what it does
It allows BlitzMax to play Theora format movies. GFX only, no sound. http://www.theora.org/. Theora is a royalty free format for commercial (unlike MPEG and DIVx)
To convert your movies see http://www.v2v.cc/~j/ffmpeg2theora/

2) I have not tested the module on MAC, but the module is virtually a copy of the MPEG module I wrote anf that worked on MAC. It will need compiling on MAC. Please use this thread to report any problems.

3) Audio Sync'ing is taken care of when playing external sounds. See examples.

4) Use EOT to check if its "End Of Theora".

PS I have ideas for pantson.theora v2.0 (still no sound though)


jhans0n(Posted 2007) [#20]
It definitely runs on the Mac. I have it compiled on my old G4 Mac and it runs like a champ.


DJ Scantron(Posted 2007) [#21]
Doesn't BMax already have a Vorbis module?
I wonder how hard it would be to add sound?


PantsOn(Posted 2007) [#22]
the built in vorbis lib doesn't stream sound. It has to load it into memory.
I have been given pointers by a fellow blitzer for streaming ogg sound, but it will take a while at the mo due to other commitments.


tonyg(Posted 2007) [#23]
How about merging it with Redi's MaxMod if possible?


PantsOn(Posted 2007) [#24]
this module automatically creates a lot of lookup tables for the YUV conversions.
if you don't need movies I suggest you don't import this module as memory will be used for no reason.

I may change this in future.


gameshastra(Posted 2007) [#25]
The video is not playing working on a lower end machine. Please inform what the minimum configuration is required and what is the workaround for a lower end machine.


gameshastra(Posted 2007) [#26]
Addendum to prev question:
Requirement to play video on lower end machine is a critical requirement for our project. Your help is solicited.

Regards,
for gameshastra


Dreamora(Posted 2007) [#27]
Whats your video size and what do you mean by lower end?

320x240 should run on 600-800 Mhz machines.

640x480 and especially 1024 and higher will need much more performant systems as the decompression is CPU side (most videos you are watching today normally are actually GPU decoded not CPU anymore, otherwise a 1280x720 would need 3ghz at least for realtime)