Native .wav loader, Ogg Vorbis loader, Ffmpeg out of core

Hello all,

I’ve finally split ffmpeg out of the libpanda core. It’s bloated, has a restrictive license, and most people don’t use a majority of it. A significant part of the runtime distribution size was actually ffmpeg; this seems like a bit of a waste of space.

It’s now a separate module, libp3ffmpeg. It is dynamically loaded; only when you actually try loading an audio or video file that is not otherwise supported. These load instructions will be in Confauto.prc by default:

# These entries work very similar to load-file-type, except they are
# used by the MovieVideo and MovieAudio code to determine which module
# should be loaded in order to decode files of the given extension.

# ffmpeg is added by default because it used to be compiled in.
# The * is a special catch-all extension that is consulted unless a
# loader has been defined with an explicit extension.

load-audio-type * p3ffmpeg
load-video-type * p3ffmpeg

If you need support for ffmpeg (eg. if you use .mp3 or .avi files) in your .p3d you will need to specify “-r ffmpeg” on the packp3d command-line in the future.

I’ve also gone ahead and upgraded our ffmpeg code to the latest ffmpeg API - Panda will now be able to compile against the latest version of ffmpeg again.

I also realised that most people who load simple .wav or .ogg audio files still won’t want to pull in ffmpeg. So, I’ve created a .wav loader from scratch, and an .ogg loader based on libvorbisfile (which is BSD-licensed and widely supported). The .wav loader supports all the standard encodings - PCM, float, mu-law, and A-law. The .ogg loader supports Ogg Vorbis files.
I’ve tested some pretty esoteric and broken files, but if you find a .wav or .ogg Vorbis file that doesn’t work, please send it to me.

On a similar note, I’ve also split vrpn out of libpanda. It’s now in libp3vrpn and can be imported using “panda3d.vrpn” instead of “panda3d.core”. As with ffmpeg, you will in future releases need to specify “-r vrpn” at the packp3d command-line if you need VRPN support.

This is all in CVS; the buildbots haven’t caught up yet as of writing.

Bless you sir. Bless you.

Excellent work! Another great step towards making Panda more portable.

That’s great man!! congrats.
Is this change applying for .ogv files (video)?

Thanks!!

Ogg Theora is not supported at this time except through ffmpeg.

Ok, thanks. Are there any plans for supporting Ogg Theora?

Not at the moment, but patches are welcome.

For anyone who’s run into crashes with the Ogg Vorbis loader: I’ve just checked in some fixes.

Hi,
As of today, does the dev version of Panda sopport ogg theora (.ogv files) ?

Thanks.

Ogg Theora is not supported at this time except through ffmpeg.

I’ve just checked in native support for FLAC files, thanks to dr_flac, a single-header public domain FLAC decoding library.

I just checked in support for Opus via libopusfile. Like Vorbis, it is a freely licensed audio codec. I have not yet updated the thirdparty packages to include it, though, so don’t expect it in any of the buildbot builds yet.