Page 1 of 1

Seeking in mpeg-ts over http

Posted: 10 Oct 2018 11:52
by skogl
Hi,

I have been struggeling with this now for several days and I just can't get it to work as I would like.

The problem I have is with setPosition. I is VERY unreliable. I have been using a simple test where i just use setPosition(0.5f) to be able to seek to the middle of the stream. It does seek but not as expected. The larger the stream the more off it is - about 20 seconds for an hour long stream.
I have been trying with every option I can figure out (--no-ts-trust-pcr, --ts-seek-percent …) but the result is always the same. setTime() does not seem to work at all.

Is there anything I can do here to be able to get a normal working seek working? I am using the Android implementation if that is of any use.

Suggestions are much appreciated!

Re: Seeking in mpeg-ts over http

Posted: 10 Oct 2018 18:20
by Rémi Denis-Courmont
Seeking in MPEG-TS is inaccurate by design of MPEG-TS.

If you need accurate seeking, use a suitable container.

Re: Seeking in mpeg-ts over http

Posted: 10 Oct 2018 19:06
by skogl
So I've heard, but since the stream source is DVB I have no way of changing it unless some kind of transcoding, and I don't think that is possible here. But "inaccurate" to me is like 1, maybe 2 seconds off. I have 20-40 seconds for an hour long video. I can't help to think that if I was able to set duration somehow it would be easier for libvlc to calculate position, yes?

Do you have any other ideas om how I would be able to love forward?