Seeking in mpeg-ts over http

This forum is about all development around libVLC.
skogl
New Cone
New Cone
Posts: 2
Joined: 01 Oct 2018 00:03

Seeking in mpeg-ts over http

Postby skogl » 10 Oct 2018 11:52

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!

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Seeking in mpeg-ts over http

Postby Rémi Denis-Courmont » 10 Oct 2018 18:20

Seeking in MPEG-TS is inaccurate by design of MPEG-TS.

If you need accurate seeking, use a suitable container.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

skogl
New Cone
New Cone
Posts: 2
Joined: 01 Oct 2018 00:03

Re: Seeking in mpeg-ts over http

Postby skogl » 10 Oct 2018 19:06

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?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 17 guests