Author Topic: Movie Layer  (Read 4180 times)

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Movie Layer
« Reply #30 on: August 15, 2015, 03:51:04 PM »
Nice! Saved me a job testing that out :) The last few days I have been playing around with creating layers a lot, probably spent more time doing that than the rules.

With VP though I have never been able to preload any mp4. I will have to try that again.

Quote
SDL2 is a monster :)

You know it! its amazing and actually performs better than the pygame with VP. Less lag, more consistent, better quality.

Quick video of what I've been creating with it.
https://www.youtube.com/watch?v=Mlg12RUMVbE

MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Movie Layer
« Reply #31 on: August 15, 2015, 07:01:53 PM »
Seems you've been working a lot with the layers!  Looks nice!

I hope you found the generateLayer() helper in SkeletonGame.py. Should make some things a bit easier. It's how displayText actually works, by just calling that.

Not sure why you can't preload. Anything useful in your log.txt?

Oh and when you run, do you get two 6034 errors one one. These days I get two, but I was so happy to get it working again after rebuilding sdl2_ttf, that I never bothered to track it down!

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Movie Layer
« Reply #32 on: August 15, 2015, 07:14:44 PM »
Yes I've been using the generateLayer a lot actually. I had similar methods to build layers before but not as good :)

I think it's going to be best (in some cases) to make a higher priority mode just for text layers on video. I don't really like them joined together in the same mode if that makes sense.

Quote
Not sure why you can't preload. Anything useful in your log.txt?

Well I delete my logs a hell of a lot. With Skelly game they build up large from the off. Can you turn off logging, I did look the other day but couldn't see where and forgot about it?

I'm just about to start porting a pyprocgameHD to skeleton. (wish me luck on the time front). From the off I will test preloading mp4s from a very stipped build to full on, save any crashes and send them your way.

Quote
do you get two 6034

No, only one and very rarely see it for more than 100ms, does that not mean it's being run twice then?

I put this AHK script in that VP template I made. I use it every time I launch. Should make not difference if VP9 or 10
Code: [Select]
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

; Use ` as escape char for AHK. Used before the comma
Run, C:\P-ROC\Visual Pinball\vpinballx.exe -play "C:\P-ROC\Visual Pinball\Tables\Jaws.vpx"

;This gets rid of the error message
WinWait,Microsoft Visual C++ Runtime Library ahk_class #32770
WinActivate, Microsoft Visual C++ Runtime Library ahk_class #32770
WinWaitActive, Microsoft Visual C++ Runtime Library ahk_class #32770
Send, {Enter Down}{Enter Up}

;Brings display to front
WinWaitActive, ahk_class SDL_app
WinSet, AlwaysOnTop, On, ahk_class SDL_app
;WinSet, Top,, ahk_class SDL_app
WinActivate, Visual Pinball
ExitApp


MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Movie Layer
« Reply #33 on: August 15, 2015, 09:11:20 PM »
On porting a VGA game to the HD framework, you actually shouldn't /have/ to do that much. You can actually use the HD framework without SkeletonGame. A few things have been moved around a little (like assetLoader is now better and in a different spot), but your old game should work almost as-is. 

I'd be really curious to hear your experience porting from VGA to HD. I've done it for two games now and I think Josh has done two as well.  The big differences off the top of my head are that now colors can have a fourth value (opacity), things that might have been black before are now transparent (eg, grouped layers are transparent by default), blacksrc is deprecated and only works as an asset list tag, and almost every layer type now has a fill_color option to deal with that.

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Movie Layer
« Reply #34 on: August 15, 2015, 09:28:53 PM »
Will let you know how it goes. I've literally just then just got rid of an error in VP when if a switch is named "Whatever-2" with the dash and added to a VPM collection "AllSwitches" it bombs with this error.
Code: [Select]
Line 1 expected ")" < Didn't really help and had to trace back what I'd changed.

Not a good start :).

Yes I briefly looked through and could tell it wouldn't be TOO much work. If I thought it would've been to start with I wouldn't bother with this one.

It will be up-sized for definite, so most of my HDText calls resolution can be mass replaced first. The asset file I originally had will need to be converted into the asset_list. < Even that I could probably get away with.

It's the organization of Skeleton I want really as well. Looking at parts of the game code, a lot of the stuff could be moved into a base rather than all over the shop. Probably 3 python files that are doing almost the same thing (3 levels of base_game_mode, more or less) could be moved and stripped. Compared to the last one, its a mess really. It's just another excuse to go through it all.

relwin

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Movie Layer
« Reply #35 on: August 15, 2015, 11:24:11 PM »
Quote from: MOcean link=topic=1591.msg14725#msg14725 date=1439667549
  These videos are not streaming loaded from mp4 (pre-loaded). 
SDL2 is a monster :)
[/quote

Are these MP4s streaming or preloaded? (sorry, your comment is confusing to me)
I'm using ffmpeg with SDL2 and playing MP4 streaming video with proper audio-sync was difficult as I'm using SDL mixer to mix video(audio)/music/callouts/sfx simultaneously.
My C code got a little "ratty" but I'm able to play multiple video channels mixed in with other graphics and audio. I'm always looking for easier ways to play video in a pinball context.
--r.e.

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Movie Layer
« Reply #36 on: August 15, 2015, 11:40:55 PM »
 These videos are not streaming but loaded from mp4 (pre-loaded). 

Fixed?   ;)

I'm yet to hit any syncing problems yet (touch wood). Separate video & audio files seem to work fine here. I am mostly using avi though and really haven't fully tested mp4 because of problems in VP.

MOcean

  • Moderator
  • ****
  • Posts: 822
  • Michael Ocean
    • View Profile
Re: Movie Layer
« Reply #37 on: August 16, 2015, 07:58:42 AM »

Are these MP4s streaming or preloaded? (sorry, your comment is confusing to me)
I'm using ffmpeg with SDL2 and playing MP4 streaming video with proper audio-sync was difficult as I'm using SDL mixer to mix video(audio)/music/callouts/sfx simultaneously.
My C code got a little "ratty" but I'm able to play multiple video channels mixed in with other graphics and audio. I'm always looking for easier ways to play video in a pinball context.
--r.e.

Preloaded (decoded at game-launch), as dave_h pointed out. Also using ffmpeg to do the decoding here, but leveraging the OpenCV wrapper around that ffmpeg decoding.  Audio is still handled by PyGame/SDL1, but Josh had almost completed porting the soundController to sdl2 --finishing that  will probably an after Expo thing :)

We have a lot of good stuff for video effects in PyProcGameHD, new transitions, animated fills, border effects on TTF fonts, animated fills on fonts, animated fonts, scaling, rotation...hell, I even coded a simple particle engine just for fun.

What's especially nice though, is that it's all built on top of and extends the layers abstractions from PyProcGame.  You build up a "group" of layers, then set the group layer as the mode's layer and you're all set.

Anyway, the videos of your pin's display during gameplay look slick.  I was surprised to hear that more advanced display stuff on MPF requires you to roll-your-own display controller from event messages. That makes what you're doing on your machine all the more impressive.






relwin

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Movie Layer
« Reply #38 on: August 16, 2015, 06:03:12 PM »
Quote
"We have a lot of good stuff for video effects in PyProcGameHD, new transitions, animated fills, border effects on TTF fonts, animated fills on fonts, animated fonts, scaling, rotation...hell, I even coded a simple particle engine just for fun. "

Yeah, I coded up many of these types of features (starting last year) and kept thinking "I'm re-inventing the wheel again" but I couldn't find anything suitable for our pinball concept. And there's always things you take for granted like outlining TTF -- until you realize if you want it you gotta write it... good to see this is changing!

The goal of Archer is to make adding video media easy and flexible, mainly because we rip everything from DVDs! The hardest part is culling clips from 5 or 6 seasons worth of video -- this turns into a very tedious editing chore, but at least the material in funny  :P

dave_h

  • Wizard
  • *****
  • Posts: 185
    • View Profile
Re: Movie Layer
« Reply #39 on: August 16, 2015, 08:26:46 PM »
Cool, only just twigged who you are. :) You posting updates on progress anywhere? I did see something a while back.