kiall / android-tvheadend

Android + TV Headend + TV Input Framework
Apache License 2.0
191 stars 61 forks source link

Whats the trick for rewind timeshift? #249

Open mattgorski opened 6 years ago

mattgorski commented 6 years ago

I have been trying to figure out how to get timeshift with rewind first working and I can not figure this out. Ive built latest dev branch and im running stable 4.2 and I can not get timeshifting working at all on android. I only get the error unsupported.

Full rights to recording/timeshift directory. Tried in RAM and in DISK no go for either.

mattgorski commented 6 years ago

VDR robotv works perfect for backend/frontend timeshift with rewind first. Might try to implement the timeshift functions....

mattgorski commented 6 years ago

Ill try to implement some of the timeshift functions from vdr robotv:

https://github.com/Plex-VDR-HDHomerun/roboTV/blob/master/robotv-atv/src/main/java/org/robotv/tv/RoboTvSession.java#L142

VDR backend works the same way as tvh so implementing this timeshift method for file not ram should work just fine for rewind first. Ill keep this issue updated when successfully built and tested...

mattgorski commented 6 years ago

So no one with tvheadend-android has timeshift working? @kiall can you provide some feedback?

mattgorski commented 6 years ago

Well after no response on this i started working on my own fork with a new timeshift implementation. When (and if) it is stable ill do a PR with all work done ;)

Benoire commented 6 years ago

I would be keen to see what you have produced. Kiall appears to have stopped working on this for the moment.

I'd be very interested in knowing whether it is possible to buffer the stream locally and then ffw/rw through that instead as that would give us the same skipping ability as a freesat box but via the network... I guess you'd not implement the TVH api for ffw/rw and instead just let the stream play and use the local android TV functions?

mattgorski commented 6 years ago

It is possible with googles open source LiveTv buffer code:

https://android.googlesource.com/platform/packages/apps/TV/+/master/src/com/android/tv/tuner/exoplayer/buffer/BufferManager.java

Im testing the previous PR from here https://github.com/kiall/android-tvheadend/pull/243 tonight and my own implementation as well. I will report back results...

Benoire commented 6 years ago

If it was a selectable option to either buffer locally or use the TVH buffer that would make it better as some users may not be able to sacrifice the write capacity of their units and the TVH buffer is better, where as those with attached storage could.

Will you be making your code public as it might be easier if you want it tested to post it there and users can raise issues.

mattgorski commented 6 years ago

As soon as I can produce a working ff-rw buffer I will post the branch and builds I am working on :) Lots of work to come...