Posts Tagged ‘amazon’

JW Player, S3, Wowza and “Stream not found” error for files that have spaces in filename

Monday, February 23rd, 2009 by The BCM Team

When working on an application that streams videos from S3 I noticed that whenever an s3 object has a space in its name it fails to stream.

However, when streaming objects without spaces in the name it works fine.

The solution is as follows:

I am using PHP and JW Player 4.3. The problem is due to JW player not encoding url when rtmp:// protocol is used (specifically in RTMPTModel.as file). So to fix the problem with playing files that have spaces you need to either:

  • Replace spaces with “+” and urlencode() the whole url after that. For example:
    
    urlencode("mp4:amazons3//file+name+with+spaces.m4v");
    
  • Double urlencode() the whole url. For example:
    
    urlencode(urlencode("mp4:amazons3//file name with spaces.m4v"));
    

Copy your bundled image on Amazon EC2 from one region to another

Wednesday, February 18th, 2009 by The BCM Team

If you have a bundled image in the us-east-1 region of Amazon EC2 and you want to move/copy it to Europe (eu-west-1). The following command will help you out:

ec2-migrate-bundle --cert certificate.pem --privatekey privatekey.pem
--access-key  --secret-key  --bucket  --destination-bucket
--manifest image.manifest.xml --location EU
–cert
Specifies what certificate file to use
–privatekey
Specifies what private key file to use
–access-key
Your AWS account access key
–secret-key
Your AWS account secret key
–bucket
Bucket in origin region where the image is located
–destination-bucket
Bucket in destination region where the image will be transfered to
–manifest
filename of manifest file of bundled image
–location
Region where you are moving your image to

Once you transfered your bundled image, you will need to register it as an image on your EU server with the following command:

ec2-register --region eu-west-1 <bucket-name>/<manifest-filename>

Hints collection for a quick start with Amazon EC2 and S3

Wednesday, May 14th, 2008 by The BCM Team

These instructions are for Windows environment.

  • Download a private key and an x.905 certificate from your control panel on Amazon website and place them into the same folder as the batch file and EC2 Command line tools mentioned below.
  • Configure your environment variables. I suggest either add the settings to your Windows installation options or use the following batch file:
    
    @echo off
    set EC2_HOME=C:\ec2
    set PATH=%PATH%;%EC2_HOME%\bin
    set EC2_PRIVATE_KEY=%EC2_HOME%\privatekey.pem
    set EC2_CERT=%EC2_HOME%\certificate.pem
    set JAVA_HOME=C:\Program Files\Java\jre1.6.0_xx
    "%JAVA_HOME%\bin\java" -version
    

    privatekey.pem” and “certificate.pem” are the files mentioned above.Be sure to have Java Runtime Environment 1.5+ installed. You will also need to download EC2 Command Line tools from Amazon AWS Resource Center page.

  • Choose an Operating System image (AMI) that you will be using as a base for your server OS installation. For example, I am using an image of a base install of CentOS 5.0
  • You can see a list of all available images using the following command “ec2-describe-images -x all“. Here, “-x all" means show all available images available. Each image has a unique number listed before the description. You will need this number to refer to the image.
  • ec2-add-keypair <private_key_file_name> – generate private/public key file to use with SSH client that you choose to use. Where <name> is a name of a file of
  • ec2-run-instances ami-08f41161 -k <private_key_file_name> – run an instance of your AMI
  • ec2-terminate-instances <instance_number> – terminate a running instance
  • ec2-authorize default -p 22 and ec2-authorize default -p 80 – open ports for HTTP and SSH2
  • ec2-describe-instances – display stats for your AMIs
  • ec2-upload-bundle --retry -b <your bundle name> -m /mnt/image.manifest.xml -a <your access key> -s <your secret access key> – copy bundled AMI to your S3 storage
  • ec2-bundle-vol -d /mnt -k /mnt/<private_key.pem> -c /mnt/<certificate.pem> -u <aws_user_number>
  • ec2-upload-bundle --retry -b <your-s3-bucket> -m /mnt/image.manifest.xml -a <aws-access-key-id> -s <aws-secret-access-key>
  • ec2-register <your-s3-bucket>/image.manifest.xml