Windows video support
Moderators: Ice Cream Jonsey, joltcountry
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
Windows video support
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?
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?
- Ice Cream Jonsey
- Posts: 30184
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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!
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!
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
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.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!
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.
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.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.
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Interesting. I wouldn't have guessed that's on the interpreter side, either, but I suppose that makes some sense.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.
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
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 wrote:Interesting. I wouldn't have guessed that's on the interpreter side, either, but I suppose that makes some sense.
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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.
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.
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
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.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.
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.)
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
Correction: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.)
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.
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
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.)
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.)
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
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.
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.
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
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.
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.
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
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
This is now fixed. ESC also skips videos now:
http://83.212.107.13/~realnc/hugor/test ... eo-w32.zip
-
- Posts: 2256
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee