RTMP stream of a+v plays only audio, no video - actionscript-3

In Flash, AS3, I am using NetConnection to connect to a RTMP server, then I use NetStream to play a video+audio stream.
I attach the stream (attachNetStream) to a flash.media.Video instance that is added to stage (double checked that it is ON the stage) and play it, but all I get is the sound of the stream that's being played - no video is displayed.
Note that even though I cannot see the video, when I listen to the onMetaData of the stream I can get plenty of information about the video such as width, height, FPS (changes during playback as if a video is shown), number of decoded frames.
Does anybody have an idea how can I make the video work too?

Instead of using "raw" NetConnection and NetStream and attach it to a flash.media.Video, I'd recommend using some wrapper such as Pyro Player. Its basically a video API and I've used it many times for RTMP video and it works like a charm (I've always found the Video component from Adobe very buggy, specially when displaying video from a RTMP server). Give it a try!

Thank you guys! but I found out the answer:
Apparently Flash's (CS3) built-in Video class does not support H.264 streams. I tried to compile the exact same code in Flex 3.5 and everything worked!
There is a possibility that CS4 also supports H.264 streams. I did not try.
JWPlayer is great, I did not try Pyro.
Cheers.

Related

HTML5 Video element does not a resume live streaming when a stream is interrupted then restarts

I'm using JW Player to live stream content onto a web page. The player is backed by an open-source library called cine.io.
My issue is that the player falls back to an HTML 5 video element for all mobile web, both on iPhone and Android. There are some differences between the flash solution of JW Player and HTML5 - notably that if a live stream starts, then stops, then restarts, the video element will not pick up the restarted stream.
This is a problem since streams often drop in and out - and the flash solution does pick up the restarted stream.
I tested a bunch of listener methods on the video and the only one that signalled that the stream had ended was a "time update" listener:
$video.on('timeupdate', function(){
//Do something
});
However none of my attempts to re-open the stream have been effective.
Is this even possible? Can anyone provide pointers?
Would an example like this work?
http://support.jwplayer.com/customer/portal/articles/1442607-example-a-custom-error-message

RTMP stream MP4 with FLVPlayback Component

I'm having to change a video from an ollllddd project. It was built using the AS3 FLVPlayback Component. The video back then were FLV and streamed fine from out limelight server.
The new videos I received are h264 MP4s and are NOT streaming. Has anyone been able to successfully STREAM mp4 files using the FLVPlayback component?
I never use this component anymore. I have since moved onto OSMF player and I can stream MP4s no problem
Edit: This program is rather large and is highly dependent on the FLVPlayback component so swapping it out isn't an option right now.
I've figured it out. The URL is way different. Should have known because its the same format as the OSMF player. The URL has to be formatted like so:
rtmp://youserver.llnwd.net/xxxx/mp4:xxx/u/clients/xxxx/vov/vov_low_version2'
note the location of mp4: rather than in front of or after just the filename

AS3 Video & NetStream : MP4 video not showing with appendBytes

I'm trying to stream some MP4 video in a Video component in an Air application, using a NetStream and the netStream.appendBytes method. The source video is coming from a socket so I need to append the Bytes, but it was not working. So I tried to appendBytes from a file read from the system, it still wasn's working. I tried putting that file as the source of a VideoPlayer element, and it did work.
I then tried the appendBytes method to open an flv file from the system and it did work, so I knew I was not doing something wrong in my process. What does VideoPlayer do that I don't when I use the appendBytes method, that would make it work like I want ?
You cannot use appendBytes and mp4 containers. AppendBytes works with FLV frames only.

as3 netstream sends StreamNotFound on all mp3's, not on mp4's

I've developed a custom video player which needs to double up as an audio player. All the functionality is there, but the NetStream doesn't load the mp3. It throws NetStream.Play.StreamNotFound.
I am not using a Flash Media server. I have tested both local, and online .mp3 files.
The strange thing is that the code works perfectly when putting in an .mp4 file.
What am I missing?
If not using media server or desktop application it wont work. mp4 is a container format for both video and audio, thats why netStream is loading it: Its reading it as an empty video stream with an active sound stream. In the other hand, mp3 is an audio only codec, and you should load it using the Sound class, not NetStream. Here is some more info about supported formats for NetStream objects: http://dev.illumifi.net/AS3/flash/net/NetStream.html

Play video only after its fully downloaded

Flv seems like can't be use with loader but NetStream. But I wanted to play the video only after I have completely download it (smooth viewing with no buffering time). How can I do it with NetStream? And Can I have multiple video load at same time, and play it according to some array arrangement?
you can check if stream.bytesLoaded == stream.bytesTotal