Yalir / sfeMovie

sfeMovie is a simple C++ library that lets you play movies in SFML based applications. It relies on FFmpeg to read medias and remains consistent with SFML's naming conventions.
http://sfemovie.yalir.org/
GNU Lesser General Public License v2.1
114 stars 37 forks source link

Support for VP9 and Opus free codecs on default builds #52

Open Ceylo opened 10 years ago

bluekirby0 commented 10 years ago

I believe this is something added in my fork already.

Ceylo commented 10 years ago

Indeed :) However if you want it to be integrated, I'll need the data to complete the table at http://sfemovie.yalir.org/legal.php The user needs to be able to check whether these are really free.

bluekirby0 commented 10 years ago

Opus: Free for any use (as long as you do not participate in patent litigation against Opus) Reference implementation code is licensed BSD-style. http://www.opus-codec.org/license/

VP9: As part of the WebM project, it should have similar terms as vp8 but the specific license is not drafted for it yet. These two links provide information about the specifics available at this time: http://www.webm-ccl.org/vp8/faq/ http://www.webmproject.org/vp9/ Libvpx code is licensed BSD-style.

Ceylo commented 10 years ago

I did not answer on this but it's enough for these codecs to be officially supported. So it'll depend on when the pull request is ready :) Or I can just take care of this if you're busy.

feliwir commented 10 years ago

Hope that i did fix this issue :)

Ceylo commented 10 years ago

Indeed that should do it but please never commit directly to master >< We'll see when the Jenkins build is finished

feliwir commented 10 years ago

Okay , sorry :)

Ceylo commented 10 years ago

It went fine :) So the only check left (I let you do it if you've time) before closing this issue, is to test playing opus and vp9 streams with the binary produced by the sfeMovieRelease config.

feliwir commented 10 years ago

Both vp9 and opus were checked

Ceylo commented 10 years ago

You did not test with all the binaries from Jenkins. I just tested a vp9 sample and it doesn't work.

Actually if you look at the console output on Jenkins, the vp9 decoder isn't enabled (only the vp9 parser). And actually this is quite normal, because even if you made vp9 part of the default codecs, the build script defines its own set of codecs.

See more precisely the script run by Jenkins: ci/build-all.py. Line 40 to 44 it defines the codecs to build for the "Free" config, which don't contain vp9.

The script design is probably wrong, or the CMake system that allows choosing the codecs is lacking something.

In the first case I mean the script should not overwrite the default free decoders (but what if the default become all decoders? the "Free" Jenkins config would become meaningless). And in the second case, our CMake scripts should allow to choose between "Free" and "All" rather than select the decoders manually. But that's discutable too.

Anyway at the moment we can't close the issue :/

Ceylo commented 10 years ago

Considering that the list of free decoders doesn't often change, I guess the easiest solution for now is just to update the script accordingly.

Ceylo commented 10 years ago

Tested successfully with a vp9 sample and with binaries from Jenkins. However about opus, I always get a "no decoder for opus codec", even if I use a build of sfeMovie that includes ALL the decoders >_> the libopus decoder may not be enough or may not be what we think.

Ceylo commented 10 years ago

After a quick look to FFmpeg configure options, it looks like Opus can only be decoded from the external libopus library. So it doesn't make a good candidate for a default decoder… sorry

Ceylo commented 10 years ago

@bluekirby0 you had it working without any external library?

feliwir commented 10 years ago

I tested on linux, but i guess i has libopus library installed. Ffmpeg also has an internal opus decoder (opus). See that in the docs

Ceylo commented 10 years ago

Oh you're right, I ran configure with a newer version of FFmpeg and there is the opus decoder besides libopus. Well I guess that leaves only 1 possibility :)

bluekirby0 commented 10 years ago

If you have a static build of libopus somewhere it can be found by the linker then that works as well. Stick to the internal opus decoder though unless it proves to be deficient.

Ceylo commented 9 years ago

Now that FFmpeg has been updated these codecs can be added easily

feliwir commented 9 years ago

Those are added: https://github.com/Yalir/sfeMovie/blob/master/FFmpeg/CMakeLists.txt

Ceylo commented 9 years ago

You're right! And the Python script has them too. So I guess only testing is left to make sure it works fine with these decoders.

feliwir commented 9 years ago

I tested the following vp9 video succesfully: http://base-n.de/webm/out9.webm

Unfortunaly i can't test opus support since sfeMovie doesn't allow playing audio only and there was no video with opus as audiocodec. The tool HandBrake, which i usually use to edit videofiles, doesn't support opus

Ceylo commented 9 years ago

Arg, here on OS X I can play audio only files. Window creation fails but it doesn't prevent the program from working. I guess you get some kind of fatal error with window creation, am I right ?

feliwir commented 9 years ago

Yes, i get an X11 error on linux, saying that size can't be 0

Ceylo commented 9 years ago

Audio files should be testable now through the fix in this branch: https://github.com/Yalir/sfeMovie/commits/feature/SampleProgram

Will be merged as soon as it is confirmed to work fine on Linux and Windows (test ok on OS X for now).