Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] StartScreenRecording() not working with SetDeviceCameraToImage()

Author
Message
YesItsASpoon
9
Years of Service
User Offline
Joined: 3rd Feb 2015
Location: Southern California
Posted: 16th May 2018 21:46
I'm trying to record from an Android camera & save the video, so that I can then use that video file later in my app.

As far as I can tell, the only (hypothetical) way to do this is by combining SetDeviceCameraToImage() and StartScreenRecording(). However, while these two commands work perfectly fine individually, using them together causes my app to abruptly shut down right after the first Sync() that follows StartScreenRecording().

Here's sample code that demonstrates the issue:



I'm testing on a Samsung Galaxy S8.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 19th May 2018 11:59
Works fine in windows for me

The audio output from the app may be audible through the microphone recording though.
Recording through the microphone requires that you enable the "Record Audio" permission
when exporting your APK.

On Android the recording may stop at any time, for example if the app is sent to the background,
or if another activity is activated such as an In App Purchase, or using the FacebookLogin command.
fubar
YesItsASpoon
9
Years of Service
User Offline
Joined: 3rd Feb 2015
Location: Southern California
Posted: 20th May 2018 21:24
Hi Fubar,

Thanks for replying. Does this work in Android for you?

For me, using the SetDeviceCameraToImage() and StartScreenRecording() commands together crashes the app every time.

It's unrelated to any other Android activity (e.g. sending to the background, in-app purchase, Facebook). It simply crashes immediately after "Sync()" is executed for the first time after both SetDeviceCameraToImage() and StartScreenRecording() have started.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 22nd May 2018 23:58 Edited at: 22nd May 2018 23:59
Sorry just found this thread again

I did notice tho in your example you don't include any setting up of resolutions or even settings for the sync rate
I understand its only a snippet but if these are leftout I have come across crashes in the past

I added this


Il now test on my phone another Samsung and tell you the results
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 23rd May 2018 00:24
ok tested this code on my phone


With permissions set to record audio and camera
and it worked on my Samsung Galaxy with Android 4.4.4 installed.
Please note I also changed the rawpath as that dont exist on my phone see above
fubar
YesItsASpoon
9
Years of Service
User Offline
Joined: 3rd Feb 2015
Location: Southern California
Posted: 25th May 2018 05:07
Hi Fubar,

Thank you for checking this for me. I copied & pasted your code & it still didn't work on my two test phones. But since it was working on your phone, I started looking for anything I was doing different. I think I found it.

Whenever I first run the app & start recording, I get the Android message that "[APP NAME] will start capturing everything that's displayed on your screen." I have the option to click "Don't Show Again", and then manually tell it to begin recording.

But it's that "Don't Show Again" part that was apparently killing me. If I tick that box, then the app crashes the next time I try to run it. But if I never tick the box & always manually approve it each time, then it doesn't crash.

I'm testing by installing the apk on two phones: an LG running 5.1.1, and a Samsung running 8.0.0. Same results on both.

Login to post a reply

Server time is: 2024-04-19 15:37:24
Your offset time is: 2024-04-19 15:37:24