Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Mediacache on Amazon S3

  1. #1
    Join Date
    Dec 2012
    Posts
    8

    Default Mediacache on Amazon S3

    Dears,

    we have a Wowza instance on AWS with mediacache add-on installed. I try to stream a mp4 file from S3 bucket but get the error

    WARN server comment 2013-10-17 16:20:50 - - - - - 1951.662 - - - - - - - s3/s3-eu-west-1.amazonaws.com/wowzastreamingdemo/test.mp4 MediaReaderH264.open[1]: java.io.IOException: MediaCacheRandomAccessReader.open: Item not in cache: s3/s3-eu-west-1.amazonaws.com/wowzastreamingdemo/test.mp4

    I have a bucket on s3 with this url: https://s3-eu-west-1.amazonaws.com/w...gdemo/test.mp4

    and my MediaCache.xml file is this:
    <MediaCacheSource>
                            <Name>http</Name>
                            <BasePath>https://</BasePath>
                            <Prefix>s3/</Prefix>
                            <BaseClass>com.wowza.wms.plugin.mediacache.impl.MediaCacheItemHTTPImpl</BaseClass>
                            <ReaderClass></ReaderClass>
                            <DefaultBlockSize>256K</DefaultBlockSize>
                            <MaxTimeToLive>1200000</MaxTimeToLive>
                            <MinTimeToLive>600000</MinTimeToLive>
                            <ReadAhead>true</ReadAhead>
                            <ReadAheadThreshold>50</ReadAheadThreshold>
                            <IsPassThru>false</IsPassThru>
                            <Properties>
                                    <!-- maximum number of concurrent connections this source will make back to the web server -->
                                    <Property>
                                            <Name>maxPoolSize</Name>
                                            <Value>25</Value>
                                            <Type>Integer</Type>
                                    </Property>
                                    <!-- HTTP request timeout -->
                                    <Property>
                                            <Name>httpReadTimeout</Name>
                                            <Value>6000</Value>
                                            <Type>Integer</Type>
                                    </Property>
                                    <!-- HTTP connection timeout -->
                                    <Property>
                                            <Name>httpConnectionTimeout</Name>
                                            <Value>6000</Value>
                                            <Type>Integer</Type>
                                    </Property>
                                    <!-- HTTP read request retry count -->
                                    <Property>
                                            <Name>httpReadRetries</Name>
                                            <Value>3</Value>
                                            <Type>Integer</Type>
                                    </Property>
                                    <!-- Close socket connection if Content-Length incorrect on byte range request -->
                                    <Property>
                                            <Name>closeConnectOnBadContentLength</Name>
                                            <Value>false</Value>
                                            <Type>Boolean</Type>
                                    </Property>
                                    <!-- HTTP send buffer size -->
                                     <Property>
                                            <Name>httpSendBufferSize</Name>
                                            <Value>8000</Value>
                                            <Type>Integer</Type>
                                    </Property>
                                    <!-- HTTP receive buffer size -->
                                    <Property>
                                            <Name>httpReceiveBufferSize</Name>
                                            <Value>65000</Value>
                                            <Type>Integer</Type>
                                    </Property>
                                    <!-- Set to true if streaming from S3 so that bucket name is properly handled in URL structure -->
                                    <Property>
                                            <Name>isAmazonS3</Name>
                                            <Value>true</Value>
                                            <Type>Boolean</Type>
                                    </Property>
                                    <Property>
                                            <Name>s3BucketNameInDomain</Name>
                                            <Value>false</Value>
                                            <Type>Boolean</Type>
                                    </Property>
                                    <!-- Uncomment and set properties if streaming from S3 authenticated -->
                                    <!--
                                    <Property>
                                            <Name>awsAccessKeyId</Name>
                                            <Value></Value>
                                    </Property>
                                    <Property>
                                            <Name>awsSecretAccessKey</Name>
                                            <Value></Value>
                                    </Property>
                                    -->
                                    <!-- Uncomment and set these properties to send the request through a forward proxy server -->
                                    <!--
                                    <Property>
                                            <Name>proxyHost</Name>
                                            <Value></Value>
                                    </Property>
                                    <Property>
                                            <Name>proxyPort</Name>
                                            <Value></Value>
                                            <Type>Integer</Type>
                                    </Property>requestFullURL
                                    <Property>
                                            <Name>requestFullURL</Name>
                                            <Value>true</Value>
                                            <Type>Boolean</Type>
                                    </Property>
                                    -->
                            </Properties>
                    </MediaCacheSource>
    The url for playout is this
    Server: rtmp://[wowza-address]/mediacache
    Stream: mp4:s3/wowzastreamingdemo/test.mp4

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Not sure why, but one quick and dirty way to get going for you will be to set /BasePath to "https://s3-eu-west-1.amazonaws.com/" and isAmazonS3 to "false". Then I can stream your test.mp4.

    But let me look further, I don't think the AWS keys will work with isAmazonS3 set to "false"

    I tried setting s3BucketNameInDomain to "false", but that did not work, and there isn't a bucket name in the domain.

    Richard

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    This works:

    <MediaCacheSource>
    	                        <Name>http2</Name>
    	                        <BasePath>http://s3.amazonaws.com/</BasePath>
    	                        <Prefix>s3/</Prefix>
    	                        <BaseClass>com.wowza.wms.plugin.mediacache.impl.MediaCacheItemHTTPImpl</BaseClass>
    	                        <ReaderClass></ReaderClass>
    	                        <DefaultBlockSize>256K</DefaultBlockSize>
    	                        <MaxTimeToLive>1200000</MaxTimeToLive>
    	                        <MinTimeToLive>600000</MinTimeToLive>
    	                        <ReadAhead>true</ReadAhead>
    	                        <ReadAheadThreshold>50</ReadAheadThreshold>
    	                        <IsPassThru>false</IsPassThru>
    	                        <Properties>
    	                                <!-- maximum number of concurrent connections this source will make back to the web server -->
    	                                <Property>
    	                                        <Name>maxPoolSize</Name>
    	                                        <Value>25</Value>
    	                                        <Type>Integer</Type>
    	                                </Property>
    	                                <!-- HTTP request timeout -->
    	                                <Property>
    	                                        <Name>httpReadTimeout</Name>
    	                                        <Value>6000</Value>
    	                                        <Type>Integer</Type>
    	                                </Property>
    	                                <!-- HTTP connection timeout -->
    	                                <Property>
    	                                        <Name>httpConnectionTimeout</Name>
    	                                        <Value>6000</Value>
    	                                        <Type>Integer</Type>
    	                                </Property>
    	                                <!-- HTTP read request retry count -->
    	                                <Property>
    	                                        <Name>httpReadRetries</Name>
    	                                        <Value>3</Value>
    	                                        <Type>Integer</Type>
    	                                </Property>
    	                                <!-- Close socket connection if Content-Length incorrect on byte range request -->
    	                                <Property>
    	                                        <Name>closeConnectOnBadContentLength</Name>
    	                                        <Value>false</Value>
    	                                        <Type>Boolean</Type>
    	                                </Property>
    	                                <!-- HTTP send buffer size -->
    	                                 <Property>
    	                                        <Name>httpSendBufferSize</Name>
    	                                        <Value>8000</Value>
    	                                        <Type>Integer</Type>
    	                                </Property>
    	                                <!-- HTTP receive buffer size -->
    	                                <Property>
    	                                        <Name>httpReceiveBufferSize</Name>
    	                                        <Value>65000</Value>
    	                                        <Type>Integer</Type>
    	                                </Property>
    	                                <!-- Set to true if streaming from S3 so that bucket name is properly handled in URL structure -->
    	                                <Property>
    	                                        <Name>isAmazonS3</Name>
    	                                        <Value>true</Value>
    	                                        <Type>Boolean</Type>
    	                                </Property>
    	                                <Property>
    	                                        <Name>s3BucketNameInDomain</Name>
    	                                        <Value>true</Value>
    	                                        <Type>Boolean</Type>
    	                                </Property>
    	                                <!-- Uncomment and set properties if streaming from S3 authenticated -->
    	                                <!--
    	                                <Property>
    	                                        <Name>awsAccessKeyId</Name>
    	                                        <Value></Value>
    	                                </Property>
    	                                <Property>
    	                                        <Name>awsSecretAccessKey</Name>
    	                                        <Value></Value>
    	                                </Property>
    	                                -->
    	                                <!-- Uncomment and set these properties to send the request through a forward proxy server -->
    	                                <!--
    	                                <Property>
    	                                        <Name>proxyHost</Name>
    	                                        <Value></Value>
    	                                </Property>
    	                                <Property>
    	                                        <Name>proxyPort</Name>
    	                                        <Value></Value>
    	                                        <Type>Integer</Type>
    	                                </Property>requestFullURL
    	                                <Property>
    	                                        <Name>requestFullURL</Name>
    	                                        <Value>true</Value>
    	                                        <Type>Boolean</Type>
    	                                </Property>
    	                                -->
    	                        </Properties>
                    </MediaCacheSource>
    Richard

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    I changed the MediaCacheSoure /Name to "http2" to avoid duplicate on your side.

    I change /BasePath to "http://s3.amazonaws.com/"

    And /isAmazonS3 and /s3BucketNameInDomain to "true"

    Note that the The Wowza EC2 pre-built AMIs come with MediaCache installed and a MediaCache application named "vods3".

    Richard

  5. #5
    Join Date
    Dec 2012
    Posts
    8

    Default

    Quote Originally Posted by rrlanham View Post
    I changed the MediaCacheSoure /Name to "http2" to avoid duplicate on your side.

    I change /BasePath to "http://s3.amazonaws.com/"

    And /isAmazonS3 and /s3BucketNameInDomain to "true"

    Note that the The Wowza EC2 pre-built AMIs come with MediaCache installed and a MediaCache application named "vods3".

    Richard
    The error persist

    WARN server comment 2013-10-18 15:30:46 - - - - - 15.145 - - - - - - - s3/wowzastreamingdemo/test.mp4 MediaReaderH264.open[1]: java.io.IOException: MediaCacheRandomAccessReader.open: Item not in cache: s3/wowzastreamingdemo/test.mp4

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    It's working here. Did you restart Wowza? after making those changes? Did you use the MediaCache source I showed?

    Richard

  7. #7
    Join Date
    Dec 2012
    Posts
    8

    Angry

    Quote Originally Posted by rrlanham View Post
    It's working here. Did you restart Wowza? after making those changes? Did you use the MediaCache source I showed?

    Richard
    Yes i have restarted Wowza and don't work, can you send me the url for playout ?

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Using the Wowza example VideoOnDemand Flash RTMP player.

    Server: rtmp://[wowza-address]:1935/mediacache
    Stream: mp4:s3/wowzastreamingdemo/test.mp4

    INFO session connect 0:0:0:0:0:0:0:1
    INFO stream create 
    INFO stream play s3/wowzastreamingdemo/test.mp4
    INFO stream stop s3/wowzastreamingdemo/test.mp4
    INFO stream destroy s3/wowzastreamingdemo/test.mp4
    Richard

  9. #9
    Join Date
    Dec 2012
    Posts
    8

  10. #10
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    From what I can see in that screen shot you have left out "rtmp://"

    Richard

Page 1 of 2 12 LastLast

Similar Threads

  1. Error on startup for mediacache using Amazon S3
    By garymonk in forum On-Demand Streaming
    Replies: 1
    Last Post: 09-12-2014, 06:18 AM
  2. Playing on demand video from Amazon S3 with MediaCache.
    By droidlabour in forum Video On Demand Streaming Discussion
    Replies: 5
    Last Post: 08-23-2013, 02:54 PM
  3. MediaCache and Amazon S3 with new region
    By tpepernic in forum AddOn: Other AddOns
    Replies: 1
    Last Post: 06-07-2013, 03:55 PM
  4. using amazon s3 with mediacache.
    By welbyobeng in forum Video On Demand Streaming Discussion
    Replies: 8
    Last Post: 06-12-2012, 04:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •