Aside from the startRecording()/stopRecording() (which leaves an ugly big watermark on the video) is there any other wya I can create a video? I’d like to build out a simple animation tool that could then be used to record simple videos. The solutions I’ve thought about are inserting a 5 second timer before the animations run so I can do a screen record, and …er… that’s it.
I’m assuming the watermark is an apple restriction, but is there a way to either remove the watermark or send the screen output to a movie file that can then be recorded?
-PJ
@pjholden Try setting displayMode(FULLSCREEN_NO_BUTTONS) . You’ll have to use the touched function to startRecording and stopRecording. Or just startRecording as soon as the program starts and I guess it will stop recording if you stop the program.
Hi, I’ve done that - when you start recording programmatically you get a “RECORDING” message on screen (along with a timer letting you know how long the recording is) I’m assuming this was to comply with apple’s requirement that users know when you’re recording the screen.
@pjholden I don’t get that on my iPad. When I look at the video, all I see is the screen. There isn’t any RECORDING message or timer.
The numbers are things I’ve drawn on screen, the Red recording and camera icon are codea’s Own…
Here’s the program I’m using. Tap the screen to start recording. Tap the screen to stop recording. When you stop recording, I call exit() which doesn’t exist so the program cancels back to the editor. You’ll be given the option to save the video.
displayMode(FULLSCREEN_NO_BUTTONS)
function setup()
z=1
v=0
xx=0
stopRecording()
fill(255)
end
function draw()
background(40, 40, 50)
text(z,WIDTH/2,HEIGHT-100)
if xx==0 then
text("tap screen to start recording",WIDTH/2,HEIGHT-50)
end
if xx==2 then
text("tap screen to stop recording",WIDTH/2,HEIGHT-50)
end
if xx==1 then
startRecording()
xx=2
end
if xx==3 then
stopRecording()
exit()
end
z=z+v
ellipse(WIDTH/2,HEIGHT/2,z)
end
function touched(t)
if t.state==BEGAN then
xx=xx+1
v=.5
end
end
Hmmm I think I was doing FULLSCREEN, though I did edit it to fullscreen no buttons and got the same message but coming out and in and it’s made it go away! Ta!
For what it’s worth…
I wrote a recordScreen wrapper to add a countdown and a timer. When it’s begun it’s given a callback function which is the animation proper (which right now are just a couple of simple tweens on some sprites)
(I’ve lots of tidying up to do, it was more proof of concept at this stage)
recordScreen = class()
function recordScreen:init(t)
-- you can accept and set parameters here
self.countDown = {}
self.countDown.timer = 4
self.countDown.time = self.countDown.timer - 1
self.t = t or 10 -- default to 10 seconds...
self.recorder = {}
self.recorder.time = self.t + self.countDown.timer -- add the timer to the total record time...
self.recorder.tminus = self.recorder.time
self.recorder.recording = false
self.inCountdown = false
self.timeStart = os.time()
self.debug = true
end
function recordScreen:begin( callback )
-- begin the countdown ...
self.inCountdown = true
self.timeStart = os.time()
-- first tween is for the on screen count down 4/3/2/1
startRecording()
tween(self.countDown.timer, self.countDown, {time = 0},nil,
function (param)
self.inCountdown = false
if callback then
return callback()
end
end )
-- this second tween is for the overall record... simple cancel record when we're done!
tween(self.recorder.time, self.recorder, {tminus=0}, nil,
function(params)
self:endrecord()
end
)
end
function recordScreen:endrecord()
self.timeFinish = os.difftime(self.timeStart, os.time())
-- turn off screen recording...
stopRecording()
end
function recordScreen:runningTime()
return os.difftime( os.time(), self.timeStart)
end
function recordScreen:draw()
-- Codea does not automatically call this method
pushStyle()
if self.inCountdown then
pushMatrix()
fontSize(100)
text(math.ceil(self.countDown.time), WIDTH/2, HEIGHT/2)
popMatrix()
end
if self.debug then
fontSize(12)
text(self.recorder.tminus, WIDTH-300, HEIGHT-200)
end
popStyle()
end
function recordScreen:touched(touch)
-- Codea does not automatically call this method
end