Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Auto-detect aspect ratio


Is there currently a way to auto-detect the aspect ratio of a .flv file? I'd like to set the pixel width of the player, and have the height be proportional since some video is 4:3, some is 16:9, etc. otherwise the video will be distorted if it's different than the aspect ratio that I choose when setting the pixel size of the player.

9 Community Answers

JeroenW

JW Player Support Agent  
1 rated :

If you make sure your videos have width / height metadata, the player will indeed stick to the aspectratio. If not, take a look at a tool like www.buraks.com/flvmdi to fix your FLV files.

JW Player

User  
0 rated :

Hi all,

I'm looking at aspect ratio auto-detection for MP4 files (from MP4Box).

Does H264 format embed metadata and does mediaplayer 4.1 support it?

Thanks.
liilo

JW Player

User  
0 rated :

I think Chris is asking about sizing the player to the video rather than fitting the video inside an already sized player.

One thing you can do is to parse your encoder output for the file resolution and store those values in a database. When you load the player you can pull those values and dynamically size the player prior to the file loading in the player.

JeroenW

JW Player Support Agent  
0 rated :

@liilo: MP4box indeed includes metadata and the player can read it.

JW Player

User  
0 rated :

@Jeroen,

bc.. "MP4box indeed includes metadata and the player can read it"

So does this mean that MP4 videos should be post-processed with MP4Box similar to the way that we post-process FLVs with FLVMDI, flvtool2, or yamdi?

Or do most MP4s already have the metadata and only need to have it at the beginning of the file either by encoder settings or using a tool like MP4Box?

JeroenW

JW Player Support Agent  
0 rated :

Actually, I haven’t encountered an MP4 file without metadata. I believe this is required for MP4 to work.

I did see various movies with the metadata at the end, so end-to-front swapping of the metadata is required at times.

JW Player

User  
0 rated :

@Jeroen

thanks for this news!

but can you tell me more about reading metadata?
Is there any doc?

Thanks
liilo

JeroenW

JW Player Support Agent  
0 rated :

A good starting point would be this article:

http://www.kaourantin.net/2007/08/what-just-happened-to-video-on-web_20.html

JW Player

User  
0 rated :

Thanks for the link to FLVMDI, JW. www.buraks.com/flvmdi did exactly what we needed! We had a video with aspect ratio: 1.8:1 but was not being rendered correctly within JW Player. Quickly loaded the META Viewer plugin and saw the missing META info...ran it through FLVMDI and voila, we had correctly displayed video without having to re-encode. Big thanks!

This question has received the maximum number of answers.