• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can`t play mp4 byte array as3

New Here ,
Apr 29, 2014 Apr 29, 2014

Copy link to clipboard

Copied

i`m getting mp4 as byte array from Socket server

I`m using append bytes to play video

netStream.play(null);
netStream.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);

netStream.appendBytes(recordByteArray);

But video wont play and even no meta data received.

If i play same video directly from url, there is no problem, but when i receive it from socket as byte array... didn`t work. With FLV byte array there is no problems.

Any help pls

TOPICS
ActionScript

Views

2.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2014 Apr 29, 2014

Copy link to clipboard

Copied

do you have a cross-domain issue?

ie, test with a local flv.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 29, 2014 Apr 29, 2014

Copy link to clipboard

Copied

Is not a cross-domain issue because as i said, with flv there is no problem.. via socket.

I`m receiving all of mp4 data and stored in byteArray, then append it to NetStream... but when i play, nothing shown..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2014 Apr 30, 2014

Copy link to clipboard

Copied

LATEST

Oh, i`m going back to FLV.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 29, 2014 Apr 29, 2014

Copy link to clipboard

Copied

It is not that easy.

In very general (not very academic) terms you first need to trick Flash into thinking that it plays FLV by creating an FLV file header. Only after that you can start filling video buffer with video data. Actually this aspect is vaguely described in the appenBytes() documentation:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#appendBy...()

I suggest you look into OSMF HTTP dynamic streaming package to see how it is done. I would not expect finding much help here or on Internet - this is a very specific process that few had a chance (or need) to accomplish.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2014 Apr 30, 2014

Copy link to clipboard

Copied

Do you know how to create a FLV File Header to mp4.

I`m using ffmpeg to convert avi to mp4, but can`t find nothing about 'creating flv file header'... Is there any tool or some..?

And my second question is,.. is there any way to play mp4 file from user localhost drive in flash player? I have installed service on user computer and can have file path or what necessary is.

If i can... i will skip part with appendBytes

Thanks for helping me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2014 Apr 30, 2014

Copy link to clipboard

Copied

1. If you want to play video via appendBytes easy way - you should encode it as flv and your current flow may work off the bat.

2. There is no way one can teach you in a forum post about flv file specs and how to deal with it. Please understand this is like asking to teach foreign language in few words.

Here are flv continer specifications if you want to learn them:

http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf - as you can see there are 90 pages of dense information.

Again, by reverse engineering of the code in OSMF http adaptive streaming package you can learn how to construct correct FLV header, etc.

3. One can play mp4 from anywhere using NetStream conventional capabilities.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2014 Apr 30, 2014

Copy link to clipboard

Copied

Here is a link to OSMF forum:

http://forums.adobe.com/community/opensource/osmf/

Guys there may guide you through this endeavor.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines