![]() |
Re: A couple of Mediabox questions
Quote:
|
Re: A couple of Mediabox questions
Is there a media player that can play video in slow motion? Or is any way to add this feature to one of the player easily. I need it badly.
|
Re: A couple of Mediabox questions
Quote:
|
Re: A couple of Mediabox questions
It is not easy to use command line in mplayer to view just a part of the video, ( eg: type in slow motion, start time, stop time etc). But if there is no other way, I may try it. Thank you VulcanRidr.
|
Re: A couple of Mediabox questions
I love mediabox and it is the only media player I use, but mplayer directly for video. And the last update to the UI is awesome.
Thank you very much, pycage. I have just one suggestion: a very low cpu usage mode (because battery life). I'll explain, with 0.9.3 (or was it 4?), before the last UI update, playing music from collection view and then switching the to playlist-player view, would left the python process using just 0.3% cpu. Now it is impossible to get it under 5% (which has some battery consecuences). My user scenario is listening music at work with earbuds, device closed in lowest comsumption mode to get the most battery life, no UI to look at or fiddle with unless opening a new album. And a bug report: since last update, shoutcast radio is played using whatever backend is set for mp3 files (not obvious at all). osso-media-player backend, the default for mp3, doesn't work for internet radio in mediabox (starts "buffering..." and remains there forever). That means shoutcast radio doen't work unless the user changes the mp3 backend to mplayer Another bug/improvement report: when playing internet media, because of connection problems, mplayer may become "stuck", making it impossible to simply change to another channel. Since there is only a "pause" button in the UI, pressing it will send a "pause" signal to the stuck mplayer process (which ignores it), and the only way to "unstuck" mediabox is to swich to a xterm and issue a killall mplayer. It also happened to me that the mplayer process kept there running in the background "paused", and draining all battery over the night. Providing a "stop" button which kills the mplayer/osso-media-player child process would solve this issue. |
Re: A couple of Mediabox questions
Quote:
Quote:
Quote:
Quote:
|
Re: A couple of Mediabox questions
Quote:
All this data has been gathered using mediabox to play a "internet radio" stream (currently soma fm http://steady.somafm.com:8032 stream). The audio/unknown mime type handler is set to mplayer, so the stream is played with mplayer. The python cpu process usage is about 20% while playing this stream. I ran a profile on mediabox; it shows most of the time is spent in the send_event method of MessageBus.py The mediabox debug output shows __on_observe_player sends about 5 MEDIA_EV_POSITION + CORE_ACT_SET_INFO events per second. The code is complex and I don't understand it, so I can't propose a patch, but commenting out lines 269 and 273 from AudioWidget.py fix the cpu issue, making python use about 0.1% CPU if in "browser" screen (so there is no title label scrolling). [EDIT: After some head banging to understand a bit of the code, I'm making a patch to increase efficiency in MessageBus. I think I have had success to some degree. Need to profile a little more] Profiling data Code:
>>> p.sort_stats("time").print_stats(15)Code:
2009-08-28 20:54:37.198 - DEBUG --- *** CORE_ACT_SET_INFO('5:49',) ***Quote:
Quote:
|
Re: A couple of Mediabox questions - PATCH/FILES INCLUDED
4 Attachment(s)
Now, I have got it. Hope you like it.
This is my third version of the MessageBus system, and it is 2,6 times faster than the original version. In the first version, I used python instrospection to get the handler_X methods and store them in a dictionary, getting rid of the expensive hasattr() calls in the process. This got about 15% efficiency increase. It shows in the profiling, but the %cpu seems unaffected. In the second version, I switched from dicts to lists, this got an additional 10-15%. %cpu went from 20% to 17% in the test case. Good, but clearly not enough. The main problem I saw with MessageBus.send_event() is the big number of calls for each message, most of them just to do nothing because inherited Mediator.handle_message() in all mediators. So, why not get rid of those calls? In the third version, I implemented a handler list for each message, getting rid of the mediators which just happen to have the inherited handle_message(). This reduced the number of calls for each message from 53 to 16-22 (there are still too many handle_message() methods). This increased efficiency a lot more, and %cpu went all the way down from 20% to 8% Now, the more remaining mediator.handle_message() converted to handle_X methods, the better. Some profiling data: Original MessageBus Code:
>>> porig.sort_stats('time').print_stats(10)Code:
>>> plist1.sort_stats('time').print_stats(10)EDIT: Found and fixed little bug in lines 231 and 236 of AbstractBackend.py that caused delay=200 forever. Also changed the "long" delay to 0,5 s to make the time label update regular. With this, the number of messages/second goes to 4. Improved AudioWidget.__on_observe_player to send messages only when there are visible changes. With this, we are down to 1-2 msgs/s Now we are in 1.5-4% cpu usage |
Re: A couple of Mediabox questions
Great work on this, maacruz! :D
Your optimization on MessageBus look very interesting. This is central piece of MediaBox' component plugin system, so it's a good start for optimizations. handle_message() will eventually be removed as it has been replaced by direct handle_<MESSAGE> calls and introspection. It's still in use in some places, but I want to get rid of those. Keep up the good work! :) I'm currently working on getting rid of the ImageStrip class, replacing it with a faster, cleaner, and more versatile implementation. |
Re: A couple of Mediabox questions
Thanks :)
So, now an easy task for me for today: replace as many handle_message with handle_<MESSAGE> as I can. In doing so, I have found a number of components that have handle_message method but do not register as mediators in MessageBus: components/media_widgets/VideoWidget.pyIs this intentional or there is a bug somewhere? |
| All times are GMT. The time now is 00:12. |
vBulletin® Version 3.8.8