Kani Str
asked on
To get the FLV Video dimension
Can anybody help me how to get the FLV video files height and width,resizing swf player size?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Howdy... :)
Check on the metadata... It normally contains the dimension information but not all FLV file contains that data though...
CyanBlue
Check on the metadata... It normally contains the dimension information but not all FLV file contains that data though...
CyanBlue
ASKER
Thanks for your reply, I tried the following. But it is only working when i set the content path to some video on the internet, (i.e it gives me the width and height if i set a fully quailified URL like http://mysite.com/sample.flv) but it doesn't return anything if i set something like c:\samplevideo.flv
Here is the code i tried with...
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var nStream:NetStream = new NetStream(netConn);
my_video.attachVideo(nStre am);
nStream.setBufferTime(0);
nStream.play("http:\\www.video.com\video\video.flv \\ this is working
nStream.play("d:\test.flv" ); \\ this is not working
nStream.onMetaData = function(myMeta) {
trace("FLV Width: "+myMeta.width);
trace("FLV Height: "+myMeta.height);
my_video.width = myMeta.width;
my_video.height = myMeta.h
};
Here is the code i tried with...
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var nStream:NetStream = new NetStream(netConn);
my_video.attachVideo(nStre
nStream.setBufferTime(0);
nStream.play("http:\\www.video.com\video\video.flv \\ this is working
nStream.play("d:\test.flv"
nStream.onMetaData = function(myMeta) {
trace("FLV Width: "+myMeta.width);
trace("FLV Height: "+myMeta.height);
my_video.width = myMeta.width;
my_video.height = myMeta.h
};
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you have created the FLV using Flash then for sure Flash does not store height/width meta data
ASKER
Nope, i usually create the flvs using FFMPEG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Actually I am trying to achive a flv player (desktop application), that will be using the physical path (i think you know this)
Do i need to download both the dos and GUI version of the application, what exactly this will do?
Do i need to download both the dos and GUI version of the application, what exactly this will do?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok, i will give it a try
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i think there must be a way in Flash 8 to do this?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I need to find the actual width and height of the video, i will load videos into the player dynamically...