video playback

Everything about development and the OpenMW source code.
User avatar
artorius
Posts: 46
Joined: 08 Mar 2012, 13:59
Location: VA, USA

video playback

Post by artorius »

I was looking over the list of issues and saw this one about video playback:

http://bugs.openmw.org/issues/39

The videos that came with Morrowind are Bink videos, and I found out that ffmpeg supports bink playback. Of course, you would need a version with that support compiled in, so it would be a 'non-free' build.

I tried it out on my Fedora system, and it does work. Here's a screenshot of me using ffplay to view the Morrowind intro video:

http://imageshack.us/photo/my-images/57 ... gbink.png/

Nevermind, just found out on IRC you guys are already aware of this.
mark
Posts: 10
Joined: 12 Jun 2012, 09:05

Re: video playback

Post by mark »

http://www.ogre3d.org/forums/viewtopic.php?f=11&t=29842 might help, it is a video player class for ogre3d (I don't know about sound, I did not see audio variables in the code). The download link is in the very last posting of this thread (http://www.ogre3d.org/forums/download/file.php?id=2223)

Native bink support may be the cleanest video support, but as there are only 6 videos and you mostly don't see them: maybe it is a good idea to let the users convert the videos into another format first (or do it in an installer that copies the videos to disk, unshields the data, unpacks your engine and sets the data path).
If you convert the files, you can choose whatever codec you like most and embed it into the engine.
I don't know the internals of ogre but do you really need to convert video frames into textures (as said in https://bugs.openmw.org/issues/39)? This sounds like converting the videos all the time instead of converting them once.
Would it not suffice to minimize the engine, open a new window and play the video in this window via libav (or ship a stripped down version of mplayer, that can only play bik videos and call it's executable)?

I tried to convert from bink and it worked:

Code: Select all

mencoder video.bik -o video.avi -oac mp3lame -ovc x264
The largest video is the credits video and it needed 2 minutes on my old machine. Converting them all will need < 10 minutes (using xvid or another codec, this will be much faster). A good thing is, that the videosize is 1/2 to 1/3 of the original size and it can be played with whatever player I like.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: video playback

Post by Chris »

OpenMW already has an option to use ffmpeg to decode audio. I see no reason we can't use it for video support to play the Bink videos natively (building without ffmpeg would just mean videos fail to play).
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: video playback

Post by corristo »

Can anyone give me minimal required build options for ffmpeg?
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: video playback

Post by Chris »

corristo wrote:Can anyone give me minimal required build options for ffmpeg?
Build options for ffmpeg itself, or options for OpenMW to use ffmpeg?
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: video playback

Post by corristo »

for ffmpeg, to get minimal required ffmpeg build for OpenMW video playback
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: video playback

Post by Chris »

corristo wrote:for ffmpeg, to get minimal required ffmpeg build for OpenMW video playback
hmm, not sure of the exact options. But the minimum for proper playback of audio and video would be:

Codecs: pcm, mpg123, ffbinkvideo, and ffbinkrdftaud (these are what mplayer calls them)
Not sure about what demuxers need to be enabled.

For libs we need libavformat, libavcodec, libavutils, and libswscale
User avatar
psi29a
Posts: 5362
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: video playback

Post by psi29a »

Chris wrote:
corristo wrote:for ffmpeg, to get minimal required ffmpeg build for OpenMW video playback
hmm, not sure of the exact options. But the minimum for proper playback of audio and video would be:

Codecs: pcm, mpg123, ffbinkvideo, and ffbinkrdftaud (these are what mplayer calls them)
Not sure about what demuxers need to be enabled.

For libs we need libavformat, libavcodec, libavutils, and libswscale
Should be simple enough to add to Ubuntu dependancies, there is nothing strange here from my point of view.
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: video playback

Post by Chris »

BrotherBrick wrote:Should be simple enough to add to Ubuntu dependancies, there is nothing strange here from my point of view.
Yeah, and for Windows there are prebuilt DLLs here: http://ffmpeg.zeranoe.com/builds/ They probably have more enabled than we need, but it makes things easier.

EDIT:
You'll want the shared pack, and developers will want the Dev pack also (for the headers and import libs). The Static pack provides the utility programs static-linked, they don't include actual static libs.
User avatar
psi29a
Posts: 5362
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: video playback

Post by psi29a »

So windows packagers need to either statically compile in the libs or provide the libs in the zip or exe installer?
Post Reply