0
votes

I just spent all day on this problem and I'm afraid I'm missing something.

I have a simple mov/mp4 file on my S3 server with AVC encoding, and I have a swf file that should play it. I Found 2 ways to do that, as described here.

The first one is:

nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.play("http://url.path/movie.mov");

This works, but it looks like it download the video and once finished it would start playing it.

In order to use it for video streaming it says to use this:

nc.connect("http://url.path/");
var ns:NetStream = new NetStream(nc);
ns.play("movie.mov");

This code fails for me in the NetStream ctor:

ArgumentError: Error #2126: NetConnection object must be connected.

Questions:

  1. Is this the right way of doing this or am I missing something in the code?
  2. I found this thread that makes me very sad, but I built some HTML video player that plays the streaming video from S#, how is this?
  3. Read a bit and saw that it might be because of the h264 format, that sends the metadata only in the end. Is this right? Is converting it to another format gonna solve it?
  4. All the flash-streaming tutorials assume I store my video with RTMP protocol, read about it a bit and seen that I can use Adobe Media Server 5 on Amazon Web Services. Do I have to? Is there a free solution for that or flash can only stream this protocol?

Thx.

2
Have you looked into Red5 Media Server? red5.org - It is open source and free to use. - bigp
Did you figure this out ever? - BadFeelingAboutThis
Not yet, I need to check if the air application fix it. - shem

2 Answers

0
votes

If the file is downloading completely before playback begins, it likely because the meta data is at the end of the video.

Try using qt-faststart (or search online for a pre-compiled binary version) to move this meta data to the beginning of the file.

0
votes

For your two methods:

  1. Either your server needs to be told to stream that mime type (I have no experience with S3 but it's likely already setup for common video types) or your file type is not a supported type for streaming, (the MOOV atom -meta data- is at the end of the file instead of the start). Using Adobe Media Encoder (or another encoding program that puts this data at the beginning of the file) re-encode to either an .mp4 (h.264 encoded) or .f4v (or .flv).

  2. This is for a streaming media server (Flash Media Server) so you'd enter the address of the media server: eg. "rtmp://mediaserver/application/streamname".