Screen record more than 2 minutes

Hello,
I try to implement reording on my screen and I only get one minute of record, my method looks like that:

        ((CanRecordScreen) getDriver()).startRecordingScreen(new BaseStartScreenRecordingOptions() {
        @Override
        public BaseStartScreenRecordingOptions withTimeLimit(Duration timeLimit) {
            return super.withTimeLimit(Duration.ofMinutes(2));
        }
    });

what I missed?
Thanks

Have you been following this thread? Seems like a lot of good info on screen recording here:

Thanks,
I read it, but, I don’t see I have that option (to change the FPS for example) in the options, maybe it’s Java issue?

I gave example in above thread in Java.

You right I missed it
But, At the end it said that even tough that the FPS are 30 still the video duration is shorter than intended, there is fix for that instead of doing it outside?
Thanks

Are all test details on video present? Do you mean that video just faster and that is why duration less?

Yes, as it written there.
Also What you wrote there is just for IOS? since it’s IOSStartScreenRecordingOptions

With ios appium does screen record itself. With android native recorder used.

  1. Why you care if video a bit faster while all test recorded?
  2. if it really needed you can use full power of ffmpeg to correct it in any way e.g. add filter Simon mentioned in thread.

I didn’t understand what’s the difference in the recordings, and so for each platform I will need to start an new instance per platform?

about the speed, I just want it to be normal :slight_smile:

once again:

  • with iOS appium does recording and saves it to file itself.
  • with Android appium asking to start record using native android recorder. stops later and just taking file from phone.

that is why with iOS much more parameters to tune record.

So for Android project better to use like here? ?
And I understand that there is no one solution for both platforms?

you have problem with iOS or Android?

right now it’s iOS but I should start testing in Android too that’s why I ask

with Android it not happens, you just start iOS recorder with one settings and android with others in code.

@Aleksei
Great, I will do it sunday than.
Thank you again all :slight_smile:

@Aleksei
I saw that even if I do an Thread.sleep(65000) the video is not generated, and what I did is:

    ((CanRecordScreen) getDriver()).startRecordingScreen(new IOSStartScreenRecordingOptions()
                .withFps(25)
                .withVideoScale("320:-2")
                .withVideoType("h264") // require ffmpeg
                .withTimeLimit(Duration.ofMinutes(10)));

What is wrong now?

Please provide server logs

In Debug mode where I stop the running for 1 min
app logs
Server logs

just in case of Thread.sleep of 65000
and app logs

I think the reason why the video is too short is because the default timeout when no commands are issued to the driver is 60 seconds.

Please try setting the newCommandTimeout capability to 0, details about capability https://appium.io/docs/en/writing-running-appium/caps/

In your logs you can see:

2022-01-18 18:08:02:131 [Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'

So just to clarify, you saw that there is 60 sec that no command issued?