Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes subtitles are not visible/video stutters #12

Closed
stebotron opened this issue Oct 25, 2018 · 14 comments
Closed

Sometimes subtitles are not visible/video stutters #12

stebotron opened this issue Oct 25, 2018 · 14 comments

Comments

@stebotron
Copy link

stebotron commented Oct 25, 2018

  1. Sometimes every second or third (I haven't really noticed any system) subtitle is not displaying (or invisible to be exact, since I can translate "invisible" words with cursor over them) if "extend_subs_duration2max_B = True". Such "invisible" subtitles appear for a fraction of second and then become invisible.

  2. Video stutters a little on subtitle change, but this is noticable and quete annoying.

System: ArchLinux, Python 3.7.1, KDE plasma 5.14.2

@oltodosel oltodosel changed the title Sometimes subtitles are not visible Sometimes subtitles are not visible/video stutters Oct 25, 2018
@oltodosel
Copy link
Owner

Does it happen in other WM?

@stebotron
Copy link
Author

Number 1 happens only in KDE, there is no such issue in LXDE. Number 2 happens both in KDE and LXDE.

@oltodosel
Copy link
Owner

    1. Most likely KDE hijacks window focus and interSubs 'thinks' mpv window was switched or minimized with xdotool getwindowfocus getwindowname.
    2. Maybe try playing with kwin settings.
    3. Or use different WM. Can't help there.

    1. Try increasing mpv's cache. If your /tmp is on the same disk as a video file - it might cause stutters from mpv's side.
    2. Looks at cpu usage during the sub change with something like htop -d1. Although it works well on 8y.o intel i3
    3. Is also might be something with composite manager. Try a different one.

@stebotron
Copy link
Author

stebotron commented Oct 25, 2018

  1. I tried to remove completely section "# hide subs when mpv isn't in focus or in fullscreen" with "xdotool getwindowfocus getwindowname". No effect at all. Problem remains.

  2. CPU usage < 10%, /tmp is in the ram. Anyway, just wanted to let you know, that there is such problem with video stuttering with different WM.

@oltodosel
Copy link
Owner

Can't reproduce, so there's nothing I can help you with besides as I've said previously - try another composite manager.
If you'll find a solution - be sure to post it.

@stebotron
Copy link
Author

stebotron commented Oct 25, 2018

Stuttering is rather subtle, and can be clearly seen only in dynamic scenes, maybe you are just not noticing it? I tried kwin manager in KDE and compton composite manager in LXDE. Both have stuttering. Just tried xcompmgr, small stuttering remains. Missing subtitles only with kwin.

@oltodosel
Copy link
Owner

Maybe try xcompmgr. Idk. Because your description suggest that your composite manager can't handle it. Try changing rendering backend.
I might be mistaken, but I vaguely remember something similar with other C.M. back when I wrote interSubs.

Believe me, if there was some stuttering at my system, I would've noticed.

p.s.
You can always use Tk version. It doesn't need C.M.

@stebotron
Copy link
Author

By the way in KDE when "extend_subs_duration2max_B = False" there are no problems with missing subtitles, only when "extend_subs_duration2max_B = True". This is very strange. Anyway, thanks for your help and very useful software!

@stebotron
Copy link
Author

I solved stuttering by changing video output in mpv from vdpau to gpu (mpv -vo gpu). Problem with missing subtitles when extended duration in kde still remains.

@oltodosel
Copy link
Owner

As I've suggested in previous message, have you tried changing rendering backend at kwin?
Or simply switch from kwin to other C.M. (if it's possible in KDE)

@stebotron
Copy link
Author

stebotron commented Oct 29, 2018

Yes, I tried all, xrender, OpenGL 2, OpenGL 3.1, disabling vsync, no effect. I just disabled extended duration, this is not so important. I can switch to openbox+compton instead of kwin while running KDE, then I don't have missing subtitles, kind of a solution, but I don't see the point to do so. I stay with kwin and without extended duration for now. Maybe I'll find a solution with time other then switching from kwin to something else.

@stebotron
Copy link
Author

stebotron commented Oct 29, 2018

Solved missing subtitles with extended duration by adding small delay "time.sleep(0.1)" in "def render_subtitles" after the line "self.clearLayout('subs2')" (line 1452 in current version).

@oltodosel
Copy link
Owner

Strange. But since it works for you - good.
See if it works with sleep(0.01) - it should be plenty. 100ms is quite noticeable delay with subtitles.

@stebotron
Copy link
Author

stebotron commented Oct 29, 2018

It seems to me that self.clearLayout without delay was applying right after new subtitle appears. Maybe it is too slow (if kwin is used) or called a little later then necessary for some reason. Short (few words) subtitles where missing much more often, maybe because they are faster to render and they are rendered before self.clearLayout apply? At least that is what I thought when I added this line. I haven't understood the logic of the program completely yet. Sleep(0.01) work just fine too. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants