Copy link to clipboard
Copied
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
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more