Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » DJGPP DOS movie video playback

This thread is locked; no one can reply to it. rss feed Print
DJGPP DOS movie video playback
cyberluke
Member #20,942
August 2021

Hi, even Warcraft 1 game can play some animation with sound. There was FLI / FLIC format. Then I guess DOS can play MPEG as well. There is also some commercial library like SmackVideo.

Does Allegro framework support any kind of a video component that you could have some UI and then play a small 320x240 or even 160x120 video with 256 colors? Having sound would be a plus, but is not mandatory.

It must not be fullscreen, but component inside UI.

I quickly googled this and I've seen you support ffmpeg: https://sourceforge.net/projects/ffmpeg-x264-dos/ ...that is for encoding part. Now we need some playback component, right?

I'm asking on behalf of DOjS framework which is utilising Allegro inside.

Chris Katko
Member #1,881
January 2002
avatar

What's the application? "DOjS framework" doesn't come up with any results. Is this for some sort of modern computers but running DOS, or are we talking 486 CPUs? What target CPU, RAM, and video card specs are you looking at?

What file format(s) specifically? Or just any? Are you playing everyone's videos [a utility], or just your own that you have control over?

I'm not aware of any Allegro 4 era video codec. Those were fairly rare before Windows. And you're not going to get, say, a 486 to decode HVEC. In fact, full speed videos were very rare in the DOS era. Mostly due to needing a CD to fit them. And they were heavily compressed, low bit depth, and interlaced. [ala Crusader No Remorse and C&C]. You didn't get remotely good video till approximately Starcraft with Windows 95. Some(?) CD drives had built-in MPEG decoders in hardware, and MMX for Pentium was specifically added because nobody could reliably do quality video in that era without them.

There's likely some pre-existing DOS compatible video codec source codes out there that could be ported to dump into an ALLEGRO_BITMAP structure, and then drawn so you can use a user interface and Allegro. Those would likely have far far more support/effort/bug-fixes put into them anything internal to Allegro 4.

[edit] Heck, google searches for "DOS video player" come up with almost nothing. The most popular result, Mpxplay can play the audio inside a video file, but not the video. Heck, I remember a 486DX4-100 could BARELY play an MP3, and that's if you set the audio quality to quarter at like 11 KHz!

Any video codecs that run are going to need to be integer based, as floats on pre-Pentium 1 CPUs were horrifically slow, and even then, they still had to come up with MMX to improve video playback after the Pentium 1.

I wonder what other games had DOS FMV videos. There were plenty of "CD FMV" games though. I wonder what codecs they used. Smacker seems like a Windows 95+ mode. Also note that pretty much ZERO FMV games ran with video at fullscreen resolution, or, had any game logic/content running during playback. The entire CPU was dedicated to surviving the one thing it was doing: rendering video.

1995 Warcraft 2 used smacker (supposedly), man it's pretty ugly, compressed, and low frame rate but it was beautiful for the era!

video

I remember MANY games had an option of half-resolution video too for slower CPUs.

Looks like Wing Commander III in December 1994 might have been one of the earliest.

video

Ooh baby look at that high compression banding! (And that might be the RE-RELEASE with higher res videos.)

The resolution was a whopping 320x165 at 15 FPS!

A MVE file has a default video resolution of 320x165

Quote:

Wing Commander III requires at least an IBM 486/50+ MHz or 100% compatible system, and MS-DOS version 5.0 or higher. Pentium™ machines are also supported and recommended for SVGA gameplay.

Triva: Why 320x165? Now 165 seems odd at first. It's not 200 (320x200 VGA), nor 240 (320x240 ModeX). It's not one half of 200 or 240 (for interlacing). It's 165, because it's letterboxed! [black bars above and below for fake 16:9 format]

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

kenmasters1976
Member #8,794
July 2007

Heck, google searches for "DOS video player" come up with almost nothing.

I'm pretty sure there is an mplayer build for DOS. Last time I tried it (some 10 years ago, maybe) it was capable of playing anything you threw at it. Of course, it might not meet OP's requirements... unless it has an Allegro 4 based video output... but even then it probably won't be easy to adapt it to OP's needs.

Chris Katko
Member #1,881
January 2002
avatar

APEG is an old lib by Kitty Cat that might play videos if you can find a mirror.

https://www.allegro.cc/forums/thread/580847

Quote:

3.3  APEG
Allegro addon Library + “example” encoder + player , see DevelLibs , Mediaplayers and GallMediaPlyrs . The existing DOS binary regrettably uses obsolete and buggy LibTheora 1.0b2 .

https://pmwiki.xaver.me/drdoswiki/index.php?n=Main.Video

https://www.codebus.net/d-5hDN.html

Quote:

PEG is an audio/video add-on for the Allegro game programming library. It provides functions for playing MPEG-1 and Ogg streams identically to the way it handles FLIC files. Beyond that it includes a bunch of extra extensions, including but not limited to opening multiple streams. A tool is also included for creating Ogg media from various sources.

Once again, it depends on the application. Is this a serious work? Made for utilities and many formats? Maybe look into porting a much newer, supported work. If you just want "whatever is easiest" find an Allegro addon like this and hope it works

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Audric
Member #907
January 2001

Allegro 4 has a video player for FLI/FLC formats only
https://www.allegro.cc/manual/4/api/flic-routines/
For the target BITMAP, you can either :

  • provide a sub-bitmap of the BITMAP screen, which will cause instant refresh,

  • or you can provide a memory bitmap of your own, and then your callback function has to read the bitmap and refresh your own rendering accordingly.

But it performs the video (graphic) part only, the sound has to be provided separately. (as WAV natively, or through any MP3 library for example)

This is what the Allegro 4 "demo game" did :
https://www.youtube.com/watch?v=vKtf6b5I6To
It plays a 5-second animation at the very beginning.

Go to: