Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPEGTS seeking capability #966

Closed
amoussawi opened this issue Nov 17, 2015 · 5 comments
Closed

MPEGTS seeking capability #966

amoussawi opened this issue Nov 17, 2015 · 5 comments

Comments

@amoussawi
Copy link

Hello...why isn't possible to seek a MPEGTS stream? MPEGTS is providing a great advantage for my application but the drawback is that I'm not able to seek. My case is that I'm streaming MP4 through UDP, and some packets might get dropped so instead of re-transmission I replace the dropped frame by an old frame but doing this is causing problem with Exoplayer(the video doesn't even play) unless I used MPEGTS container format where it distorts as expected but at least it continues playing.

@ojw28
Copy link
Contributor

ojw28 commented Nov 17, 2015

Unlike containers such as MP4, MPEG-TS doesn't contain an index structure to allow seeking (i.e. a structure that allows mapping from time->byteOffset). Hence seeking in an MPEG-TS stream requires the player to either download the whole stream, scan it and build an index itself, or to guess based on average bitrate assumptions. We've decided to only support seeking in container formats that are properly designed to support it, which MPEG-TS is not.

As an aside, note that seeking is possible in HLS, even though it uses MPEG-TS, because in HLS a separate media playlist is provided to serve as an index structure.

It seems strange to be using UDP for seekable streams. What's your use case exactly? Why don't you just use MP4 over TCP? It's not valid, in general and for any container format, to replace dropped frames with other frames taken from the stream.

@amoussawi
Copy link
Author

I will take a look into HLS if I could do a work around.
Well it will only be possible to seek backward and not forward using a cache.
I'm replacing frames because I cannot skip frames, and I guess this should be the case when live streaming, and my case is that I'm not using a media source from which to request the data at anytime, request happens only once and then data transmission starts through UDP until end of stream is reached.

@Avetri
Copy link

Avetri commented May 23, 2016

Indexing of TS files there are In solutions like DVR. So, if somebody would be so interested, an indexer might help.

@amoussawi
Copy link
Author

Actually I already worked on it and used PCR value in the TS packet header for indexing. You can take a look at it on pull request #1274

@google google locked and limited conversation to collaborators Jun 28, 2017
@ojw28
Copy link
Contributor

ojw28 commented Aug 6, 2018

Now supported in dev-v2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants