Failure: Much Simplified VPlayer.swf from the media9 LaTeX package is not supported

Bug #1246690 reported by Oliver Sander
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Lightspark
Confirmed
Medium
Unassigned

Bug Description

This bug is a prerequisite to #1246050 and #1246682. It is probably easier to fix this than #1246050 and #1246682. That is why I report it as a separate bug.

The original problem, #1246050, is roughly:
"The media9 LaTeX package contains a little flash program VPlayer.swf implementing a video player. This flash program will be embedded by LaTeX in the output pdf file. As a result, the pdf can contain movies, played by VPlayer.swf, if the pdf document viewer supports flash.

(see http://mirrors.ctan.org/macros/latex/contrib/media9/doc/media9.pdf for the details)

Unfortunately, this cannot currently be implemented in open source pdf viewers, because lightspark does not play the VPlayer.swf file. "

Now, the author of VPlayer.swf has been so kind as to backport the program to "Flashplayer 9" using flex-3. He has also commented out the callbacks that lead to the error messages in #1246682. The result is a very simple video playing application, which should be easier to support than the original file. Also, the source code is available. However, even this very simple player cannot be played by lightspark. Starting from the console with

sander@affe:~/okular-test/flash_no_callbacks$ cat parameters
source
cube.mp4

sander@affe:~/okular-test/flash_no_callbacks$ lightspark --url loader.url/file.swf VDisplay.swf -p parameters

a blue window opens with the text "LOADING 0%" at the bottom. On the console I get the message

INFO: Lightspark version 0.7.2 Copyright 2009-2013 Alessandro Pignotti and others
INFO: A plugin was found. Adding it to the list.
INFO: The plugin SDL plugin was added with backend: sdl
INFO: A plugin was found. Adding it to the list.
INFO: The plugin Pulse plugin output only was added with backend: pulseaudio
INFO: the selected backend is: pulseaudio
INFO: get_plugin: pulseaudio
INFO: RenderThread this=0x12d51a0
INFO: Creating input thread
INFO: Running in remote sandbox
INFO: zlib compressed SWF file: Version 9
INFO: FrameRate 24
INFO: Creating VM
INFO: SWF Metadata:
        format: application/x-shockwave-flash
        title: Adobe Flex 3 Application
        description: http://www.adobe.com/products/flex
        publisher: unknown
        creator: unknown
        language: EN
        date: 30.10.2013
INFO: MaxRecursionDepth: 1000, ScriptTimeoutSeconds: 60
INFO: SWF Info:
        ProductId: 3
        Edition: 6
        Version: 3.5.0.12683
        CompileTime: 1383144439551
INFO: Chosen config 0x7fdaec020ac0
INFO: Fragment shader compilation
INFO: Vertex shader compilation
INFO: Window resized to 500x375
INFO: NET: STANDALONE: DownloadManager::download 'loader.url/file.swf://ader.url/cube.mp4' - cached
INFO: NET: STANDALONE: DownloadManager: remote file
INFO: NET: CurlDownloader::execute: reading remote file: loader.url/file.swf://ader.url/cube.mp4
INFO: SECURITY: Evaluating URL for cross domain policies:
INFO: SECURITY: --> URL: loader.url/file.swf://ader.url/cube.mp4
INFO: SECURITY: --> Origin: loader.url/file.swf://ader.url/file.swf
INFO: SECURITY: Same hostname as origin, allowing
ERROR: Not sufficient data is available from the stream
INFO: FPS: 22

When I click on the window, lightspark gives its characteristic black "yet unsupported flash file" window. On the console, it prints

ERROR: Unhandled ActionScript exception in VM Error: Cannot call reconnect on an http connection.

Any help would be appreciated.

Revision history for this message
Oliver Sander (sander-j) wrote :
Revision history for this message
Oliver Sander (sander-j) wrote :
Revision history for this message
Oliver Sander (sander-j) wrote :
Revision history for this message
Antti Ajanki (aajanki) wrote :

Thanks for the detailed bug report.

The error message shows that lightspark tries to load the video file from invalid path "loader.url/file.swf://ader.url/cube.mp4". You need give a valid --url and allow access to local files with -s argument (as a security measure, an SWF can access either local or remote files but not both). The following should work:

lightspark --url file://VDisplay.swf VDisplay.swf -p parameters -s local-with-filesystem

But it fails with

ERROR: Unhandled ActionScript exception in VM SecurityError: SecurityError: NetStream::play: connect to local file

It looks like something is wrong in the security permission evaluation in NetStream::play method. The source code is in src/scripting/flash/net/flashnet.cpp if you like to take a look.

Changed in lightspark:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Oliver Sander (sander-j) wrote :

Thank you very much for your help.

I have tried to build lightspark from the sources, to be able to use the debugger. However, I ran into https://bugs.launchpad.net/lightspark/+bug/1248061

I didn't know about the -s parameter, as it is not mentioned on the manpage. Should I file a bug for that?

Is there a way to contact you guys besides bug reports? I tried writing a mail to lightspark-users, but I never got any reply (automatic or not), and it didn't appear in the archive either.

Revision history for this message
Antti Ajanki (aajanki) wrote :

Please do file a bug about missing documentation so that it doesn't get forgotten.

You should be able to post to lightspark-users but I believe that you need to register first at https://launchpad.net/~lightspark-users.

Revision history for this message
Oliver Sander (sander-j) wrote :
Revision history for this message
Oliver Sander (sander-j) wrote :

I played around with the debugger a little. The problem seems to be the following: even though the parameter -s local-with-filesystem is given on the command line, the program runs in a 'remote' sandbox. You can see this from the console output, which includes the line

INFO: Running in remote sandbox

The reason can be found in main.cpp, line 290. There, the sandboxType is set to REMOTE whenever the --url option is used.

Where should I look from here?

Revision history for this message
Antti Ajanki (aajanki) wrote :

I have fixed some things related to the sandbox selection and now it is possible to get the code running with elevated privileges using the local-trusted sandbox (local-filesystem still needs more work):

lightspark --url file://VDisplay.swf VDisplay.swf -p parameters -s local-trusted

There are new problems, however. The sample cube.mp4 fails with the following:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f1248004400] stream 0, offset 0x30: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f1248004400] Could not find codec parameters (Video: h264, 192x176, 347 kb/s)

Other random samples I tried (for example http://www.mp4point.com/downloads/dc97d920c931.mp4) only play one second or so of audio and no video. The logs says "INFO: AUDIO BACKEND: Stream underflow".

These seem to indicate that Lightspark only reads the beginning of a (local) video file and then fails for some reason.

Unrelated to the above, clicking the window causes an unhandled exception:

ERROR: Unhandled ActionScript exception in VM Error: Cannot call reconnect on an http connection.

Revision history for this message
Oliver Sander (sander-j) wrote :

Many thanks for those fixes. I can confirm the new bugs you describe.

I have no particular preference for mp4 movies, and I have tried some other formats. Both ogv and avi files make lightspark segfault in avcodec_decode_video2 (file decoder.cpp:294). Should I file separate bug reports for that?

How hard do you reckon is fixing those bugs? I could actually organize some sponsorship. Would that help in any way?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.