Page MenuHomePhabricator

[native] Use getVideoInfo from MediaModule instead of ffmpeg
ClosedPublic

Authored by angelika on Mar 20 2025, 4:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 24, 2:07 AM
Unknown Object (File)
Wed, Apr 23, 11:23 PM
Unknown Object (File)
Wed, Apr 23, 6:27 AM
Unknown Object (File)
Sun, Apr 13, 12:01 PM
Unknown Object (File)
Sun, Apr 13, 11:31 AM
Unknown Object (File)
Sun, Apr 13, 10:46 AM
Unknown Object (File)
Fri, Apr 11, 9:05 AM
Unknown Object (File)
Thu, Apr 10, 7:00 AM
Subscribers

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

angelika held this revision as a draft.
lib/types/media-types.js
135 ↗(On Diff #47482)

I don't know what format is in the original ffmpeg implementation. It's not documented anywhere and when I've tested it the ffmpeg implementation didn't even return it. Because it's later compared to "mp4" to check if format is correct I'm just returning the file extension. We can run more complicated checks but I think it's good enough for our usecase.

native/media/video-utils.js
261 ↗(On Diff #47482)

The native code can return all those values depending on a platform and a video and they're all h264.

Looking at this diff, the thing you did with format seems right

This revision is now accepted and ready to land.Mar 21 2025, 1:50 AM
native/media/video-utils.js
261 ↗(On Diff #47482)

If format wasn’t being set by ffmpeg, wouldn’t this check always fail? What happens if the check fails? If it’s not failing, then perhaps it’s worth understanding what ffmpeg is actually returning. Not sure it matters a lot though

262 ↗(On Diff #47482)

Should this and the above one be factored out to the root level to avoid redeclaring on every invocation?

angelika added inline comments.
native/media/video-utils.js
261 ↗(On Diff #47482)

I checked it and I must have printed a wrong thing because now I can see the format. But still it doesn't tell me much, for mp4 video I've got an array like [mov, mp4, ... a bunch of formats I don't know...]. So I'm leaving it as it is.