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

Time/size estimation for export #224

Open
richiemcilroy opened this issue Dec 19, 2024 — with Linear · 7 comments · May be fixed by #231
Open

Time/size estimation for export #224

richiemcilroy opened this issue Dec 19, 2024 — with Linear · 7 comments · May be fixed by #231

Comments

Copy link
Collaborator

richiemcilroy commented Dec 19, 2024

Add a time (how long it will take to export), and a size (how large the file will be), to below the export button.

This needs to be added to both the prev-recordings window thumbnails, and Editor.

@richiemcilroy richiemcilroy added the Feature label Dec 19, 2024 — with Linear
@richiemcilroy
Copy link
Collaborator Author

/bounty $100

Copy link

algora-pbc bot commented Dec 19, 2024

💎 $100 bounty • Cap

Steps to solve:

  1. Start working: Comment /attempt #224 with your implementation plan
  2. Submit work: Create a pull request including /claim #224 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to CapSoftware/Cap!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @Gyan-max Dec 20, 2024, 7:21:27 AM WIP
🟢 @onyedikachi-david Dec 27, 2024, 6:48:53 PM #231

@Gyan-max
Copy link

Gyan-max commented Dec 20, 2024

/attempt #224

@Gyan-max
Copy link

Brief Implementation Plan for Issue #224

  1. Locate Export Button in Code

    • Identify the components rendering the export button in:
      • Prev-recordings window thumbnails.
      • Editor.
  2. Add UI for Time & Size Display

    • Add placeholders below the export button:
      <div class="export-info">
        <span class="export-time">Time: Calculating...</span>
        <span class="export-size">Size: Calculating...</span>
      </div>
  3. Implement Calculation Logic

    • Write a utility function to estimate:
      • Export Time: Based on video length and encoding speed.
      • File Size: Based on bitrate, resolution, and length.
      function calculateExportInfo({ length, bitrate }) {
        const time = (length / 60) * 2; // Example: 2x speed
        const size = (length * bitrate) / 8 / 1024 / 1024; // MB
        return { time: `${Math.ceil(time)} min`, size: `${Math.ceil(size)} MB` };
      }
  4. Integrate Dynamic Updates

    • Hook the calculation logic into thumbnail and editor states:
      const exportInfo = calculateExportInfo(videoProperties);
      setExportInfo(exportInfo);
  5. Styling

    • Ensure the display matches the existing design:
      .export-info { font-size: 0.85em; color: gray; margin-top: 5px; }
  6. Testing

    • Test functionality in various scenarios:
      • Short/long videos.
      • Different resolutions and bitrates.

@onyedikachi-david
Copy link
Contributor

onyedikachi-david commented Dec 27, 2024

/attempt #224

Algora profile Completed bounties Tech Active attempts Options
@onyedikachi-david    1 CapSoftware bounty
+ 13 bounties from 6 projects
TypeScript, Python,
JavaScript & more
Cancel attempt

@onyedikachi-david onyedikachi-david linked a pull request Dec 27, 2024 that will close this issue
Copy link

algora-pbc bot commented Dec 27, 2024

💡 @onyedikachi-david submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@richiemcilroy
Copy link
Collaborator Author

Hey @onyedikachi-david. Thanks for this. Need to change it so that it does the following:

  • The time estimation should be the longest of either camera.mp4 or display.mp4.
  • Need to have an estimation of the rendered file size, not the current file size of the source file

let me know if you need anything else from me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants