Skip to content

Commit

Permalink
[ADD] Added reasoning for frames + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondDashWu committed Jul 22, 2021
1 parent 1e1fde6 commit 513989b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/react/src/components/export-video/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ export function estimateFileSize(frameRate, resolution, durationMs, mediaType) {
return `${Math.ceil((resolution[0] / 1280) * frameRate * seconds * 0.125)} MB`;
}
if (mediaType === 'png') {
// NOTE frameRate + 1 because Hubble records 1 extra frame when outputting to pictures for some reason ¯\_(ツ)_/¯
// Note: Adds one frame to size to account for an extra frame when exporting to pictures.
return `${Math.floor(
((resolution[0] * resolution[1] * BIT_DEPTH) / MB) *
((frameRate + 1) * seconds) *
COMPRESSION_RATIO
)} MB`;
}
if (mediaType === 'jpeg') {
// NOTE frameRate + 1 because Hubble records 1 extra frame when outputting to pictures for some reason ¯\_(ツ)_/¯
// Note: Adds one frame to size to account for an extra frame when exporting to pictures.
return `${Math.floor(
((resolution[0] * resolution[1] * BIT_DEPTH) / MB) *
((frameRate + 1) * seconds) *
Expand Down

0 comments on commit 513989b

Please sign in to comment.