A change between streams with different packet ids loses the new stream for a media server #174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
One site's stream uses other MPEG-TS packet ids than the rest. On recordings of 2026-11-14:
Read offline across a change between the two,
ffmpeg -f hls -i <playlist> -c copy -copytslogged "New video stream" and "New audio stream" at the change and dropped the new stream's packets. A reader that copies would have no picture or sound after such a change until it is tuned again.This is on
maintoday, at any change of stream between two such links. Pull request #172 (#168) neither causes nor fixes it. A fault of the same family is on record: on 2026-10-29 a change of picture format at a splice hung Emby's transcode until the viewer re-tuned.What is known, and what is not
The idea
The channel gives every segment it serves its own packet ids and tables (PAT, PMT), where it already rewrites the packets for the clock (
tsclock.restamp) and the sound (audionorm.py,tsmux.py). A change of stream then looks like one stream to a reader.First step, before any code: reproduce it without a site. Two short generated streams, one on other ids (
-streamid 0:211 -streamid 1:221), in one playlist with a discontinuity between them, read by ffmpeg's copy, by ffmpeg re-encoding, and by hls.js.Done when
In the unit lane, with generated streams:
ffmpeg -f hls … -c copy -copytsacross it carries the second stream's picture and sound, and no timestamp goes backwards.Live: a swap onto a zkotaa.cfd link while watching through Emby keeps picture and sound.
backend/app/channel.pyis also edited by #169 and #170.