Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#796 Improved the screen recorder for creating more than 3 minutes long videos #939

Conversation

SergKhram
Copy link
Contributor

@SergKhram SergKhram commented May 24, 2024

#796
As mentioned there I prepared the solution
If apiLevel >= 34 -> we use time from VideoConfiguration
else -> we divide to 180sec videos if timeLimit > 180

@SergKhram SergKhram changed the title #796 Improved the screen recorder for creating than 3 minutes videos #796 Improved the screen recorder for creating more than 3 minutes videos May 24, 2024
@SergKhram SergKhram changed the title #796 Improved the screen recorder for creating more than 3 minutes videos #796 Improved the screen recorder for creating more than 3 minutes long videos May 24, 2024
@@ -44,7 +44,7 @@ class RemoteFileManager(private val device: AndroidDevice) {
}

companion object {
const val MAX_FILENAME = 255
const val MAX_FILENAME = 254 //we need 1 more char for fileNumber in case of using video attachment > 180 && apiLevel < 34
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constant is not specific for video files so it should never change. It's a detail about Android filesystem implementation. I suggest changing the logic of the code, not the constants here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -24,3 +24,5 @@ fun String.escape(): String {
}

val escapeRegex = "[^a-zA-Z0-9\\.\\#]".toRegex()

fun String.addFileNumberForVideo(fileNumber: String) = "${this.split(".mp4")[0]}$fileNumber.mp4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like very specific thing for stringextensions. I suggest putting this somewhere closer to the video file creation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

device.safePullFile(remoteFilePath, localVideoFile.toString())
localVideoFiles.add(localVideoFile)
} else {
for (i in 0 .. (videoConfiguration.timeLimit / 180)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that the actual number of files depends on the time the test took, not the configuration limit, so the loop should take into account only the time passed or/and number of shell invocations with screenrecord binary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Malinskiy
Copy link
Member

Thanks for submitting this @SergKhram

The idea is solid, I think it needs a little bit more work on the handling the number of files as well as the file naming. Your assumption about needing only 1 character holds true only if there are less than 10 video files. Supporting this feature means that marathon should handle even more than that, so likely the trimming should happen the same way as it does for other files to fit into the max file name length

@SergKhram SergKhram requested a review from Malinskiy May 24, 2024 17:42
Copy link

codecov bot commented May 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.93%. Comparing base (27ee994) to head (4ab20e1).
Report is 39 commits behind head on develop.

Current head 4ab20e1 differs from pull request most recent head 9f22612

Please upload reports for the commit 9f22612 to get more accurate results.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #939      +/-   ##
=============================================
+ Coverage      57.73%   57.93%   +0.20%     
- Complexity       813      832      +19     
=============================================
  Files            220      221       +1     
  Lines           4633     4736     +103     
  Branches         765      777      +12     
=============================================
+ Hits            2675     2744      +69     
- Misses          1605     1632      +27     
- Partials         353      360       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SergKhram SergKhram requested a review from Vacxe June 13, 2024 18:18
@SergKhram SergKhram requested a review from Malinskiy June 16, 2024 07:40
@SergKhram SergKhram force-pushed the feature/ISSUE-796/improve-screen-recorder branch from 85aad42 to f23ee90 Compare June 16, 2024 07:44
@SergKhram SergKhram force-pushed the feature/ISSUE-796/improve-screen-recorder branch from f23ee90 to 5316ba3 Compare June 16, 2024 07:53
@SergKhram SergKhram force-pushed the feature/ISSUE-796/improve-screen-recorder branch from fdb065a to 51d7cc0 Compare June 28, 2024 16:43
@SergKhram SergKhram requested a review from Malinskiy June 28, 2024 16:49
@SergKhram
Copy link
Contributor Author

@Vacxe waiting for merge

@Vacxe Vacxe changed the base branch from develop to extended-video-recording July 23, 2024 10:22
@Vacxe Vacxe merged commit 4bc0b39 into MarathonLabs:extended-video-recording Jul 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants