Windows video support

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Windows video support

Post by RealNC »

I've ported the Linux video support to Windows. (Mac users are out of luck at this moment.)

It would be nice if others could test this to see if it works on anything else than my own PC:

http://83.212.107.13/~realnc/hugor/test ... -video.zip

I assume people here already have a copy of "Future Boy" to test this with?

User avatar
Ice Cream Jonsey
Posts: 28877
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

Holy shit! Holy shit!!

Holy shit!

I do have Future Boy!. It occurs to me that I may only have it on CD, ha. I'm going to try to make trying this over the weekend a priority!
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Well, I've only opened it up so far, but I'm already impressed that it improves upon the official Hugo interpreter by now throwing up an annoying crash message when you close the game while a video is looping.

I've been meaning to replay through the entirety of Future Boy! for years. Hopefully this will be the right motivation for me.

Out of curiosity, I tried it out with Steam's broadcasting functionality just to see if it worked at all. Interestingly, it *does* broadcast the videos (and nothing but). I'm sure that's not entirely unexpected.

I'm assuming it's completely not worth it to have an option to throw the entire window to some screen capturer/renderer that'd work with broadcasting software, but on the off chance there are efficient and somewhat simple ways to do that, I just thought I'd mention I think that'd be cool!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I did run into my first issue. When things like FB's intro movies are being played, it's supposed to be possible to hit Escape to skip through them. Probably not a huge deal if that's not possible but would be nice.

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

Roody_Yogurt wrote:Out of curiosity, I tried it out with Steam's broadcasting functionality just to see if it worked at all. Interestingly, it *does* broadcast the videos (and nothing but). I'm sure that's not entirely unexpected.

I'm assuming it's completely not worth it to have an option to throw the entire window to some screen capturer/renderer that'd work with broadcasting software, but on the off chance there are efficient and somewhat simple ways to do that, I just thought I'd mention I think that'd be cool!
You mean only the video is captured? Hm, that makes sense, since Direct3D is used to render the video, while the rest is simple win32 GUI stuff like in other apps. I assume that most screen capture software is not able to capture GUI stuff unless you tell it to capture the entire desktop.

Rendering the entire game output to a D3D surface instead of just the video would most probably fix that. But I don't know how involved that would be. It's something to keep in mind though. Which I will.

I did run into my first issue. When things like FB's intro movies are being played, it's supposed to be possible to hit Escape to skip through them. Probably not a huge deal if that's not possible but would be nice.
Oh. I didn't even know that this was possible. I'll add that. Like some of the other things in Hugo, this too is interpreter controlled, not game controlled, so it wasn't obvious.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

RealNC wrote:Oh. I didn't even know that this was possible. I'll add that. Like some of the other things in Hugo, this too is interpreter controlled, not game controlled, so it wasn't obvious.
Interesting. I wouldn't have guessed that's on the interpreter side, either, but I suppose that makes some sense.

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

Roody_Yogurt wrote:Interesting. I wouldn't have guessed that's on the interpreter side, either, but I suppose that makes some sense.
Just to make sure: when you "output" a video in hugo code and have it set to foreground mode, then effectively the game stops executing at that line until that call returns, right? There's no way for the game to scan a keycode in and abort the video when ESC is pressed.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

That sounded right, but looked it up in the Hugo Manual to be sure:
video [repeat] <resfile>, <res>[, <vol>, <bkground>]
So yeah, without a true <bkground> argument, it's supposed to wait until the video is finished before doing anything.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Kent has verified that, yes, that is handled terp-side! So, cool!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

My confusion in all of this is that I could easily imagine an instance where Kent would have run the video in the background and used a timed loop to check for the ESCAPE_KEY as the video ran, at which point he'd clear the video with 'video 0' (and for some reason the key press wasn't being read correctly in Hugor), but no, you're right that he actually just hardcoded skipping-by-ESCAPE into the interpreter.

I also talked to him about how you had no problem getting .mp4 (and other formats) working in your initial video tests of Hugor, and he's completely agreeable to official .mp4 support.

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

Roody_Yogurt wrote:I also talked to him about how you had no problem getting .mp4 (and other formats) working in your initial video tests of Hugor, and he's completely agreeable to official .mp4 support.
Looping mp4 files is difficult when they are segmented. The gstreamer decoder is unable to loop such files, and there's no fix in sight.

The best container format to support is mkv (it's better than mp4 to begin with.) Even Microsoft added support in Windows 8.1 for it.

If mp4 is preferred, it must be non-segmented, otherwise looping isn't gonna work (the video will just hang after playing once.)

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

RealNC wrote:If mp4 is preferred, it must be non-segmented, otherwise looping isn't gonna work (the video will just hang after playing once.)
Correction:

When I say looping, I mean seamless looping. Where the video is made in such a way that it seems continuous when looped. Hugor does seamless, frame-perfect looping where no pause is detectable at the loop point.

Normal looping, that is just stopping the video and starting it again would work just fine. But then, it would not be seamless. You'd see a pause between each loop. That would be the only way to do it with segmented mp4 files.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Yeah, I only discussed mp4 format with Hugo just because it's so widely used, but I'm sure mkv would be perfectly fine. Ok, mkv it is!

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

Well, there's no reason not to support both. mp4 is handled by most Windows versions already (important for Kent's interpreter; he wouldn't have to do much to add playback code for mp4).

So he'd only have to treat mkv in a special way (either by including a codec in the interpreter, or by requiring users to add such a codec on their own, or by specifying Windows 8.1 as the minimum requirement for mkv support.)

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Well, to some extent, Hugor is becoming *the* official Hugo interpreter. Just last night, while discussing video behavior, Kent took a look at his old code, and there were all these bits for supporting old crazy platforms like Windows NT 4.0. I just don't think he'll have the time to update the official terps anytime soon, and if he did, it'd involve throwing out so much old code and a big overhaul.

It's nice you have his future development in mind, but really, I think Hugor is going to be the only game in town for a while (especially if people put videos in their games, as the official interpreter hangs horribly in video-using games in recent versions of Windows).

But yeah, both mkv and mp4 is cool, too.

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

OK then. From Hugor's perspective, actually any format is fine, with the aforementioned exception of segmented mp4 files.

However, I'm looking into using libVLC for video support on Windows (it seems to work much better for Windows compared to the current gstreamer backend.) At that point, you would be able to play any video in Hugor that you are able to play in VLC (which would cover 99% of what's out there.)

But what I'm worried about is "video support overkill." Having just a few good formats being officially supported is a good thing. Non-segmented MP4 and MKV (and the current AVI support) are a good set of container formats to support. But those are just container formats. More important is what goes *in* them. A good set of video and audio codecs that should be supported would be:

Video: ISO MPEG4 (for example H.264, DivX 4/5 and XviD)
Audio: MP3, AAC, AC3, DTS

I'd recommend these because they have native support in Windows/Mac, but are also well supported on Linux through gstreamer/ffmpeg/libvlc. (And who knows, someone could someday port Hugo to smartphones, and those codecs are also well supported there.) They are usually also first-class citizens in pretty much every video editor. So they're a good subset to support.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

That sounds good to me! I'll send Kent this way to see if he has any other thoughts.

User avatar
RealNC
Posts: 2244
Joined: Wed Mar 07, 2012 4:32 am

Post by RealNC »

The previous version wasn't working with videos that had sound (most videos in FB don't have sound, but a few do).

This is now fixed. ESC also skips videos now:

http://83.212.107.13/~realnc/hugor/test ... eo-w32.zip

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Great news! So exciting having all of these new versions to test!

Post Reply