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

fix(export): prevent export progress from freezing at 102% #232

Conversation

onyedikachi-david
Copy link
Contributor

Description

This PR fixes issue #228 where video export progress gets stuck at 102% for longer videos. The fix addresses both the backend frame calculation and frontend progress handling.

/claim #228

Fixes

Closes #228

Copy link

vercel bot commented Dec 27, 2024

@onyedikachi-david is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@steven-the-qa steven-the-qa left a comment

Choose a reason for hiding this comment

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

I don't see anything alarming, but I'll let one of the maintainers approve. I can do a quick QA review when I get home a few hours.

EDIT: I'm unable to log into the app but can confirm the app builds locally. I think my dev environment is missing an API key or something, Stripe's complaining in the console 🙄

Math.round(
(p.current_frame / (progressState.totalFrames || 1)) * 100
),
100

Choose a reason for hiding this comment

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

Why do we use 'Math.min' 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.

so it will not exceed 100%

@steven-the-qa
Copy link

I don't see anything alarming, but I'll let one of the maintainers approve. I can do a quick QA review when I get home a few hours.

@steven-the-qa
Copy link

steven-the-qa commented Dec 28, 2024

I can confirm the build on this branch is successfully exporting the videos, but the UI still shows the wrong % when the export completes.

I also wasn't able to create an exported mp4 using the .cap file from the recording I originally had problems with. It seems the exports work OK if the video was recorded on the same build I'm using to export it.

I've attached evidence here: https://drive.google.com/drive/folders/1CbylevoffsDtLUckU7ssmvN6g8qXfrk7?usp=sharing cc: @richiemcilroy

@onyedikachi-david
Copy link
Contributor Author

onyedikachi-david commented Dec 28, 2024

Cap.2024-12-28.at.08.32.19.mp4

@steven-the-qa Thanks for the review, i just implemented a fix addressing your observations.

@steven-the-qa
Copy link

Cap.2024-12-28.at.08.32.19.mp4

@steven-the-qa Thanks for the review, i just implemented a fix addressing your observations.

Not sure what's going on on my machine, but I don't see the original .cap file exporting successfully. I see the same behavior. I didn't check behavior of new recordings. It seems you may have done that, though.

@onyedikachi-david
Copy link
Contributor Author

onyedikachi-david commented Dec 28, 2024

That's weird. Could you clarify what you mean by "original .cap files"

@steven-the-qa
Copy link

steven-the-qa commented Dec 28, 2024

That's weird. Could you clarify what you mean by "original .cap files"

https://drive.google.com/drive/folders/1CbylevoffsDtLUckU7ssmvN6g8qXfrk7?usp=drive_link here are the 2 .cap files I had trouble exporting, from when I originally reported the bug.

Also, I noticed something odd about the .cap contents. The display.mp4 is much shorter than the audio-input.mp3 and camera.mp4 files, and when I saw an incorrect video timestamp on that post-recording tiny window, it matched the timestamp of the display.mp4. The real issue might be that the display.mp4 stopped recording too early.
Screenshot 2024-12-28 at 3 17 42 PM
Screenshot 2024-12-28 at 3 17 55 PM
Screenshot 2024-12-28 at 3 18 02 PM

1 more insight:

It's possible this could have been caused by low storage capacity. I had filled ~99% of my storage capacity on my Macbook Air around the time I recorded that video. Now, interestingly, after I freed up 50% of my storage, I'm not able to reproduce the bug on the latest release version. Could be a coincidence. Maybe not

@onyedikachi-david
Copy link
Contributor Author

About the storage Issue (My Rust projects are just taking up storage space on my laptop 😄 ). I noticed an issue while testing: twice during recording sessions that showed as 5 minutes long in the UI tray, the editor only displayed 48 seconds of content when opened. Upon checking the logs, I found:

@cap/desktop:dev: Waiting for play signal...
@cap/desktop:dev: Starting pipeline execution
@cap/desktop:dev: Sending signal Play to screen_capture
@cap/desktop:dev: Screen recording started.
@cap/desktop:dev: Screen capture error occurred.
@cap/desktop:dev: Capture error: receiving on a closed channel
@cap/desktop:dev: Shutting down screen capture source thread.
@cap/desktop:dev: Received last screen frame. Finishing up encoding.
@cap/desktop:dev: Shutting down screen video encoding thread
@cap/desktop:dev: Shutting down pipeline execution
@cap/desktop:dev: Sending signal Shutdown to screen_capture
@cap/desktop:dev: screen_capture is unreachable!
@cap/desktop:dev: Pipeline has been stopped.

It appears the recording stopped prematurely (possibly due to storage issues or other constraints), but this failure isn't being communicated to the UI, which continues to show the recording as active.

@steven-the-qa
Copy link

twice during recording sessions that showed as 5 minutes long in the UI tray, the editor only displayed 48 seconds of content when opened. Upon checking the logs, I found:

That's exactly what I saw!

@richiemcilroy
Copy link
Collaborator

Hey @onyedikachi-david, I've just pushed up a bunch of fixes/changes.

Going to decrease the bounty to $100, but still award it.

Took a while for me to get this done 😄

@richiemcilroy richiemcilroy merged commit ac2f956 into CapSoftware:main Jan 6, 2025
0 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rendering never finishes for 13-minute video (frozen at 102%)
3 participants