Can we use mp4box to read mp4 metadata and get resolution #600

Closed
opened 2025-12-23 09:50:33 +00:00 by GLlgGL · 1 comment
GLlgGL commented 2025-12-23 09:50:33 +00:00 (Migrated from github.com)

Hi

Can we use smth like this to read mp4 metadata and get the resolution(streamtape for example or others)
https://github.com/gpac/gpac/wiki/mp4box

If not can't be done why not guess by filesize?

Something like

`function estimateHeightFromSize(bytes: number): number | undefined {
const gb = bytes / 1024 ** 3;

// Heuristic thresholds for ~90–120 min movies
if (gb >= 1.7) return 1080;
if (gb >= 1.1) return 720;
if (gb >= 0.6) return 480;
return undefined;
}
`

Hi Can we use smth like this to read mp4 metadata and get the resolution(streamtape for example or others) https://github.com/gpac/gpac/wiki/mp4box If not can't be done why not guess by filesize? Something like `function estimateHeightFromSize(bytes: number): number | undefined { const gb = bytes / 1024 ** 3; // Heuristic thresholds for ~90–120 min movies if (gb >= 1.7) return 1080; if (gb >= 1.1) return 720; if (gb >= 0.6) return 480; return undefined; } `
GLlgGL commented 2025-12-23 10:11:48 +00:00 (Migrated from github.com)

Duplicate sorry

Duplicate sorry
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Creepso/webstreamr-github#600
No description provided.