Bug 397948 - Animation stops working in presentation mode
Summary: Animation stops working in presentation mode
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.3.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-27 18:41 UTC by Jay Schieber
Modified: 2024-07-26 12:16 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
example problem (277.84 KB, application/pdf)
2018-08-29 20:59 UTC, Jay Schieber
Details
Test file (animate+beamer works in presentation mode) (590.58 KB, application/pdf)
2020-06-08 16:40 UTC, Yuri Chornoivan
Details
Minimal working example (tex+png) (506.54 KB, application/x-bzip)
2020-06-08 17:18 UTC, Yuri Chornoivan
Details
Example with buttons (works) (589.24 KB, application/pdf)
2020-06-08 19:07 UTC, Yuri Chornoivan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Schieber 2018-08-27 18:41:26 UTC
I have had animation working for several years with LaTeX Beamer, when using the multimedia package.  I recently upgraded to Ubuntu 18.04.  The animation in Okular works fine as a window, but when I switch to presentation mode it no longer works. Some new control buttons show up, but no animation.  I could try to provide a minimal working example, if you need it, but the switches look like this:

\movie[
  showcontrols,
  autostart,
  loop,   % play continuously
] 
{\includegraphics[width=\textwidth]{../frame_capture.png}}
{movie.m4v}
Comment 1 Jay Schieber 2018-08-29 20:59:20 UTC
Created attachment 114689 [details]
example problem

Here is an example of a pdf made from latex.  There are four slides, and an animation on each slide. The first slide animation works in presentation mode.  The remaining slides show animation only when not in presentation mode.  
If I delete the first slide from latex and recompile, then the new first slide
(the previous second slide) now works in presentation mode, but the others do not. If I remove the first slide using pdftk, then the same behavior is seen: whatever the first slide is works, and the remaining do not.  I am not able to check if this problem persists in later versions of okular (say 1.4), since I am unable to compile it on ubuntu 18.04
Comment 2 Jay Schieber 2018-08-29 21:20:08 UTC
OK, another comment.  I installed okular using snap, which was a higher version, 1.4.4.  This worked somewhat better, but still had an issue in one of the animations.
Comment 3 Oliver Sander 2018-08-31 11:49:09 UTC
Hi Jay, unfortunately your example does not contain the actual movie files.  Apparently they are not actually embedded with the pdf file.

And what do you mean by "but still had an issue in one of the animations." ?
Comment 4 Jay Schieber 2018-08-31 14:28:59 UTC
(In reply to Oliver Sander from comment #3)
> Hi Jay, unfortunately your example does not contain the actual movie files. 
> Apparently they are not actually embedded with the pdf file.
> 
> And what do you mean by "but still had an issue in one of the animations." ?

Hmmm.  I am not so sure about the movies being embedded.  
I have an old pdf made by latex that certainly has the movies embedded.
I was always able to freely move the pdf file alone and still play the
movies inside them.  I have one of those, and it is a very large file (14MB), which suggests that it has the movies embedded.  I was also able to move the
pdf alone from my desktop to my laptop and have it work.  However, now if I move
it to another directory without the movies, okular cannot play them.  It seems
as if okular is just assuming that it needs to look externally. Unfortunately,
the only way to track this question down would be to install a whole new OS 
(Ubuntu 16.04) on a VM and try changing things there. 

I just tried to attach the media files, but they are too large.
The additional problem that I mentioned is that the movie shows up,
but just flashes quickly, as if there were just one or two frames.
Comment 5 Jay Schieber 2018-08-31 15:41:41 UTC
I think that the real issue for the current problem is that the movie files are currently stored in another directory.  This directory is added to the latex file for the location of the movie, but that is somehow probably not passed to the pdf file. I tested this by putting all of the files in the same directory.  Still, all of the movies play in window mode, but only the first in presentation mode.  Unfortunately, I don't know that I have a few videos small enough to upload here as a minimal working example.  Also, part of this seems to be a latex problem.
Comment 6 Jay Schieber 2018-08-31 15:49:37 UTC
Sorry, I keep adding to this.  I have now found that if I keep all of the movie files in the same directory, and put the slides in presentation mode, only the first slide plays correctly.  However, if I toggle between presentation and window modes, it will then play correctly in the presentation mode.  This must be a bug, no?
Comment 7 Pascal Niklaus 2019-12-06 10:56:41 UTC
Since this bug report is over a year old, I'd like to confirm that I experience the very same problem.

In a LaTeX-beamer presentations, embedded videos play as expected, but they show up in the regular window instead of the presentation screen (I can switch back the regular window with alt-TAB and see the videos playing there).

This thus seems not to be a problem with the video file itself or its embedding, bit with it being rendered at the wrong place.

This occurs with okular 1.3.3 as distributed with Ubuntu 18.04.3 LTS.

This problem did not occur with earlier versions of okular/KDE/???.
Comment 8 Douglas 2020-02-27 17:03:28 UTC
I'm also having this problem.

I'm using the animate package in latex with a sequence of pdfs it works out of the box except in presentation mode when animation fps drastically drops and sometimes doesn't animate at all. (only in presentation mode)
Comment 9 Douglas 2020-02-27 17:10:39 UTC
I forgot to mention that i'm using okular version 1.9.2
Comment 10 Thadeu Penna 2020-06-08 14:35:41 UTC
I can also confirm this problem. The official documentation of the animate package at http://tug.ctan.org/macros/latex2e/contrib/animate/animate.pdf contains some examples for testing. All of them work out of box in the windowed mode, but they stop working when at Presentation mode. When trying to click on any button, okular goes to the next page, so I think okular does not recognize any button clicks in the right way. Using okular 20.04 from Kubuntu official sources.
Comment 11 Yuri Chornoivan 2020-06-08 16:40:23 UTC
Created attachment 129141 [details]
Test file (animate+beamer works in presentation mode)

It may depend on the type of animation. At least, the attached file (pdfTeX 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git master) works fine for me in the normal and presentation mode. The first attached file does not work at all in either of the modes.
Comment 12 Douglas 2020-06-08 17:05:09 UTC
(In reply to Yuri Chornoivan from comment #11)
> Created attachment 129141 [details]
> Test file (animate+beamer works in presentation mode)
> 
> It may depend on the type of animation. At least, the attached file (pdfTeX
> 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git
> master) works fine for me in the normal and presentation mode. The first
> attached file does not work at all in either of the modes.

In my case it depends on the animation's frame rate, have you tried changing the frame rate of your file? in my case it stops working in presentation mode with 19fps or more
Comment 13 Yuri Chornoivan 2020-06-08 17:18:12 UTC
Created attachment 129143 [details]
Minimal working example (tex+png)

(In reply to Douglas from comment #12)
> (In reply to Yuri Chornoivan from comment #11)
> > Created attachment 129141 [details]
> > Test file (animate+beamer works in presentation mode)
> > 
> > It may depend on the type of animation. At least, the attached file (pdfTeX
> > 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git
> > master) works fine for me in the normal and presentation mode. The first
> > attached file does not work at all in either of the modes.
> 
> In my case it depends on the animation's frame rate, have you tried changing
> the frame rate of your file? in my case it stops working in presentation
> mode with 19fps or more

Works fine for 19 and 40 fps. Minimal working example (tex+png) attached.
Comment 14 Douglas 2020-06-08 17:35:52 UTC
(In reply to Yuri Chornoivan from comment #13)
> Created attachment 129143 [details]
> Minimal working example (tex+png)
> 
> (In reply to Douglas from comment #12)
> > (In reply to Yuri Chornoivan from comment #11)
> > > Created attachment 129141 [details]
> > > Test file (animate+beamer works in presentation mode)
> > > 
> > > It may depend on the type of animation. At least, the attached file (pdfTeX
> > > 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git
> > > master) works fine for me in the normal and presentation mode. The first
> > > attached file does not work at all in either of the modes.
> > 
> > In my case it depends on the animation's frame rate, have you tried changing
> > the frame rate of your file? in my case it stops working in presentation
> > mode with 19fps or more
> 
> Works fine for 19 and 40 fps. Minimal working example (tex+png) attached.

Your attached file is not working in presentation mode with 40 fps here, okular 1.10.1
Comment 15 Thadeu Penna 2020-06-08 18:23:13 UTC
(In reply to Yuri Chornoivan from comment #11)
> Created attachment 129141 [details]
> Test file (animate+beamer works in presentation mode)
> 
> It may depend on the type of animation. At least, the attached file (pdfTeX
> 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git
> master) works fine for me in the normal and presentation mode. The first
> attached file does not work at all in either of the modes.

Could you try it with the buttons ?
Comment 16 Yuri Chornoivan 2020-06-08 19:07:39 UTC
Created attachment 129145 [details]
Example with buttons (works)

(In reply to Thadeu Penna from comment #15)
> (In reply to Yuri Chornoivan from comment #11)
> > Created attachment 129141 [details]
> > Test file (animate+beamer works in presentation mode)
> > 
> > It may depend on the type of animation. At least, the attached file (pdfTeX
> > 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git
> > master) works fine for me in the normal and presentation mode. The first
> > attached file does not work at all in either of the modes.
> 
> Could you try it with the buttons ?

It depends on the forms enabling:

Fresh start, forms enabled, with or without autoplay (not an opened recompiled PDF) - works
Fresh start, forms disabled or recompile in vivo - does not work.

Tex for this PDF:

\documentclass[aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{animate}
\usecolortheme{seahorse}
\begin{document}
\begin{frame}
\frametitle{Test}
\centering
\animategraphics[loop,width=.5\linewidth,controls=all]{20}{Fourier-}{0}{92}
\end{frame}
\end{document}
Comment 17 Thadeu Penna 2020-06-08 19:52:04 UTC
I tried here with forms enabled and the buttons still do not work on presentation mode. Neither the one compiled here nor the attached file. Both work on windowed mode. 


(In reply to Yuri Chornoivan from comment #16)
> Created attachment 129145 [details]
> Example with buttons (works)
> 
> (In reply to Thadeu Penna from comment #15)
> > (In reply to Yuri Chornoivan from comment #11)
> > > Created attachment 129141 [details]
> > > Test file (animate+beamer works in presentation mode)
> > > 
> > > It may depend on the type of animation. At least, the attached file (pdfTeX
> > > 3.14159265-2.6-1.40.19, animate, beamer, poppler 0.88, okular from git
> > > master) works fine for me in the normal and presentation mode. The first
> > > attached file does not work at all in either of the modes.
> > 
> > Could you try it with the buttons ?
> 
> It depends on the forms enabling:
> 
> Fresh start, forms enabled, with or without autoplay (not an opened
> recompiled PDF) - works
> Fresh start, forms disabled or recompile in vivo - does not work.
> 
> Tex for this PDF:
> 
> \documentclass[aspectratio=169]{beamer}
> \usepackage[utf8]{inputenc}
> \usepackage{animate}
> \usecolortheme{seahorse}
> \begin{document}
> \begin{frame}
> \frametitle{Test}
> \centering
> \animategraphics[loop,width=.5\linewidth,controls=all]{20}{Fourier-}{0}{92}
> \end{frame}
> \end{document}
Comment 18 Thadeu Penna 2020-06-11 23:21:55 UTC
First of all, thanks for your attention, Here, I am using okular 20.04 and poppler 0.86.1. Do you have any clue about what could be causing this behavior ? Should I try to compile okular-git or poppler ? The buttons work in fullscreen mode but not on presentation mode.
Comment 19 Thadeu Penna 2020-06-11 23:24:48 UTC
As an additional information, both windowed and fullscreen modes show a blue line around the figure, when set to show forms. I never get that on the presentation mode.
Comment 20 Mike Jones 2020-09-18 17:05:59 UTC
I think the following may be related. If not, my apologies, let me know and I'll submit as a separate bug.

Using Okular 1.3.3 on kubuntu 18.04 and compiling a beamer presentation with two multimedia files (mp4). In full screen mode, the first works; the second plays in a tiny box.

I created two videos and a screenshot, using (in my case):

ffmpeg -f x11grab -y -r 30 -s 1192x770 -i :0.0+149,72 File1.mp4
ffmpeg -f x11grab -y -r 30 -s 1192x770 -i :0.0+149,72 File2.mp4
import -window root -crop 1180x722+149+72 Screen.png

I created the a latex file:

cat <<'EOF' > main.pdf
\documentclass[11pt]{beamer}
\usetheme{Warsaw}
\usepackage{multimedia}

\begin{document}

\begin{frame}{File1}
\begin{center}
\movie{\includegraphics[width=5cm]{Screen.png}}{File1.mp4}
\end{center}
\end{frame}

\begin{frame}{File2}
\begin{center}
\movie{\includegraphics[width=5cm]{Screen.png}}{File2.mp4}
\end{center}
\end{frame}

\end{document}
EOF

I created the pdf using pdflatex and opened the resulting pdf in okular.

With okular in a window both videos play correctly; in full screen mode however, the first media file plays fine, the second displays in a fraction (top left) of the viewport.
Comment 21 ferdymercury 2021-03-25 11:30:34 UTC
From https://invent.kde.org/graphics/okular/-/issues/51

I see a similar problem on 20.12.3:

Consider the following animated PDF:
https://texample.net/media/tikz/examples/PDF/animated-definite-integral.pdf

The animation works well when opening it in okular, but can not be started in "presentation mode". Do you see a similar issue?

On the other hand, if I create the animation using the option 'autoplay' in animateinline, then it plays also in presentation mode, but I can not 'stop it'.

In comparison, in Adobe Reader, it works well in any case, it can be paused and stopped in normal mode and in presentation mode.

Thanks for the support!
Comment 22 ferdymercury 2022-10-24 07:27:53 UTC
The issue is still there on 21.12.3

Any plans concerning this? It would be really helpful if this could be fixed :)

Thanks in advance.

Partly related: https://bugs.kde.org/show_bug.cgi?id=434964