The 'preparing' phase (everything before the video encode) can last a long time. Likely contributors, roughly in order:
Audio extraction decodes the entire audio to a PCM wav (a full decode pass per audio stream), then opusenc encodes it - a serial pass before video starts. For multi-audio sources this is done one stream at a time.
Several ffprobe calls (media info, stream languages, zscale, duration) + the OMDb/TVmaze fetch.
Optimisation ideas (KEEP opusenc - see constraint below):
Pipe ffmpeg PCM straight into opusenc stdin to skip the intermediate wav FILE (avoids writing+reading a possibly multi-GB wav; keeps opusenc).
Extract/encode multiple audio streams in parallel instead of sequentially.
Sample fewer idet frames, or skip detection when the source is known progressive.
CONSTRAINT: do NOT replace opusenc with ffmpeg's libopus to 'save a pass'. ffmpeg's opus encoder mis-handles multichannel (e.g. 5.1 side channels are not detected correctly and need special mapping); opusenc is deliberate and required (see SPEC.md). The decode->wav->opusenc split exists for this reason.
UX side: the dashboard collapses the 'probing' and 'audio' phases into one 'preparing' label; surfacing the real phase (probing vs extracting/encoding audio) would make the wait self-explanatory. The tracker already distinguishes them.
The 'preparing' phase (everything before the video encode) can last a long time. Likely contributors, roughly in order:
- Audio extraction decodes the entire audio to a PCM wav (a full decode pass per audio stream), then opusenc encodes it - a serial pass before video starts. For multi-audio sources this is done one stream at a time.
- Interlace detection runs 'ffmpeg -vf idet -frames:v 400' (decodes 400 frames).
- Several ffprobe calls (media info, stream languages, zscale, duration) + the OMDb/TVmaze fetch.
Optimisation ideas (KEEP opusenc - see constraint below):
- Pipe ffmpeg PCM straight into opusenc stdin to skip the intermediate wav FILE (avoids writing+reading a possibly multi-GB wav; keeps opusenc).
- Extract/encode multiple audio streams in parallel instead of sequentially.
- Sample fewer idet frames, or skip detection when the source is known progressive.
CONSTRAINT: do NOT replace opusenc with ffmpeg's libopus to 'save a pass'. ffmpeg's opus encoder mis-handles multichannel (e.g. 5.1 side channels are not detected correctly and need special mapping); opusenc is deliberate and required (see SPEC.md). The decode->wav->opusenc split exists for this reason.
UX side: the dashboard collapses the 'probing' and 'audio' phases into one 'preparing' label; surfacing the real phase (probing vs extracting/encoding audio) would make the wait self-explanatory. The tracker already distinguishes them.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The 'preparing' phase (everything before the video encode) can last a long time. Likely contributors, roughly in order:
Optimisation ideas (KEEP opusenc - see constraint below):
CONSTRAINT: do NOT replace opusenc with ffmpeg's libopus to 'save a pass'. ffmpeg's opus encoder mis-handles multichannel (e.g. 5.1 side channels are not detected correctly and need special mapping); opusenc is deliberate and required (see SPEC.md). The decode->wav->opusenc split exists for this reason.
UX side: the dashboard collapses the 'probing' and 'audio' phases into one 'preparing' label; surfacing the real phase (probing vs extracting/encoding audio) would make the wait self-explanatory. The tracker already distinguishes them.