alamminsalo / orion

Cross platform Twitch.tv client
GNU General Public License v3.0
313 stars 60 forks source link

VOD playback positions from libmpv are offset #110

Closed rakslice closed 7 years ago

rakslice commented 7 years ago

When playing a VOD with libmpv, the playback position reported by the renderer is offset from the requested start time by an amount (I've seen it range from 1-5 minutes; it seems to be consistent for each particular VOD). If I change the quality setting, the current playback position is used as the start time for a new libmpv playback request, so the playback position jumps by this offset amount. Requests to seek with the seek bar remain consistent within the current libmpv offset time frame (so if I click the current playback position on the seek bar it continues playing at the current time and does not "jump").

This is occurring on Windows 10 with the latest libmpv from sourceforge and the official Qt 5.8 install from qt.io.

A build on Debian 8 (jessie) using Qt Multimedia with the official Qt 5.8 install from qt.io did not have this issue.

rakslice commented 7 years ago

If there's a proper way to get libmpv to compensate for this, I can't figure it out; the rebase-start-time option doesn't have any effect on the playback-time property values.

I put together a cheesy workaround, which just treats the first time update after playing resumes as the zero value and applies the opposite offset so that things outside the backend get and set positions based on a zero based start time.

ahjolinna commented 7 years ago

@rakslice : when you tried to build windows build with mpv have you tried MSYS2 edition of Qt Creator? and then orion could be compiled with a libmpv linked to MSYS2's ffmpeg libraries.

this is something what mpc-qt uses for it's windows build

rakslice commented 7 years ago

@ahjolinna No, I haven't; On Windows I've only used the msvc-based Qt & shinchiro's libmpv builds (they are built with mpv-winbuild-cmake, which supports multiple build platforms and TBH I don't know which one the posted libmpv builds are from)

ahjolinna commented 7 years ago

@rakslice : yeah that was more of (arch-)Linux solution thing, I'm really no windows expert (anymore) at least when it comes to pkgs building, anyway I did recommend this for @alamminsalo so I think he used that MSYS2 for the v1.4 build...

also I personally don't trust/like those premade builds if they aren't offical ones, that's why I would like that the orion's win (mac?) build would be build together with mpv (wrapped inside). and this would make it more easier for those users, I mean I doubt many will realise that you need to install mpv also, and where to get a (good) premade build.

ahjolinna commented 7 years ago

it seems I forgot what MSYS2 is or how it works.... you can also install in on windows not just on arch/linux directly: guide ..

rakslice commented 7 years ago

I just tested with the most recent libmpv build from mpv.srsfckn.biz and it doesn't have this issue or another I noticed: seek failures when loaded with a non-zero start option.

rakslice commented 7 years ago

@ahjolinna Do you mean a static build of libmpv? Presumably that would take a lot of work as it's not supported with the mpv codebase currently: https://github.com/mpv-player/mpv/blob/master/DOCS/compile-windows.md#linking-libmpv-with-msvc-programs

alamminsalo commented 7 years ago

With recent abandon of qtwebview components, it's possible to compile orion via mingw - therefore static mpv is possible. Correct me if I'm wrong, long time since I built with windows

ahjolinna commented 7 years ago

@rakslice : its not offically support not, but you can do it like mpc-qt and I think smplayer does it... bomi used its own "fork" to add some hacks to have that built-in mpv working ;: link

@alamminsalo : well I don't know why exactly mpc-qt uses MSYS2 instead of mingw and it doesn't either use the "qtwebview component"

maybe someone at the Qt IRC-channel's could help and explain, oh and MPV.

ahjolinna commented 7 years ago

@rakslice : current status ? can this be closed?