tcmt Posted August 1, 2016 Posted August 1, 2016 hello all, i created a flash animation in adobe flash and exported it as an .swf. i set the framerate to 29,97fps in flash and the exported file plays at the right speed when it play i in flash player. but when i use the .swf file in hyperspin it gets sped up. my guess is that it plays at 60fps inside hyperspin and therefor the animation is way too fast. is there any way to solve that, so that my .swf is independent of hyperspins framerate and always plays at the speed (framerate) i set it to when creating the swf? thanks for reading. hope somebody can help me. cheers tim
tcmt Posted August 1, 2016 Author Posted August 1, 2016 i had a lengthy discussion with jamesbaker (thanks again mate!) today on this matter and it turned out that the animation runs at the correct speed for me when i design the animation in 60fps in flash. 30fps animations gets sped up for me in hyperspin whereas 120fps animations slow down. BUT that might be only on my PC, where hyperspin itself runs at 60fps i think. so my question is, does hyperspin always run at 60fps on every pc or is it different for every pc? (for example someone with a 120hz monitor might have hyperspin run at 120fps?) someone got any more insight into that matter? thank you! tim
dark13 Posted August 6, 2016 Posted August 6, 2016 Not 110% sure about it but as far as I get the stage framerate is a property you can set on a .swf and will affect the parent stage (the stage used in HS itself). Netstream videos seems to not be affected by the stage framerate. As far as I've seen setting 120 fps simply does not work but maybe it's due to screen refresh or/and gpu v-sync. I'm using code to display the fps var startTime:Number; var framesNumber:Number = 0; var fps:TextField = new TextField(); function fpsCounter():void { startTime = getTimer(); addChild(fps); addEventListener(Event.ENTER_FRAME, checkFPS); } function checkFPS(e:Event):void { var currentTime:Number = (getTimer() - startTime) / 1000; framesNumber++; if (currentTime > 1) { fps.text = "FPS: " + (Math.floor((framesNumber/currentTime)*10.0)/10.0); fps.textColor = 0xFF0000; fps.y = 100 startTime = getTimer(); framesNumber = 0; } } fpsCounter(); BTW doing some test with JJB we have noticed that netstream videos use GPU decoding by default, to turn off GPU decoding use ns.useHardwareDecoder = false ; To set the stage at 60 fps use stage.frameRate = 60; Automatizing infopanels creation from .csv files for HTPCs themes (look at infopanel tutorial.zip on the ftp in dark13 folder) PNGs to SWFs automatized flash scripts Hyperspin Wheelset automatized template (photoshop's variables + batch) Aeon nox 4.13 W.I.P. hyperspin skin
tcmt Posted August 7, 2016 Author Posted August 7, 2016 nice! thanks for sharing the info. greatly appreciated will try it out as soon as i find some time
RkH Posted August 17, 2016 Posted August 17, 2016 Not 110% sure about it but as far as I get the stage framerate is a property you can set on a .swf and will affect the parent stage (the stage used in HS itself). Netstream videos seems to not be affected by the stage framerate. As far as I've seen setting 120 fps simply does not work but maybe it's due to screen refresh or/and gpu v-sync. I'm using code to display the fps var startTime:Number; var framesNumber:Number = 0; var fps:TextField = new TextField(); function fpsCounter():void { startTime = getTimer(); addChild(fps); addEventListener(Event.ENTER_FRAME, checkFPS); } function checkFPS(e:Event):void { var currentTime:Number = (getTimer() - startTime) / 1000; framesNumber++; if (currentTime > 1) { fps.text = "FPS: " + (Math.floor((framesNumber/currentTime)*10.0)/10.0); fps.textColor = 0xFF0000; fps.y = 100 startTime = getTimer(); framesNumber = 0; } } fpsCounter(); BTW doing some test with JJB we have noticed that netstream videos use GPU decoding by default, to turn off GPU decoding use ns.useHardwareDecoder = false ; To set the stage at 60 fps use stage.frameRate = 60; This worked perfectly. I'm having a issue: The sound sometimes keeps playing in the background when i've changed the wheel selection. Does it need a action to stop? It doesnt happen everytime, its weird.
dark13 Posted August 18, 2016 Posted August 18, 2016 Are you loading a video in the .swf or what you hear is the music of the video in hyperspin? Flash has some problems with buffer, if you are loading a video or an .mp3 it would be better to use keyboard event to close the stream when a key is pressed. Automatizing infopanels creation from .csv files for HTPCs themes (look at infopanel tutorial.zip on the ftp in dark13 folder) PNGs to SWFs automatized flash scripts Hyperspin Wheelset automatized template (photoshop's variables + batch) Aeon nox 4.13 W.I.P. hyperspin skin
tcmt Posted August 18, 2016 Author Posted August 18, 2016 Are you loading a video in the .swf or what you hear is the music of the video in hyperspin? Flash has some problems with buffer, if you are loading a video or an .mp3 it would be better to use keyboard event to close the stream when a key is pressed. sadly even with with keypress listener this audio glitch happens from time to time (at least for me it does). it (mostly) seems to be an issue with (override-)transitions. when i deactivate those i have zero audio glitches when changing the wheel. there are some other solutions to this problem like running your video/animation rendered as a mp4 through the video folder in hyperspin. or do a combination where you get the sound from a mp4 movie in the video folder while simultaneously embed a silent movie/animation in a .swf. all of those solutions are not the easiest or prettiest tho.
RkH Posted August 18, 2016 Posted August 18, 2016 Are you loading a video in the .swf or what you hear is the music of the video in hyperspin? Flash has some problems with buffer, if you are loading a video or an .mp3 it would be better to use keyboard event to close the stream when a key is pressed. I have a swf with and mp3 in it (compiled with flash) Do you have the line which closes stream when keyboard event detected? Thank you dark13, you're great. sadly even with with keypress listener this audio glitch happens from time to time (at least for me it does). it (mostly) seems to be an issue with (override-)transitions. when i deactivate those i have zero audio glitches when changing the wheel. there are some other solutions to this problem like running your video/animation rendered as a mp4 through the video folder in hyperspin. or do a combination where you get the sound from a mp4 movie in the video folder while simultaneously embed a silent movie/animation in a .swf. all of those solutions are not the easiest or prettiest tho. I tried using background music... the theme repeats but the BG music doesn si i'm looking for another solution. The transition fix is just for that swf theme or I must deactivate all of them? I renamed my OverTransition where i'm having problems and I will update it as I keep trying. If i see this bug again i'll tell you.
tcmt Posted August 18, 2016 Author Posted August 18, 2016 here is the code. Note, that you need to edit the component name (in this example "flvControl") according to your video player instance. stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); function myKeyDown(e:KeyboardEvent):void{ if (e.keyCode == Keyboard.ENTER){ flvControl.getVideoPlayer(0).close(); } if (e.keyCode == Keyboard.ESCAPE){ flvControl.getVideoPlayer(0).close(); } } you can simply add listeners to whichever keys you need, like for example: if (e.keyCode == Keyboard.UP){ flvControl.getVideoPlayer(0).close(); } or if (e.keyCode == Keyboard.LEFT){ flvControl.getVideoPlayer(0).close(); } also works with standard keycodes. cheers tim
RkH Posted August 18, 2016 Posted August 18, 2016 here is the code. Note, that you need to edit the component name (in this example "flvControl") according to your video player instance. stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); function myKeyDown(e:KeyboardEvent):void{ if (e.keyCode == Keyboard.ENTER){ flvControl.getVideoPlayer(0).close(); } if (e.keyCode == Keyboard.ESCAPE){ flvControl.getVideoPlayer(0).close(); } } you can simply add listeners to whichever keys you need, like for example: if (e.keyCode == Keyboard.UP){ flvControl.getVideoPlayer(0).close(); } or if (e.keyCode == Keyboard.LEFT){ flvControl.getVideoPlayer(0).close(); } also works with standard keycodes. cheers tim I'm learning soo much from you... very apreciated. I'll try this and will comment.
tcmt Posted August 18, 2016 Author Posted August 18, 2016 you are welcome and thanks but i have to credit jamesbaker and dark13 for this code. it is not my doing. in fact i don't have much of a clue of actionscript in general .
dark13 Posted August 19, 2016 Posted August 19, 2016 If you want to use specific key already used in HyperSpin you can use this code to get the key for player 1 automatically, I still need to test it properly and add p2 keys but it should be usable. Please notice that the code is set for debugging, you can't debug this stuff if you don't use an hardcoded path as the portable code use "media" and "image" folders to get the path, so you need to comment some lines and uncomment other lines to use portable path). var myFileName:String; var HSpath:String ; var mypath:String ; var SystemName:String ; var HSsettingLoader:URLLoader = new URLLoader(); var SettingsTXT:Array ; var VariablesAssigner:Array ; var VariablesAssigner2:Array ; var HSStart:Number ; var HSExit:Number ; var HSUp:Number ; var HSDown:Number ; var HSSkipUp:Number ; var HSSkipDown:Number ; var HSSkipUpNumber:Number ; var HSSkipDownNumber:Number ; var HSHyperSpin:Number ; var HSGenre:Number ; var HSFavorites: Number // Uncomment lines below to get portability /*myFileName = this.loaderInfo.url; mypath = myFileName.split(String.fromCharCode(92)).join("/"); SettingArray = mypath.split("/Media/"); HSpath = myFileNameArray3[0] ; */ HSsettingLoader.addEventListener(Event.COMPLETE, onLoadedHSsetting); function onLoadedHSsetting(e:Event):void { SettingsTXT = e.target.data.split("[P1 Controls]") ; VariablesAssigner = SettingsTXT[1].split("[P2 Controls]"); VariablesAssigner2 = VariablesAssigner[0].split("\r\n").join("").split("Start=").join("&").split("Exit=").join("&").split("SkipUpNumber=").join("&").split("SkipDownNumber=").join("&").split("SkipDown=").join("&").split("SkipUp=").join("&").split("Up=").join("&").split("Down=").join("&").split("HyperSpin=").join("&").split("Genre=").join("&").split("Favorites=").join("&").split("&") ; // Use the variable listed below HSStart = VariablesAssigner2[1]; HSExit = VariablesAssigner2[2]; HSUp = VariablesAssigner2[3] ; HSDown = VariablesAssigner2[4] ; HSSkipUp = VariablesAssigner2[5] ; HSSkipDown = VariablesAssigner2[6] ; HSSkipUpNumber = VariablesAssigner2[7] ; HSSkipDownNumber = VariablesAssigner2[8] ; HSHyperSpin = VariablesAssigner2[9] ; HSGenre = VariablesAssigner2[10] ; HSFavorites = VariablesAssigner2[11] ; trace(HSStart, HSExit, HSUp, HSDown, HSSkipUp, HSSkipDown, HSSkipUpNumber, HSSkipDownNumber, HSHyperSpin, HSGenre, HSFavorites); } stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); function myKeyDown(e:KeyboardEvent):void { // if (e.keyCode == Keyboard.ENTER) { if (e.keyCode == HSUp) { trace("ok") } } // Uncomment first line and comment second line to get portability // HSsettingLoader.load(new URLRequest(HSpath + "/Settings/Settings.ini"); HSsettingLoader.load(new URLRequest("W:/Hyperspin test/Settings/Settings.ini")); Automatizing infopanels creation from .csv files for HTPCs themes (look at infopanel tutorial.zip on the ftp in dark13 folder) PNGs to SWFs automatized flash scripts Hyperspin Wheelset automatized template (photoshop's variables + batch) Aeon nox 4.13 W.I.P. hyperspin skin
RkH Posted September 1, 2016 Posted September 1, 2016 Hi, i experienced that if you don't use audio to synchronize, the swf's play faster than the actual fps selected.Does this have any coincidence with hardware decoding/acceleration?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.