-
Notifications
You must be signed in to change notification settings - Fork 89
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
Video support: only show gstreamer output after player is initialized #222
Conversation
When having one (or more) videos on a slide there is the following effect: * First time opening this slide: 1+ video frames are black; then the video starts. * Second time opening this slide: Video seems to start on second 2 or 3 and then suddenly jumps backwards. It seems like this is caused by showing the video output before the player is fully initialized. This commit only shows the output after the video is initialized and avoid both effects. Tested on Ubuntu 20.04 with LaTeX Beamer slides.
I am not sure if this is a proper fix, or if this may cause side effects with other backends (e.g., gif). However, I feel it is easier to discuss it on a PR rather than an issue, since I already have a working workaround. |
Interesting, I’ll try to reproduce this. Does this only happen when auto-playing videos, or any videos? Indeed you seem to be hiding the overlay in I suppose the missing initialization steps are in |
I only checked it with auto-playing videos, which is my main use-case. I use LaTeX Beamer slides with multimedia and changed the pympress code to simply autoplay all videos (until #212 is fixed, I guess). I can update the PR once you have identified a good direction, or you can also fix it directly yourself and close the PR - Pympress is a great tool; Thanks a lot for all the hard work! |
In fact I don’t see a backwards jump, but I do see the timer with an incorrect duration ( |
@whoenig I’ve made some changes to make the Gst backend slightly more efficient. Can you see if the current master fixes your problem? Otherwise I’ve reimplemented your changes in the delay-gst-play branch in a somewhat more limited way and we can merge that. |
Thanks! I tested the latest master as well as delay-gst-play. I didn't notice any difference in behavior between those branches. For both branches, the first issue remains very noticeably (that is, when a slide is open for the first time, i.e., when the media is lazily initialized, there is at least one fully black frame shown). The second issue is significantly reduced, although still there with some videos. I couldn't really find a correlation between video properties and the jumpy behavior. All tests are on a Ubuntu 20.04 installation on a new Laptop with i7 processor. |
Great thanks for testing! The current master should fix the black-frames issue as well. |
I can confirm that the latest master branch doesn't have those issues anymore - Thanks! |
When having one (or more) videos on a slide there is the following
effect:
video starts.
and then suddenly jumps backwards.
It seems like this is caused by showing the video output before the
player is fully initialized. This commit only shows the output after
the video is initialized and avoid both effects.
Tested on Ubuntu 20.04 with LaTeX Beamer slides.