Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Is it possible?
Is it possible? [message #29837] Sun, 21 November 2010 09:43 Go to next message
Wlad is currently offline  Wlad
Messages: 20
Registered: February 2010
Location: Ukraine, KharkOv
Promising Member

Is it possible to show 30 "fps" (Size = 704x576x32) using standard U++ widgets?
"Frames" are the jpeg images saved in a BIG file consequentially (one after other without gaps).

[Updated on: Sun, 21 November 2010 09:45]

Report message to a moderator

Re: Is it possible? [message #29838 is a reply to message #29837] Sun, 21 November 2010 12:23 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Wlad wrote on Sun, 21 November 2010 09:43

Is it possible to show 30 "fps" (Size = 704x576x32) using standard U++ widgets?


Hi Wlad,

Theoretically yes. Not sure how much standard do you need the widgets to be, but a simple custom control using standard U++ capabilities gives about 40fps for the resolution you asked about on my machine (intel atom netbook, no high performance system Wink ). The code can be something like this:
class MyAnim: public Ctrl{
public:
	Image img;
	typedef win CLASSNAME;
	void Paint(Draw& w){
		SetSurface(w,0,0,704,576,img);
	}
	win(){
		//some initialization here
		SetTimeCallback(-1,THISBACK(Next));
	}
	void Next(){
		img = LoadNextFrame(); //you'd have to implement this one, but it should be simple
		Refresh();Sync();
	}
};

Note that the code is not complete, it's purpose was only to benchmark the speed. It plays as fast as it can; to achieve a given frame rate, you would have to control that better. The SetTimeCallback solution is simple, but probably not optimal. Also it produces some flicker, you would probably have to add bit more logic to avoid that.

Wlad wrote on Sun, 21 November 2010 09:43

"Frames" are the jpeg images saved in a BIG file consequentially (one after other without gaps).

This could be a problem. Decoding jpeg is not very fast. With some random 704x576 images I got about 50ms to load and decode. That limits the performance a lot (for comparison SetSurface() in above code takes only about 10ms), unless you are able to get the images buffered in memory before playing (or doing it in second thread, while playing). That should be easy for some reasonably low number of frames, but quite challenging for long animations.

Are you trying to play a movie or some kind of animation? I would recommend you to experiment with other image formats if you can, they might cheaper decoding. For GIF or multipage TIFF, you could use RasterPlayer, but the price to pay there would be probably a quality.

Best regards,
Honza
Re: Is it possible? [message #29841 is a reply to message #29838] Sun, 21 November 2010 16:30 Go to previous messageGo to next message
Wlad is currently offline  Wlad
Messages: 20
Registered: February 2010
Location: Ukraine, KharkOv
Promising Member

Hi, Honza!

>>>Are you trying to play a movie or some kind of animation?

I can not change format due to it used by manufacturer of a videocamera. More precisely the format is M-JPEG. I have developed a low level hardware to achieve videoframes from several cameras and to store them in IDE flash (using my file system). Then I open this flash as an device file and try to read frames from there.
It is all right and is done as I had planned but the fps turned to be VERY slow... Smile
Now I want to apply your proposals.
Re: Is it possible? [message #29843 is a reply to message #29841] Sun, 21 November 2010 18:22 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Have a look at the forum and search for SDLCtrl and video player. Koldo is working on it currently and I believe it is just about to be finished. It uses SDL for displaying video and ffmpg for decoding, all encapsulated into U++ Ctrl. It should be capable to play the common video formats, such as M-JPEG. Don't hesitate to ask Koldo directly for further info Wink

Honza
Re: Is it possible? [message #29844 is a reply to message #29843] Sun, 21 November 2010 18:35 Go to previous messageGo to next message
Wlad is currently offline  Wlad
Messages: 20
Registered: February 2010
Location: Ukraine, KharkOv
Promising Member

TNX!
Re: Is it possible? [message #29845 is a reply to message #29844] Sun, 21 November 2010 21:24 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Wlad

MediaCtrl is not ready but I would be glad to help.

If you can, send me a sample to test it. If ok and you are in a hurry I can upload a version for you.

It is based on ffmpeg and it is possible to do video processing "ą la carte" before visualizing.

Second group of functions for saving the changes (encoding) are less advanced but something could be done if necessary.


Best regards
IƱaki
Re: Is it possible? [message #29856 is a reply to message #29845] Tue, 23 November 2010 06:09 Go to previous messageGo to next message
Wlad is currently offline  Wlad
Messages: 20
Registered: February 2010
Location: Ukraine, KharkOv
Promising Member

koldo wrote on Sun, 21 November 2010 22:24

If ... you are in a hurry I can upload a version for you.

VY TNX for your wish to help and quick answer! Smile
Yes I am in a hurry. But I have already done this work using WPF.
Thank you all very mach!!!

I suppose U++ for me will be the best choice for a time later... Smile
Of course U++ as a decision is very interesting but after C#/F#+.NET+MSVS the only lang+IDE+lib I agree to work is Qt+QtCreator (as a the most mature means to work with C++).

[Updated on: Tue, 23 November 2010 06:10]

Report message to a moderator

Re: Is it possible? [message #29998 is a reply to message #29837] Thu, 02 December 2010 13:48 Go to previous message
AnnabelleR is currently offline  AnnabelleR
Messages: 4
Registered: November 2010
Location: Usa
Junior Member
Hello,
Sorry i can't help you because i am newbie here and i am here for getting information regarding U++.So i hope you guys will help me learning about U++.
Regards,
Ali.
Previous Topic: [ASK] IBM DB2 Connector
Next Topic: Pretty GUIs
Goto Forum:
  


Current Time: Sat Apr 20 15:43:26 CEST 2024

Total time taken to generate the page: 0.02356 seconds