Troubleshooting Slow Loading Videos

If you’re using S3MV, and your videos play fine, but take between 30 seconds to a minute to actually start playing, then there is an issue with the encoding of the actual video file itself.

It’s not a problem with Amazon S3 or with the S3MediaVault plugin. It’s an issue with the file encoding that’s causing it to load slowly (but then plays correctly once loaded).

You need to use a program called HandBrake, a desktop tool that will allow you to optimize your file encoding for playing on the web.

And once you’ve done that, all of your videos will play just fine.

Leave a Comment

S3MediaVault Security Misconception

Another common misconception about the S3MV script, is, people asking…

I just installed the S3mv script. And I’m watching a video on my web site. I’m now able to do a view source, get the URL from the source, and view it in a different browser. Isn’t this a bug or security hole in the script?

Relax, it’s neither a bug nor a security hole.

When you first visit a page that contains the S3MediaVault embed code, the S3MV script connects to your Amazon S3 account using the security credentials you provided in the script configuration during setup, and then it retrieves a secure, expiring URL that will be alive for 15 minutes.

So once the video starts playing, the clock starts ticking down towards those 15 minutes. Which means, when you do a view-source, the URL you see is actually an expiring link that will expire in less than 15 minutes.

So if you take that link and view it in another browser, then sure, you will be able to view it until the link expires (which is 15 minutes from the first time the S3MV script received the URL from Amazon).

So if you visited the page at 11:00 AM, then the temporary link can be revisited any time until 11:15 AM.

Now another thing that throws a wrench into your understanding of how this works, is when browsers cache URL’s.

So let’s say now you want to test this link after 15 minutes, to make sure it doesn’t work. Now when you visit the same link say 2 hours later in the same browser in which you viewed it earlier, guess what: your browser has cached the temporary URL, and will start playing the video even after 2 hours, while you sit there and wonder why the expiring link hasn’t, well, expired!

So if you want to do a proper test, here’s what you should do…

  1. Go to your blog page or post that has the S3MV script embed code. Note down the time. Let’s say it’s 11:00 AM. You’ll see the video start playing. Let’s say your default browser is Firefox.
  2. Now do a view-source, copy the full URL, and try to go to it directly – it should work again – because it’s still within the 15 minute expiring window.
  3. Make a note of the URL in notepad – or some text editor. Come back to this after say, 1/2 hour.
  4. Now open a completely new browser (like Internet Explorer or Chrome) – something different from your primary browser that you used earlier.
  5. Now try visiting that same URL in this new browser. You’ll see that it doesn’t work.

You can rest assured when we say that this script is use on thousands of web sites, and the security is rock-solid.

Now remember, that the S3MV embed codes will load the right video for anyone visiting your blog.

If you wish to further prevent un-authorized visitors from even visiting your blog page or post that contains the embed code, then you need our other script – DigitalAccessPass.com – to protect blog posts and pages from non-”members” (so to speak).

Feel free to comment below if you have any questions.

Leave a Comment

Amazon S3 Encryption

Now when you do a “view source” on any page on our site that has a demo video to show the S3MediaVault script in action, you might see something like this:

flowplayer(“player533662499-1291229078″, “http://s3mediavault.com/blog/wp-content/plugins/S3MediaVault/flowplayer-3.1.2.swf”, {
clip: {
url: escape(‘http://s3mediavault.com.s3.amazonaws.com/intro2ll.mp4?AWSAccessKeyId=1HPS101KFMM8SKNK9BG2&Expires=1291230078&Signature=gD31LukvVow3RefZAIU6X%2Bw1MpY%3D‘),
autoPlay: false,
autoBuffering: false
}
});

And you might look at the text in bold above and wonder, “Hey, how come something called the key is showing? That doesn’t appear like it’s secure – it’s showing all of my information!”.

No need to freak out – the S3MediaVault script is very secure – as secure as an Amazon S3 script can possibly get.

Public-key / Private-key Encryption

Note that Amazon S3 uses an encryption called “Public-key / Private-key“. You can read more about it here. When any two parties are exchanging information using the public & private keys, the private key is never exposed. It is always the “Public” key that is exposed to the world (and there’s no issue doing that either) as that’s how it is supposed to work (if you read the above link), and that’s not a security issue. Please note that when setting up the S3MediaVault script, you entered both a “Public key” and a “secret key”. The “secret key” is the private key and it is never exposed to anyone. It is only the “public key” that you see when you do a view source.

How It Works

So here’s how the script works:

  1. Visitor arrives at your page that has the S3MediaVault embed code
  2. The S3MediaVault script is triggered by WordPress due to the [s3mv] tags in your page/post
  3. S3MediaVault then takes the file name from the tag, then opens a connection using the “Public Key” for your Amazon S3 account. Please note that when setting up the S3MediaVault script, you entered both a “Public key” and a “secret key”. The “secret key” is the private key and it is never exposed to anyone. It is only the “public key” that you see when you do a view source.
  4. Amazon then responds back to S3MediaVault on your site, with an expiring URL for the protected file.
  5. S3MediaVault just uses that secure, expiring link to display the video (or PDF, etc).

Leave a Comment

Downloading Protected Files

Please note that S3MediaVault is not a “true streaming” solution. Which means, it doesn’t stream videos in real time, but rather, plays the video by buffering the file as the viewer is watching the video – just like how web sites like YouTube play videos.And that’s the right way to do it, if you care about your viewers.

This means your viewers will be able to rewind, fast forward, even put the video on pause (especially for large videos), so that it keeps buffering in the background, and then come back and watch it later when it has fully “loaded” , so that they won’t experience any real-time buffering. This is very useful for viewers that don’t have fast internet connections.

What this also means, is that anyone who watches your video, can also use free, browser plugins (like DownloadHelper) that allow you to download a video that you’re watching in your browser. This is not a security breach. They are able to download it to their computer, only because they currently already have been given authorized access to the video/audio itself.

Please remember that anything that is accessible online – like audio, or video – can always be easily downloaded to the viewer’s desktop. There are many different ways in which you can download what you are viewing in your browser. The bottom-line is this: If a video or audio is accessible in a browser, it can easily be downloaded – or “recorded” using screen-capture solutions like Camtasia, or audio capturing solutions like Audacity), and then saved – to the viewer’s computer.

S3MediaVault makes sure no one can directly access your files from your S3 account, and can only get to it from your blog (on which the S3MediaVault script is installed).

Then combine it with the Page/Post protection of DigitalAccessPass (DAP),which can make sure only certain people (like paid members, or free but registered users) can access your blog post or page, where the S3MediaVault embed code is published.

Combine DAP + S3MediaVault, and you would have now completely locked down your content from any and every kind of un-authorized and illegal access.

So once someone has paid for your content (or registered for it), and are authorized users who have a right to view or hear that content, it’s ok that they get to download what they’re eligible for, to their computer, for offline use (like during their morning walk, or on the treadmill, or in their car, or when standing in line at the theme park!)

We don’t think it is a good idea for you to prevent your paying members from downloading your videos. After all, they’ve paid for it, and should be able to download it and watch it offline (like on their mobile device, ipad, iphone, etc).

In fact, the best membership sites that we’ve been a member of, offer the content in multiple ways: Download the videos in flash format (flv), download ipod/ipad version (mp4), download audio version of this video (mp3), download the transcript of the video (PDF), etc.

The more you make it easier for your members to consume your content, the more they will love being a member, and stay with you longer.

Leave a Comment

Troubleshooting

The Basics

The S3MediaVault script is now on use on more than 3,000+ web sites, in its current version. And it works on all of those web sites. So, if your video does not play, then there’s a 99.9999% chance that it has something to do with…

  1. Improper use of the [s3mv] tags
  2. Incorrectly entering the Amazon Public key, secret key or bucket name into the S3MV script settings
  3. Incorrect file name (file name “CaSe” matters, no spaces in the file name)
  4. Bucket name should be all lower case. Even one capital letter in the bucket name will not work.

That said, here are a few tips on what to look for, depending on your error.

“Object stream not found” error

This usually means that the file name or bucket name is wrong.

Bucket name should be all lower case. If you created it using a non-lowercase name at Amazon, then you must re-create a new folder with all lower-case letters.

So go to the page where you have the S3MV tags, do a “view source”, copy the the full URL, and try to access it directly via a browser. Like this…

http://yourbucketname.s3.amazonaws.com/yourfilename.ext

Eg., http://digitalaccesspass.s3.amazonaws.com/101110.mp4

If you try to access the file directly, it should either start playing in your computer’s default video player (like Windows media player or Quicktime or VLC). Or you should see an “Access Denied” error. Both these mean that your file name and bucket name settings in the S3MV script are correct.

If neither of the above two happens, then re-check (triple-check) the script settings, and make sure you’re copy/pasting directly from Amazon into the S3MV script settings.

Comments (7)

Supported File Formats

Supported Video Formats

While S3MediaVault can protect files of any extension, when it comes to video, it can only “play” certain video file formats in the browser.

S3MediaVault comes with a built-in version of FlowPlayer. So the only video formats that S3MV can “play” directly in the browser, are the same file formats supported by the FlowPlayer (see below).

FLV

Most played video format on the web. YouTube and Google Videos are using it . Basically all clients with Flash capability can see these videos. Has been there since version 6. Referred to a proprietary file format and does not offer as good video and audio quality as H.264 does.

H.264

A video compression standard. Provides good video quality at lower bit rates than FLV. As a standard it is not Apple’s proprietary format. Supported since Flash version 9.115 which is used by 81.7% of all Flash users according to this document

MP4

A video compression standard that is a subset of the whole H.264 standard family same advantages as in H.264 There seems to be many different flavors of MP4 and only some of them are supported by Flash. You can always try a given file to see if it plays in Flowplayer, if it does not the most likely reason is that it is not compatible with Flash.

Credit: FlowPlayer.org/documentation/technical-facts.html

Supported File Formats

Even though you can’t necessarily play all video formats, you can still use S3MV to generate Link Tags and URL Tags, to display “Click here to download” type downloadable links to any file of any format or extension. So supported file formats are:

  • .pdf
  • .doc
  • .exe
  • .flv
  • .mp4
  • .mp3
  • .mpeg
  • .swf
  • .zip
  • .png
  • .jpg
  • .gif
  • …. etc etc etc (any and all file formats available)

Comments (2)

S3MediaVault Installation

S3MediaVault is a WordPress plugin.

You install it just like you would install any WP plugin.

1) Download the plugin zip file S3MediaVault_vXX.zip to your desktop.

2) Log in to your WP admin panel, go to the Plugins section, add and upload the plugin file as usual, and activate it.

3) Now Under the “Settings” tab on your dashboard, you should see a new link called “S3MediaVault”.

Click on it. You are now on the S3MediaVault Plugin Configuration screen.

s3mv-settings

 

4) In a new browser window, log in to your Amazon S3 account. Once you login, on the menu at the top, click on the “Your Account” tab, and then on “Security Credentials

s3mv-amazon-menu

 

5) You will now see your Access Key and Secret Key (click on “Show” to show your secret key).

s3mv-amazon-credentials

 

6) Come back to the Config Screen for S3MediaVault.

Enter these Access Key, Security Key and your Bucket Name (folder where your files are stored in your S3 account).

Click on “Save Changes”.

s3mv-setup

 

Security Setting For Files

For each file that you use the S3MediaVault plugin with, please be sure to set the permissions of your file on Amazon S3 such that it won’t be open to the general public, but only you and the S3MediaVault script can access the files.

As you are browsing through the Amazon S3 files using either the Amazon S3 browser or the S3Organizer Firefox plugin tool, right click on the file name, click on “Edit ACL”, and then in the resulting permissions popup, make sure the permissions for “Everyone” is set to “X” (basically “No”) under the columns “Read”, “Write” and “FullControl”.

And the only row that should have all check marks, is the one that says “Owner” (it will have your Amazon S3 account name, of course).

In fact, if you should do this not just for all the files that you wish to use with S3MediaVault, but you should also do it for your bucket (folder) too, by right-clicking on the bucket name and setting similar permissions for the bucket contents as well.

 

That’s it for the setup.

You are now ready to start using the S3MediaVault plugin, simply by inserting any of the following tags into your blog posts:

1) Video-Tags,

2) Link-Tags or

3) URL-Tags

Leave a Comment

JW FLV Player Integration

Below is a video being played using the JW FLV player, and S3MediaVault supports it right out of the box.

This text will be replaced

If you are already using the extremely popular (albeit a bit expensive) JW FLV player, then all you do is just make a small change to the JW code that you paste into your blog posts, as follows:

<script type='text/javascript' src='/jw/swfobject.js'></script>
<div id='mediaspace'>Check Out My Cool New Video</div>
<script type='text/javascript'>
var so = new SWFObject('/jw/player.swf','mpl','480','360','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('author','Ravi Jayagopal');
so.addVariable('description','Amazon S3 Plugin for JW Video Players');
so.addVariable('type','video');
so.addVariable('file',escape('[s3mv]YOURVIDEO.flv,url[/s3mv]'));
so.write('mediaspace');
</script>

That’s exactly what you’re seeing in the demo above.

Comments (13)

Multiple Video Files In One Post

S3MediaVault.com has a “autobuffer” setting, which you can use to make sure that videos DO NOT automatically load as soon as the visitor arrives at your page.

This is especially useful when you have multiple videos within a blog post, and you don’t want your Amazon S3 Bandwidth meter to start running unless a user actually tries to play a video (by clicking on the “Play” button).

See examples of both “Multiple-Videos In A Post” as well as the “No Autoplay, No Autobuffering” below…

Video 1:

Video 2:

Leave a Comment

URL-Tags Demo

URL-Tags For Getting A “Secure, Expiring URL”

Use this tag to get back a secure, expiring and raw URL for your media file on S3, which you can then use to create your own HTML within your blog post – say to create your own image that says “Click here to download” that points to this expiring URL.

Basically, wherever you insert the following URL tag, the tag will be replaced by the secure expiring URL a link to your file.
So this…

[s3mv]businesscard-proof.pdf,url[/s3mv]

becomes this…

http://s3mediavault.com.s3.amazonaws.com/businesscard-proof.pdf?AWSAccessKeyId=1HPS101KFMM8SKNK9BG2&Expires=1337444945&Signature=mHnD2HSjn4nLKeaK%2BEwSAf3orew%3D

 

And if you wish to display a full-fledged downloadable link that points to a file on Amazon S3, with some link text that says “Click here to download…”, then you could do something like this…

<a href="[s3mv]businesscard-proof.pdf,url[/s3mv]"> Click here to download my super-duper-freakin-awesome report </a>


WARNING 1: DO NOT REPLACE THE TEXT “url” in the shortcode above. It must remain as “url”.

WARNING 2: YOUR FILE NAME SHOULD NOT START WITH http://….


Example A: Using this “Expiring URL” to create your own HTML link

Click here to download my super-duper-freakin-awesome report


Example B: Creating an Image-based download link:

download imageClick here to download

Users can then just click on the link, or do a “Right-Click, Save-As” and save the file to their computer.

- Ravi Jayagopal

Next: Protect Videos Using “Video-Tags”

=> Click here for a Video-Tags Demo

Comments (1)