Skip to content

Demuxer fails when reading a stream that was already transmitting #71

Description

@hxtk

I have some streams over UDP multicast that basically run 24/7, and I have been trying to capture them with this package. However, since I join after the stream has already started, it seems like it's basically random where I join the stream. The Sync byte won't always be the first byte the reader encounters.

This breaks packet size detection, and if I set the size with an option, I immediately get "packet must start with sync byte."

I've implemented a hack to get around this by wrapping the io.Reader in a bufio.Reader, peeking the first 193 bytes and discarding up to the first sync byte before I hand the reader off to the Demuxer, but that feels like a lot of MPEG-TS to leak outside the abstraction. Even the astits-probe program, which supports UDP multicast sources, suffers from this: you must start the probe before the stream begins transmitting to reliably sync up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions