Bug 136574 - Wish; Show videos in a pdf
Summary: Wish; Show videos in a pdf
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 139144 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-31 18:32 UTC by Leopold Palomo-Avellaneda
Modified: 2012-05-15 07:08 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments
Example of a video embed in a pdf file (82.36 KB, application/x-tbz)
2006-10-31 18:40 UTC, Leopold Palomo-Avellaneda
Details
the video file.. (939.15 KB, application/octet-stream)
2006-10-31 18:41 UTC, Leopold Palomo-Avellaneda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leopold Palomo-Avellaneda 2006-10-31 18:32:37 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

In kpdf of okular, if you create a pdf file with beamer and embed a video, the viewer can't show it.
The pdf specification has some nice features as reproduce on clic, reproduce on page show, etc.

Actually, you only can have this features in the windows acroread version. Please, could you consider to add this feature in okular?

Regards
Comment 1 Leopold Palomo-Avellaneda 2006-10-31 18:40:06 UTC
Created attachment 18338 [details]
Example of a video embed in a pdf file

The archive has 2 files: the pdf file and the LaTeX source for the example. The
video comes in another attachment
Comment 2 Leopold Palomo-Avellaneda 2006-10-31 18:41:30 UTC
Created attachment 18339 [details]
the video file..

The video file ...
Comment 3 Bram Schoenmakers 2006-12-22 22:20:27 UTC
*** Bug 139144 has been marked as a duplicate of this bug. ***
Comment 4 Albert Astals Cid 2007-06-04 12:03:42 UTC
Reassigning to the mailing list
Comment 5 hutch 2007-08-18 18:01:20 UTC
I have developed a way of displaying videos etc from kpdf when in fullscreen. It is reported in detail at http://silas.psfc.mit.edu/fullscreen/. I'd like to urge that okular implement this ability, or the equivalent, within its own code. It would really be a killer advantage for kpdf/okular to be able to do what acroread can't which is to display helper programs "in front" of a fullscreen display. For pdf presentations, this is the main thing that prevents them being as featureful as (ugh!) powerpoint.
Comment 6 Pino Toscano 2007-08-18 18:51:04 UTC
The problem is not really the displaying of the video itself (with Phonon is like 5 lines of code - plus the handling of the video widget itself, of course).
The problem is the reading of the video information (and some related informations) from the PDF document itself. Currently, this requires some work in the library we are using for PDFs (Poppler), and (way easier) adding the support structures for making the okular backends load the videos into the pages.
The latter (adding the real okular work) is not really difficult (I have a basic patch for that).
Comment 7 Arnout Boelens 2007-08-18 20:11:46 UTC
In the the Okular handbook it says that Okular has support for embedded files. However, if I understand the above post correctly, video in pdf is not supported?
Comment 8 Pino Toscano 2007-08-18 20:16:25 UTC
Embedded files is another kind of PDF goodies, but usually it's meant as a different thing than videos or sounds, even because the videos are not embedded, but you find only the URL of the video to be played (and some additional metadata for it).
Comment 9 Pino Toscano 2008-08-25 04:10:39 UTC
I just added some code for handling (in a really basic way) the video information and showing video widgets in the page view and in the presentation mode. If this proves to be working, it will be KDE 4.2 material (for the joy of the voters of this bug, especially the people from the Berlin university).
Small downside of this implementation: on the PDF side, the video data are read with the current development version of the Poppler library (going to be 0.9.0 -- development release).
Comment 10 Oliver Sander 2008-09-14 11:24:28 UTC
Thank you! The people from the Berlin University are happy indeed!  I'll try and test it and keep you informed about any problems.

You write that your code is 'really basic'.  What consequences should I expect this to have?
Comment 11 Oliver Sander 2008-09-30 17:20:28 UTC
I finally got to test this with poppler 0.9.2 and todays svn version of okular.  It seems to work, but with minor glitches. With the document attached further above, here's what's happening:

Upon starting okular (with the test file as command line argument), I get the message

Error: parseAction: Bad annotation action for URI 'NULL'

On the individual slides:
First slide) (Non-embedded video and picture of first slide)
  This works correctly. KMPlayer is started and plays the movie.  Incidentally, KMPlayer resizes its window about four times before starting to play, but I guess that's a different story.  I also get the message

okular(23959) KRunMX1::expandEscapedMacro: -miniicon isn't supported anymore (service "KMPlayer" )

Second slide) (Embedded video with autostart, looping and picture of first frame)
This does indeed play the embedded movie, but only after clicking.  Looping works.  Before clicking, the first frame is not shown.  Instead, there is a black rectangle of the size of the movie.  The first frame is shown in the preview, however.

Third slide) (Embedded video with no autostart, no looping, no picture of first frame)
Works correctly.  However, before clicking there is again the black rectangle.  This time, it is slightly wider than the movie (about 5% of the movie width on each side).  Therefore, when the movie plays there are black vertical bars to the left and right of the movie.  The preview area again correctly displays the page, i.e. without the black rectangle.

All these things hold both in regular and presentation mode.

Hope this helps :-)
Comment 12 Brad Hards 2008-11-30 04:12:35 UTC
The KPDF equivalent to this wishlist item is #109541.
Comment 13 Carsten Gräser 2009-01-02 21:53:03 UTC
Tested it with the kde4daily qemu-image (updated today) and phonon xine-backend. My pdf was generated by the latex-beamer package. It contains an embedded mpg-movie. The results are the same in normal and presentation mode:

*Embedded movies work after clicking. :-)
*Autostart does not work.
*Poster(first frame as preview) does not work.

I did mot test audio output.

With qemu the movie runs very unsteady and sometimes a few frames backwards. But this seems to be a performance issue with qemu and xine since movies run smoothly with virtualbox (after converting the image).
Comment 14 Oliver Sander 2009-01-05 14:35:26 UTC
I am curious about the status here.  Is there any hope of having this working in 4.2?  Thanks a lot!
Comment 15 Tobias G. Pfeiffer 2009-06-10 11:26:54 UTC
Playing an embedded video still doesn't work on KDE 4.2.4 / Kubuntu Jaunty, command line message is "Annotation Screen not supported" (also with Okular build from SVN). However, I can save the embedded video to the file system. My versions of libpoppler are:

$ dpkg -l | grep poppler
ii  libpoppler-glib4                           0.10.5-1ubuntu2
ii  libpoppler-qt4-3                           0.10.5-1ubuntu2                                           
ii  libpoppler4                                0.10.5-1ubuntu2                                           
ii  poppler-utils                              0.10.5-1ubuntu2

Oliver reported that he managed to show videos using Okular and libpoppler 0.9.2, so I'm wondering a) why this doesn't work for me and b) what is the current state of video support in Okular?
Comment 16 Oliver Sander 2009-06-11 14:00:52 UTC
Your video is actually embedded in the pdf file, right?  In that case what you report is bug 172847.

For videos that are not contained in the pdf file itself, I can still reproduce the behavior that I reported in Comment 11, now with the KDE 4.2.2 packages from Debian testing.  The black rectangles are annoying but at least in informal situations I can show videos now.
Comment 17 Stefan 2011-01-17 22:48:39 UTC
Has there been any progress on the autostart-issue? My impression ist that the state is still as Oliver and Carsten reported it above (11 and 13). I'm also interested in this for beamer-presentations, where it would be important that the video starts immediately.
Comment 18 Oliver Sander 2011-01-19 09:43:59 UTC
AFAIK there has been no progress.  I had a look at the relevant code recently.  It seems that the remaining issues (like missing autostart and poster features) are not bugs, but features that haven't been implemented yet at all.  In particular, it appears that poppler (the library that does the actual pdf parsing) does not expose all the relevant information to okular (I think that is what the poppler TODO item "expose Rendition media through the MovieObject API" means).  Hence further progress involves additions to poppler, and even additions to the poppler qt4 interface.

I think the most difficult part for people without okular/poppler hacking experience are the interface enhancements.  How are they supposed to look like?  How is the movie poster image supposed to get from poppler to okular?  Maybe one of the experts could comment on that.  I would find implementing the actually functionality much easier with that information.
Comment 19 Albert Astals Cid 2011-08-28 20:52:14 UTC
Oliver, i do not really understand you question, the interface has to look like the otehrs, and i guess to "How is the movie poster image supposed to get from poppler to okular?" would be a QImage.

If you are really interested in implementing those features please drop by #okular or #poppler IRC channels and let's talk about it (my nick is tsdgeos).
Comment 20 Oliver Sander 2011-08-31 08:51:52 UTC
Hi Albert, this just highlights how little I know of pdf and qt programming.  I've been wanting to do this (and 172847) all this time, however I see myself forced to admit that I will never find enough free time to learn and do it.  Somebody else will have to do the coding.  Sorry. I'll happily help out with testing, though.
Comment 21 Edward Hades 2011-09-01 17:33:46 UTC
I've implemented support for Movie actions, which are required for autostart to work. Unfortunately, that requires some support from the Poppler side. So before I send patches for Okular, a respective patch should be accepted in Poppler.

See bug here: https://bugs.freedesktop.org/show_bug.cgi?id=40561

If you want to test it, I can give you a link to my Okular and Poppler sources.
Comment 22 Oliver Sander 2011-09-01 20:50:23 UTC
Awesome.  I am currently travelling and without a machine that I can use for testing, but as soon as I get home (in about 10 days) I'll check it out.  Thank you!
Comment 23 Oliver Sander 2011-09-15 12:19:55 UTC
I could test this feature now if needed.  How can I get hold of your okular patch?
Comment 24 Edward Hades 2011-09-20 09:52:59 UTC
(In reply to comment #23)
> I could test this feature now if needed.  How can I get hold of your okular
> patch?

Depending on your preferences:

1a. Clone my repositories of poppler and okular:

git://hades.name/poppler.git
git://hades.name/okular.git

(in both repositories you want branch called "movie").

1b. Download snapshots directly:

http://git.hades.name/cgit.cgi/poppler.git/snapshot/poppler-movie.tar.bz2
http://git.hades.name/cgit.cgi/okular.git/snapshot/okular-movie.tar.bz2

2. Unpack, compile, install, run, test, enjoy!
Comment 25 Wulf Bolte 2012-02-06 09:14:46 UTC
Did these patches got implemented in upstream dev. version?

Because the only show-stopper for not using Impress anymore is the autostart Movie function.

So I created a Bug espeacially for that:

https://bugs.kde.org/show_bug.cgi?id=293141
Comment 26 Oliver Sander 2012-05-15 05:59:25 UTC
I think this bug can be closed.  Most of the functionality is here (thanks to everybody involved!)  A few minor problems remain, but these are better dealt with in separate bug reports.
Comment 27 Albert Astals Cid 2012-05-15 07:08:27 UTC
Agreed with Oliver