1

Copying the template offered by A.Grahn at the following post almost exactly,

Embedding videos using media9,

I ran the code below in pdfLaTeX:

\documentclass{article}
\usepackage{media9} 
\begin{document}
The video should appear just below.
 \includemedia[
    width=0.4\linewidth,
    height=0.3\linewidth,
    label='firsttry',
    addresource="C:/_Book/_Website/40631-H.264.mp4",
    activate=pageopen,
   flashvars={source="C:/_Book/_Website/40631-H.264.mp4"}
  ]{This is the poster text}{VPlayer.swf}
The video should appear just above.
\end{document}

I got no errors, and the resulting document looked just as expected, showing the words "This is the poster text" bounded by the text expected above and below it, but the video did not play. Instead I see only a cursor that's shaped like a magnifying glass which, when one clicks the poster area with it, causes that area to get bigger (as the cursor would imply), but does not play the video.

The video does indeed reside in the folder listed, and plays fine when one double-clicks it directly. It is apparently H.264 - at least that's the codec I chose for it in Handbrake, and MediaInfo tells me that it's "MPEG-4(Base Media / Version 2_: 218 KiB 2s 200ms" and further that it's "638 Kbps, 640*480 (4:3) at 15 fps, AVC (Main@L4.0) (CABAC / 4 Ref Frames)".

I get the very same (lack of) results whether or not I place the path names in quotation marks. Including &autoplay=true among the flashvars also did not change the results. I also get the same (lack of) results whether or not I specify VPlayer.swf or VPlayer9.swf.

Footnote: This surely doesn't matter, but I just discovered there has to be a line skipped after "The video should appear below" for the results to look as expected. (In posting this, I had collapsed the blank lines to make the code easier to read.)

Peyton Todd
  • 133
  • 1
  • 10
  • I tried your code with a known .mp4 which was placed in the exact same folder as the .tex file and it runs fine. When I attempt to put the .mp4 into any other folder then I am getting an error in the pdf of file not found instead of a black box. So, first try it with the .mp4 in the same folder as the .tex (and of course where the .pdf will be. Second if still failing, rename the file without extra periods, any underscores, any spaces, or any non alphabetic characters. Third, if still failing, try step 1 and 2 with a known *.mp4 file other than this one. – R. Schumacher Jun 28 '15 at 04:28
  • Re the above comment by R. Schumacher: Renaming the video file without extra periods or underscores leads not to an error message as you experienced but to the result I described earlier. Placing the renamed video file in the same directory as the .tex file does lead to a slight improvement in that a 'Play Me' arrow now appears on the screen along with the poster text. But clicking the arrow does not cause the file to play; instead it leads to magnifying the area clicked. Maybe I need to be sure I have an H264 video. Unfortunately the only way I know to do that right now is via Handbrake. – Peyton Todd Jun 29 '15 at 14:24
  • You may also need to change the player you have specified as H264 is a subset of the mp4 family. Here is one other free player http://www.videolan.org/vlc/. If you transcoded it using Handbreak and the original file was not correct, then the mp4 will be very wrong. Easiest next step is to verify that this video file actually be played. Best wishes, as this is like working in a house of mirrors. – R. Schumacher Jun 29 '15 at 14:37
  • Re the above comment by R. Schumacher: Yes, the video file plays perfectly in several players. So I downloaded the VLC player (vlc.exe), placed it in the same folder as the .tex file, and got the same results as before (poster text, magnifying glass cursor). Then I tried using xxx.exe as the video player and got an error since indeed no such file exists. Then I tried with a text file named xxx.txt that does exist, and I got the usual results (poster text, cursor as magnifying glass). But xxx.txt is not even a player at all! Also, if I drag the video file to VPlayer.swf itself nothing happens. – Peyton Todd Jun 29 '15 at 19:35
  • I wonder if the Vplayer.swf has the needed flash player available in your pdf viewer. See this bug report for details https://bugs.launchpad.net/lightspark/+bug/1246690 – R. Schumacher Jun 30 '15 at 00:07
  • Are you using AdobeReader 9 or above on one of Mac OS X or Windows for viewing the PDF? Note that media9is A-Reader only. And you need the FlashPlayer installed on your system (in Windows, the version for Firefox, not the ActiveX plugin for IExplorer). – AlexG Jun 30 '15 at 10:25
  • @AlexG: I have AdobeReader 11 installed, and it is indeed my default for PDFs; I assume I'm using it to view the PDF since my output is generated by pdfLaTeX, which does build a PDF on my hard drive, although Help->About of its viewer identifies itself as TeXworks rather than AdobeReader. My preferred browser, Chrome, does have the Flash plug-in (version 18) installed and turned on, while Firefox has Flash plugin version 17 installed and turned on. On the other hand, all the .exe files with 'flash' in their file name appear in Windows folders even after re-running install_flash_player_ax.exe. – Peyton Todd Jun 30 '15 at 15:46
  • @R.Schumacher: Since I do appear to have the flash player available, is there anything in the lightspark bug I need to attend to? – Peyton Todd Jun 30 '15 at 15:47
  • (News) "Flash": I was about to point out the possible clue that just loading the resulting PDF directly instead of in the TeXworks viewer shows only the 'video should appear' text lines, and not even the poster text. But when I repeated that test to verify this fact... there is my video at last. The only change I made in the interim was re-running install_flash_player_ax.exe. But if that was the cause, why could I find no new .exe file with flash in its name on my C-drive? Also, why would it matter if Flash plug-ins are turned on in my browsers if I'm not viewing the PDF in them? – Peyton Todd Jun 30 '15 at 16:06
  • You last question is outside my expertise, except the flash is embeded in the browser and viewer and not a separate program. Now, I recommend that you summarize our discussion and the found solution as an answer to this question, and accept it. (This is very acceptable on TeX.SE, especially since you did all the testing and work.) – R. Schumacher Jun 30 '15 at 18:12
  • @R.Schumacher: Before I summarize the discussion and declare it the solution, let's get clear about it: (1) Is the viewer that pdfLaTeX sends results to not intended to show video? Are there plans to upgrade it to have that ability later?Since it's a natural assumption that the viewer would be capable of video, should the media9 doc warn of this pitfall? (2) I think everyone would like to know the answers to exactly what the arrangement is between Flash and browsers: when you said embedding did you mean that literally? Do browsers perhaps link to the installed version of Flash instead? – Peyton Todd Jul 01 '15 at 01:49
  • Flash is an add-in or plug-in for browsers and other programs. And installing it will not cause you to have any additional exe's in the program folder. For example, FireFox on the tools menu give you the add-in selection. And from their you can examine the currency of all add-ins/plug-ins. When you update an add-in there is no change to the browser file date or version. From my brief goggle check on Vplayer.swf and flash, the non-playable problem was referenced several times. And the suggestion was to be sure that the browser, the player, and flash were up-to date. – R. Schumacher Jul 01 '15 at 02:17
  • @R.Schumacher: Okay, thanks, but it would still be good to know whether the pdfLaTeX viewer in TeXworks is supposed to show video, or whether this is simply something their documentation should make clear (unless I missed it?). But I'll put the findings so far into the answer, and post that in a different query. Meanwhile, based on my testing of the only three browsers I know to be installed on my PC (chrome, firefox, & IE), flash does NOT have to be enabled for pdfLateX to build PDFs that show video. It is apparently sufficient that an up-to-date version of flash be installed. – Peyton Todd Jul 04 '15 at 21:51

1 Answers1

1

Testing has shown that for the PDF built by pdfLaTeX to show video, an up-to-date version of flash player has to be installed. Before I updated flash, no video (not even the poster text) appeared in the PDF, but my video clip did appear (and does play) in the PDF built by pdfLaTeX after I ran (or re-ran?) a recent version of the flash installer. This did not resolve the question of whether the pdfLaTeX viewer is expected to show video, but I'll put that issue in a separate post.

Note that - at least according to my testing with the only three browsers I know to be installed on my PC (chrome, firefox & IE) - flash does NOT have to be enabled in one's browser, but merely installed.

Peyton Todd
  • 133
  • 1
  • 10