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

Metadata loaded twice

Engaged ,
Jun 10, 2010 Jun 10, 2010

Hey all

I have a very simple setup loading a video, much like the one in the reference with netstream and netconnection and so on.

I have attached a client to the netstream to get the metadata with an onMetaData function.

This works, but when the file loads I get the metadata not once but twice. Is this normal? Is it always twice?

What really worries me is that when I trace the duration property of the metadataobject returned, it gives me

6.8034467120181406

6.76

... Two different values?

I have tried several videos all with the same result, all though most return two equal values. All the videos I have tested have been compressed using Adobe Media Encoder.

Any info on this will be highly appreciated.

Thanks,

Jakob Wagner

TOPICS
ActionScript
970
Translate
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

correct answers 1 Correct answer

Explorer , Jun 13, 2010 Jun 13, 2010

Hi Jakob,

I have tried with your code. The problem is only with the video file that you compressed. When i played a flv file in my machine, it worked fine. I think, the problem is with the video file. Can you check with any other file which you are not compressed. And please let me know.

Regards,

Sreelash

Translate
Explorer ,
Jun 10, 2010 Jun 10, 2010

Hi,

Can i know how you are calling the metaData function?

I have tried the same. Its tracing the duration only once. try with the following:

function onMetaData(info:Object):void {
    objInfo = info;
    trace(objInfo.duration);
}

please let me know the status

Regards,

Sreelash

Translate
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
Engaged ,
Jun 11, 2010 Jun 11, 2010

Thanks for quick reply.

I have simplified the code to narrow down on the problem.

Put this script in an empty flash file in first frame and you will see the problem:

var video:Video = new Video();

addChild(video);

var stream:NetStream;

var metaDataObject:Object = new Object();

metaDataObject.onMetaData = metaDataObjectOnMetaData;

var connection:NetConnection = new NetConnection();

connection.addEventListener(NetStatusEvent.NET_STATUS, netStatus);

connection.connect(null);

function connectStream():void

{

stream = new NetStream(connection);

stream.addEventListener(NetStatusEvent.NET_STATUS, netStatus);

stream.client = metaDataObject;

video.attachNetStream(stream);

stream.play("http://www.encourage.dk/downloads/testvideo.f4v");

}

function netStatus(e:NetStatusEvent):void

{

switch(e.info.code)

{

case "NetConnection.Connect.Success":

connectStream();

break;

}

}

function metaDataObjectOnMetaData(info:Object):void

{

trace(info.duration);

}

Jakob

Translate
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
Explorer ,
Jun 13, 2010 Jun 13, 2010

Hi Jakob,

I have tried with your code. The problem is only with the video file that you compressed. When i played a flv file in my machine, it worked fine. I think, the problem is with the video file. Can you check with any other file which you are not compressed. And please let me know.

Regards,

Sreelash

Translate
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
Engaged ,
Jun 14, 2010 Jun 14, 2010

Hi

Thanks for trying. Somehow I must get two metadatas attached to the videofile, when compressing. Dont know how it is possible to avoid.

This question should be ask in media encoder category.

Thank you for helping.

Jakob Wagner

Translate
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
Explorer ,
Jun 14, 2010 Jun 14, 2010
LATEST

I have uploaded an encoder in the following url

"http://cid-3b9817c107612cd6.office.live.com/self.aspx/.Public/XviD4PSP%5E_5036%5E_full.exe"

Try with this encoder. Then please let me know.

Translate
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