xbmc / inputstream.ffmpegdirect

Supports streams opened by FFmpeg's libavformat or Kodi's cURL such as plain TS, HLS and DASH (non-DRM) as well as many others. There is support for Archive/Catchup services where there is a replay window and can timeshift across that span. Also provides timeshift for live streams where rewind/pause and fast-forward would not have been available.
GNU General Public License v2.0
57 stars 40 forks source link

Seek issue with ffmpeg 6 #244

Closed vpeter4 closed 5 months ago

vpeter4 commented 10 months ago

Now that Kodi got ffmpeg seek issue fixed the changes should be also copied to this addon because from quick look it shares same code?

https://github.com/xbmc/xbmc/pull/23557

https://github.com/xbmc/inputstream.ffmpegdirect/blob/Omega/src/stream/FFmpegStream.cpp#L1133 https://github.com/xbmc/inputstream.ffmpegdirect/blob/Omega/src/stream/FFmpegCatchupStream.cpp#L365

phunkyfish commented 10 months ago

This could be problematic. UpdateCurrentPTS was the mechanism used to apply the seek offset for Catchup streams

Maybe Arthur Liberman has some insight. I can take a look at it in more detail next week.

vpeter4 commented 10 months ago

There are 2 commits in Kodi's PR - one is this UpdateCurrentPTS and second something else.

phunkyfish commented 10 months ago

Correct, I’m not sure how the other one affects us yet, but it appears less problematic.

phunkyfish commented 9 months ago

I've ported one of the commits, the other I don't have an answer for currently: https://github.com/xbmc/inputstream.ffmpegdirect/pull/251

@garbear if you have some time could you take a look?

phunkyfish commented 5 months ago

@vpeter4 can you test this PR: https://github.com/xbmc/inputstream.ffmpegdirect/pull/265

It should solve the seek problems. There was actually a follow on PR as well that needed to be included. I don't have a local build env currently so testing for me is tricky. Will update with testbuilds once they are ready.

phunkyfish commented 5 months ago

Testbuilds: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.ffmpegdirect/detail/PR-265/6/artifacts

vpeter4 commented 5 months ago

No files on this link. Looks like the build failed?

phunkyfish commented 5 months ago

Let me rebuild it.

phunkyfish commented 5 months ago

Here you go, new testbuilds: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.ffmpegdirect/detail/PR-265/35/artifacts

vpeter4 commented 5 months ago

KodiSetup-20240128-2347e67d-master-x64.exe + addon with this pr seeking generally works but it has some issues

live playback - OK screenshot00001

live playback + seek 10 minutes - OK screenshot00002

play from EPG - not OK missing timing information for start/end of the show, seeking possible only till start/end of the show screenshot00003

phunkyfish commented 5 months ago

Do you mean you can't seek till to the middle of the show?

phunkyfish commented 5 months ago

I'll create another build with a test commit to see if restoring some of the old current PTS update points helps with the Play from EPG case.

It's must be that the start time is required and not correctly set.

phunkyfish commented 5 months ago

Ok, new testbuilds: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.ffmpegdirect/detail/PR-265/37/artifacts

vpeter4 commented 5 months ago

No visible change with second addon above. The problem is that when show is selected from EPG there is no timing information visible like shown on image. And you can seek only from the begining till end of the current show and not for example 10 hours more in the past.

phunkyfish commented 5 months ago

If you start from live playback can you move to the start and then to the previous programme?

phunkyfish commented 5 months ago

What I really need at the moment is some test streams and a working dev environment. I’ll work on the latter today. Building everything via Jenkins time consuming

phunkyfish commented 5 months ago

No visible change with second addon above. The problem is that when show is selected from EPG there is no timing information visible like shown on image. And you can seek only from the begining till end of the current show and not for example 10 hours more in the past.

What are the results with the existing release? I.e. without this PR?

vpeter4 commented 5 months ago

What are the results with the existing release? I.e. without this PR?

Exactly the same as with this PR - I don't see any difference? From user perspective this PR doesn't solve anything. I should start testing official addon first. Both official addon and with this PR behaves the same. The other option is that I'm doing something wrong :(

Looks like something had to be changed in Kodi or with IPTV Simple Client from the last time I checked this issue because last time seeking was not possible (usually Kodi just crashed).

If you start from live playback can you move to the start and then to the previous programme?

Yes, it working fine like that. No issues.

Update: Made fresh Windows install and it works the same as with this PR.

phunkyfish commented 5 months ago

I don’t think you are doing something wrong. Seeking behaviour changed in kodi, that was probably the original crash.

Let me cut you a few different builds for comparison reasons and we can see what the state of play for each is.

phunkyfish commented 5 months ago

Ok, you let's start with the basic versions. The first is the current official release 21.2.0. You should be able to install that from the repo.

Secondly I have a these testbuilds for 21.2.1, that include all the dependencies updated: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.ffmpegdirect/detail/PR-267/7/artifacts

My guess is that the change in kodi should mean that both these versions provide the same behaviour. If so that proves the change in kodi might be incomplete.

Let me know and we can figure out what to test after that.

vpeter4 commented 5 months ago

I don't see an functional difference between version installed from Kodi repo and this version above.

phunkyfish commented 5 months ago

I don't see an functional difference between version installed from Kodi repo and this version above.

So functionally all the testbuilds I have given you have the same behaviour?

vpeter4 commented 5 months ago

I don't see an functional difference between version installed from Kodi repo and this version above.

So functionally all the testbuilds I have given you have the same behaviour?

Yes. Play from EPG doesn't pass start/end timing information and that's why seeking doesn't work as expected.

phunkyfish commented 5 months ago

Ok, so I'm going to merge all the dependency upgrades, and also merge sync with kodis inputstream and then we can focus on what and just this specific issue. Will let you know once I have more to test.

Thanks for all your help so far.

phunkyfish commented 5 months ago

Ok, so trying to track this down I think the problem is actually in pvr.iptvsimple. I wonder if some behaviour changed in Kodi Omega, not too sure.

Please try these testbuilds for pvr.iptvsimple for Omega: https://jenkins.kodi.tv/blue/organizations/jenkins/kodi-pvr%2Fpvr.iptvsimple/detail/PR-830/1/artifacts

If this fix works, I really don't understand how it's working on Nexus. Did you test on Nexus?

vpeter4 commented 5 months ago

Still no difference with this addon above.

And behaviour in Kodi Nexus is exactly the same. At least in 20.3 version. But I'm sure it worked in the beginning of the cycle. Because I'm on Kodi 19 I can't say when it got broken. Which means this functionality is not widely used?

phunkyfish commented 5 months ago

It works for many people. I believe it’s something to with your particular streams.

To fix this I’m going to need access to your streams so I can reproduce and fix. Can we set that up somehow?

Are you in gitter.im? Or some other chat tool?

vpeter4 commented 5 months ago

Good news - got it first working on Nexus.

For some reason I need to have enabled "Play from EPG in Live TV mode (using timeshift)" and now play from EPG works and shows correct timing information and seek works. I don't have this enabled on Kodi Matrix and still works ok. But this is not really important information.

Then I switched to Kodi Omega with pvr iptvsimple addon above and got same play from EPG working the same way I'm used too. So I would say PR-830 works and then pvr iptvsimple and inputstream ffmpegdirect are back in working condition :)

This tests were done on Windows and I will check on CoreELEC soon.

Update: still some issue on CE: getting kodi crash.

phunkyfish commented 5 months ago

Excellent on both counts, also that PR830 is good.

is it PR 830 you are testing on correct? Along with the latest released ffmpegdirect version?

vpeter4 commented 5 months ago

Correct: pvr.iptvsimple 21.7.1 + PR 830 (your addon above) and inputstream.ffmpegdirect 21.3.2.

phunkyfish commented 5 months ago

Excellent, I’ll merge this so. If you come across any other issues please let me know.

phunkyfish commented 5 months ago

Closed by https://github.com/kodi-pvr/pvr.iptvsimple/pull/830