Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
record screen with sound, render and share video? — Gideros Forum

record screen with sound, render and share video?

uneulvuneulv Member
edited April 2012 in General questions
Looks like this will become an important feature of some games,recording parts of the gameplay and share on youtube/vimeo.
Are there any plans to provide this possibility in Gideros?

Likes: hgvyas123

+1 -1 (+1 / -0 )Share on Facebook

Comments

  • atilimatilim Maintainer
    edited April 2012
    Hi @uneulv,

    I usually use Fraps on windows and there are a bunch of good applications for mac here: http://www.giderosmobile.com/forum/discussion/354/which-software-do-you-use-to-create-your-promo-video

    On the other hand, adding this feature is really time consuming and most probably the result won't be better than these ones.
  • atilimatilim Maintainer
    I think I misunderstood you. Do you mean capturing the video within application?
  • ar2rsawseenar2rsawseen Maintainer
    I believe uneulv meant recording the screen of application, like you know, best repeats of levels and sharing them on youtube on vimeo. Capturing what's going on screen.

    Sorry to barge in. My question would be similar. How about sound? I I'd have a piano for example and wav file for each key, could I internally record a melody I played and save it as mp3, without using microphone. Maybe not even with Gideros, would this be possible at all?
  • Actually I think this is something that could better be done by the developer himself (although some extra support from the team would be required).

    Rendering to video is going to be time consuming - especially on a limited mobile device, if I was going to do this then I'd initially start to "record" the players game by a) making the game 100% deterministic (ie making it so that any "random" events were controlled by a single seed and could be repeated again simply by using the same seed) and then b) recording all of the players input into a buffer.

    Obviously the game would have to be structured so that the "engine" could then replay the game as if it was the player simply by plugging in the appropriate "fake" inputs at the right time. Once this was working you could then take your time and "play" the game 1 frame at a time into a separate buffer, you could then encode the frame to a video using some kind of local storage (it might at this point be a good idea to implement FFMPEG as a native plugin to provide the encoding support).

    Once you have your "movie" stored locally then you can see about accessing either the youtube or vimeo api to actually upload your movie.

    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • atilimatilim Maintainer
    edited April 2012
    @techdojo enlightening!! *-:) \m/

    @ar2rsawseen I think the major technical difficulty is mixing multiple sound effects correctly and then getting the rendered audio buffer. Most probably I would try build OpenAL Soft 1.14, use the extension ALC_SOFT_loopback to get rendered audio buffer and encode it to mp3 by using mpg123. This is a platform independent way, and maybe iOS or Android provides easier solutions.
  • bowerandybowerandy Guru
    edited May 2012
    Okay, I'm trying to do something similar to this (if I understand the original post correctly). I'm putting up a "shield" sprite to capture mouse and touch events and "recording" them to an array (but not stopping propagation of those events so the app behaves normally).

    Later I want to be able to "play" these events back by dispatching them through the normal event listeners. I'm intending to use this for automating testing procedures, amongst other things.

    The problem is that I don't know how to replay the stored events so they channel through the normal event listeners. I optimistically tried:
    function EventShield:playEvent(event)
        stage:dispatchEvent(event)
    end
    but that crashes the Player horribly. Does anyone have any suggestions how this might be achieved?

    Best regards

  • atilimatilim Maintainer
    edited May 2012
    @bowerandy The lifecycle of event objects that are dispatched by system (touch, mouse, enter frame etc.) is only defined within the listener function. Therefore you shouldn't store them and try to redispatch again.

    But you can create a new event and store it to be dispatched later.
    local function onMouseDown(event)
        local newEvent = Event.new(event:getType()) -- or Event.new(Event.MOUSE_DOWN) or Event.new("mouseDown")
        newEvent.x = event.x
        newEvent.y = event.y
     
        -- store and dispatch newEvent later
    end
    And I've added these issues to the roadmap:
    http://bugs.giderosmobile.com/issues/101
    http://bugs.giderosmobile.com/issues/102
    http://bugs.giderosmobile.com/issues/103
  • @atilim, yes that stops the crashing. But I still don't know how to re-dispatch these saved mouse/touch events so that they get distributed to all the objects on the stage in the correct order. Alternatively, I could manually dispatch the event to every object on the stage (by walking the tree) but how do I know when stopPropagation() has been called?
  • atilimatilim Maintainer
    edited May 2012
    I've done a simple implementation. Here are the steps:

    1. Implement your custom Event:isPropagationStopped() function as:
    -- save original stopPropagation function
    Event.__stopPropagation = Event.stopPropagation
     
    -- reimplement stopPropagation
    function Event:stopPropagation()
    	self.__isPropagationStopped = true
    	self:__stopPropagation()
    end
     
    function Event:isPropagationStopped()
    	return not not self.__isPropagationStopped
    end
    2. Implement a recursive tree traversal (as you've said). We're doing post-order traversal for correct ordering (top sprite receives the event first)
    local function recursiveDispatchEvent(sprite, event)
    	for i=sprite:getNumChildren(),1,-1 do
    		recursiveDispatchEvent(sprite:getChildAt(i), event)
    	end
    	if not event:isPropagationStopped() then
    		sprite:dispatchEvent(event)
    	end
    end
    Alternatively you can implement this function as Sprite:recursiveDispatchEvent


    3. Dispatch your custom event:
    local event = Event.new(Event.MOUSE_DOWN)
    event.x = 100
    event.y = 100
    recursiveDispatchEvent(stage, event)
  • @atilim, that does the trick and works perfectly, thank you. Although:

    1) return not not self.__isPropagated had me confused for a minute. I guess I will have to learn all these Lua idioms :-)

    2) I had to wrap the Event.__stopPropagation = Event.stopPropagation line in a guard to only allow it to be executed once.
    if Event.__stopPropagation==nil then
    Event.__stopPropagation = Event.stopPropagation
    end
    Not sure why but this must have been executed several times since without it I got a recursive stack overflow.

    Best regards
  • Hi @atilim,

    Thanks to your help on this I've been able to use the above in an interesting way:

    http://www.bowerhaus.eu/blog/files/better_app_videos.html

    Best regards

    Likes: gorkem, atilim, ndoss

    +1 -1 (+3 / -0 )Share on Facebook
  • evsevs Member
    edited May 2012
    Hello,

    If you are on a Mac iMovie can do green screen stuff, if you select show advanced tools from the preferences


    cheers

    evs
  • atilimatilim Maintainer
    edited May 2012
    @bowerandy, I'm glad it worked :) And the result is fantastic.

    1) most probably this is the easiest way to convert a value to boolean (it's used here http://www.lua.org/manual/5.2/manual.html)
    2) most probably you know but if you're using require, you can disable the automatic execution of a .lua file by right clicking on it and selecting "Exclude from Execution". (anyway it's always good to do your test).

  • In fact, there is built-in screen recorder separately in Windows and Mac operating system, Xbox DVR and QuickTime. However, owing to the limited feature, a third-party program may be more appreciated. From my long-time usage, Joyoshare Screen Recorder is such a simple yet powerful screen activity recorder.
Sign In or Register to comment.