|
|
Home » Developing U++ » U++ Developers corner » MediaPlayer is out
|
Re: MediaPlayer is out [message #30317 is a reply to message #30314] |
Fri, 24 December 2010 13:03 |
|
Hi Koldo,
Wonderful Christmas gift!
I had a quick look at the audio playback part and I think it will be possible (and probably not very hard) to make a switchable PortAudio backend. The architecture is very similar and you already did all the hard work. I think that it will need just a few #defines... I'll have a look at it during the holidays.
Good work
Honza
PS: I'm still thinking do we really need the SDL part? If the audio can be played using PortAudio, couldn't we also display the raw image data using U++ and get rid of the dependency?
|
|
|
|
Re: MediaPlayer is out [message #30321 is a reply to message #30319] |
Fri, 24 December 2010 15:25 |
|
jerson wrote on Fri, 24 December 2010 14:25 | I am a bit uninitiated, so I do not know how to.
I got the sdl and ffmpeg libraries shown in the links. Do I also need to download the nightly build to get access to the media player etc?
|
Hi Jerson,
You need fresh U++ sources, version 2924 or newer. Last nights build is just fine. There is a package MediaPlayer in bazaar. If you have all the libraries, it should compile just fine. Just give it a try with some audio or video files
Honza
|
|
|
|
|
|
|
|
|
|
|
|
Re: MediaPlayer is out [message #30488 is a reply to message #30314] |
Tue, 04 January 2011 19:13 |
|
Hello guys,
I learned quite a bit about ffmpeg reading Koldos sources and the documentation on the web (altough it is lacking many important things - almost like U++ docs ).
The result of my work in this field is a conclusion that audio/video playback is really possible using only U++ ffmpeg and portaudio. In the attachment you will find a proof of concept video player. It is very simple compared to the one Koldo published, but it is a learning tool for me and as such it is adequate. Its main characteristics are: oversimplified, single threaded, blocking (no UI interaction while playing).
The video display is done using SetSurface, which proved to be fast enough for this purpose (good work, Mirek! ). Scaling and YUV->RGBA conversion is done in single step using sws_scale from libsws that comes with ffmpeg. It should use hardware acceleration where available, but on my system everything was done in software. The rescaling uses bilinear algorithm. I tested with bicubic as well but it became very slow for higher resolutions. The audio output is done in the simplest possible way using blocking SoundStream from my Sound package published in bazaar. The blocking nature of the sound API is also misused to provide audio-video syncing. For mute videos there is a quick hack to make Paint() block until it is the right time to output the image.
If you decide to test, I recommend you to try with shorter movies. Once you start it, it runs until the end (or SIGKILL). No seeking, no pause, no interaction while playing. This should be actually easy to fix using threads and some pieces of code from Koldo.
I tested this on my Intel Atom netbook, i.e. with no graphics card to speak of. I got fluent playback for most of the movies on my hard-drive, but didn't test any HD clips. Actually the slowest part is the resizing, so if the HD resolution matches with your monitor resolution, it should play fine For me there were some sound buffer underflows when playing better quality movies on fullscreen (1024x600), but playing them in native resolution was fine.
I left few RTIMING macros in the code so you can make your idea about how fast each part of processing is Generally speaking audio decoding is very fast, SetSurface scales linearly with size but the scaling can do weird thing depending on the size and on original resolution.
So to sum it up: ffmpeg+portaudio+U++ is a combination sufficient to do most of the common video processing and SDL dependency will most definitely be dropped soon. Which is IMHO great news
Best regards,
Honza
|
|
|
|
Re: MediaPlayer is out [message #30495 is a reply to message #30489] |
Wed, 05 January 2011 10:06 |
|
koldo
Messages: 3394 Registered: August 2008
|
Senior Veteran |
|
|
Hello Honza
This post is about MediaPlayer. If you want to do other things please open a new post.
I do not understand you: I informed many months ago about this project and its advance. I released it a couple of weeks ago and now, voilà, you release a package to do almost the same.
One week ago we chatted in ICQ about it and I opened the package to you, to do a join effort. Now you break your word and do it by yourself without any previous comment. For me it is dishonest, it is a backstab.
It is true anybody can take, lets say, all U++ project and open tomorrow a new project in Sourceforge, a new web page, change a few things including the name and logo, and begin a new project. It is legal. The license permits it. It is called fork. But if there is no previous provocation and if the original project has been fair and all project contributors have had opportunities proportional to their effort, to open a fork is not fair.
For sure I am of the old school. But if U++ project acts this way I do not want to be here.
Best regards
Iñaki
|
|
|
|
Re: MediaPlayer is out [message #30499 is a reply to message #30495] |
Wed, 05 January 2011 11:28 |
|
koldo wrote on Wed, 05 January 2011 10:06 | Hello Honza
This post is about MediaPlayer. If you want to do other things please open a new post.
I do not understand you: I informed many months ago about this project and its advance. I released it a couple of weeks ago and now, voilà, you release a package to do almost the same.
One week ago we chatted in ICQ about it and I opened the package to you, to do a join effort. Now you break your word and do it by yourself without any previous comment. For me it is dishonest, it is a backstab.
It is true anybody can take, lets say, all U++ project and open tomorrow a new project in Sourceforge, a new web page, change a few things including the name and logo, and begin a new project. It is legal. The license permits it. It is called fork. But if there is no previous provocation and if the original project has been fair and all project contributors have had opportunities proportional to their effort, to open a fork is not fair.
For sure I am of the old school. But if U++ project acts this way I do not want to be here.
|
Hi Koldo,
Please don't get me wrong. The package I posted here definitely does not focus on the same things as the MediaPlayer and I did not have any intentions to steal your credit.
The purpose why I did this was to learn better the ffmpeg internals to be able to help you with the portaudio sound, just as we talked about. I was also interested in the possibilities of SetSurface, as it would allow to drop SDL completely, which we agreed to be a worthy goal. So that is a reason why I didn't concentrate only on audio but also put in the video part. Working directly on your sources was just too difficult for me to begin with, so I decided to create the simplest possible implementation to learn how the things work.
I wouldn't call this fork. Yes, I was partly inspired by parts of your code, but the main part was based on an ffmpeg example source (about saving video frames to picture files). The whole thing is a stub, mere learning tool or demo, not suitable for use for any other purpose. I was hoping that you would look at it and reuse (or just get inspired by) the important parts, that is the audio output and sws_scale&SetSurface usage.
I believe this is just misunderstanding and that you will understand my reasons and intentions now.
Best regards,
Honza
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 04:35:13 CEST 2024
Total time taken to generate the page: 0.02517 seconds
|
|
|