Time Out David

144 posts

Time Out David

Time Out David

@timeoutdavid

I post what I plan to do every weekday morning

参加日 Ağustos 2021
1 フォロー中5 フォロワー
Time Out David
Time Out David@timeoutdavid·
You may have been wondering where I've been all these years... easy... I've been tenting my fingers Future updates at @_earthchat
English
0
0
0
8
Time Out David
Time Out David@timeoutdavid·
moved back to <video> without webgl :( splitting to frames didn't yield any better performance. today: add scrubbable timeline
English
0
0
0
0
Time Out David
Time Out David@timeoutdavid·
plan is to use ffmpeg.js to split into frames; unfortunately, kagamihi/ffmpeg.js was not built with any still image encoders. trying to make a new build with a still image encoder (+ gif decoder)...
English
0
0
0
0
Time Out David
Time Out David@timeoutdavid·
Today: thinking about next steps in light of the issues posted above. one last test I want to do is to split videos into uncompressed frames and see how that goes. otherwise, probably back to <video>, but that route has a lot of issues as well :(
English
1
0
0
0
Time Out David
Time Out David@timeoutdavid·
faster version seems to be using a concrete URL (e.g. `/path/to/file.mp4`), while the slower one was using an object URL (from `URL.createObjectURL`), since it's coming from a file upload. I can fix by passing the Blob from the file upload to Video.srcObject, but only in Safari
English
0
0
0
0
Time Out David
Time Out David@timeoutdavid·
this is still confusing to me. here’s a test where I’m loading 11 videos from URL » <video> » THREE.VideoTexture – all load in ~3s. using almost the same code as above.
English
1
0
0
0
Time Out David
Time Out David@timeoutdavid·
Loading <video> metadata appears to be an order of magnitude slower on iOS Safari as opposed to desktop browsers (i.e. time between `load()` -> `loadedmetadata`): on desktop, a 1mb video takes ~60ms; on iOS, it's ~900ms
English
1
0
0
0
Time Out David
Time Out David@timeoutdavid·
tbc, I value rendering to WebGL for easy, wysiwyg export-to-video. rendering to DOM with <video> seems much more performant, so I think I'll probably fall back to that. easy export seems super important, though
English
0
0
0
0
Time Out David
Time Out David@timeoutdavid·
3. Convert base videos to uncompressed image sequences. Since videos are synced, could combine multiple videos onto a single "spritesheet" per frame (then cut the sheet up and composite on render). seems like this would be ~10x the storage if you start from an mp4 source video 😓
English
0
0
0
0
Time Out David
Time Out David@timeoutdavid·
2. Composite flat videos "just in time" via ffmpeg.js. This would be ideal – could reduce use to ~2 <video>s onscreen at any time. `overlay` via ffmpeg.js is slow on my iPhone (~10s). maybe this could work with a cache, but cache would become huge with infinite zoom
English
1
0
0
0
Time Out David
Time Out David@timeoutdavid·
tried a couple of approaches to make multiple composited videos with infinite zoom performant on mobile browser via WebGL, but not feeling optimistic about any of the approaches:
English
1
0
0
0
Time Out David
Time Out David@timeoutdavid·
Today: Make multiple composited <video>s -> three.js fast on iPhone
English
0
1
0
0
Time Out David
Time Out David@timeoutdavid·
<video> textures are also not great performance, but that seems more solvable (read: I am probably doing something stupid)
English
0
0
0
0
Time Out David
Time Out David@timeoutdavid·
pretty bad performance on iPhone. gifs can barely play via react-gifs -> THREE.CanvasTexture: kind of expected, but still a bummer. if I can't make react-gifs -> THREE fast, fallbacks are (1) convert via ffmpeg.js (idk how i'll do transparency), or (2) write WebGL gif player
English
1
0
0
0
Time Out David
Time Out David@timeoutdavid·
got videos playing through THREE.Texture on iPhone – key issue was that my <video>'s `canplaythrough` event was not firing on mobile Safari, which was fixed by removing the `src` attribute from JSX and instead setting `src` in a `useEffect`. ¯\_(ツ)_/¯
English
1
0
0
0