?
Solved

Displaying 16:9 and 4:3 video in Flash

Posted on 2008-10-15
5
Medium Priority
?
801 Views
Last Modified: 2013-11-11
Hello Experts,

I am using the NetConnection object to stream video to an Actionscript-controlled video container.  If I set the dimensions of the video container to 596x336 (16:9) and I display a 4:3 video in that container, the 4:3 video is stretched to fit the 16:9 video dimensions.  

Is there a way to set the 16:9 video container to play 4:3 video without stretching the video?   Ideally, if 4:3 video is played inside the 16:9 container, the 4:3 video is not stretched and displayed with the proper dimensions in the center of the 16:9 holder.  

What's the best solution?

Thanks
0
Comment
Question by:marcparillo
  • 2
  • 2
5 Comments
 

Expert Comment

by:Morningside-Church-IT
ID: 22727243
What are you using to actually encode the video you are streaming?  I would look at it on that end to find the anamorphic settings of your encoder.  This will allow the video to be displayed at the proper resolution in the player regrdless of 16:9 or 4:3.
0
 
LVL 3

Author Comment

by:marcparillo
ID: 22727799
Thank you.  I am using ffmpeg to encode wmv videos to flv format.   What do you mean by "anamorphic settings?"  And, regardless of what aspect ratio the video is encoded, doesn't Flash automatically scale the video to fit the dimensions of the embedded player?  I guess I'm looking for a way to override this scaling feature, if that's the case.

0
 
LVL 37

Accepted Solution

by:
CyanBlue earned 2000 total points
ID: 22730791
If I were doing that, I'd hide the video stream in the first place, get the metadata in Flash, calculate the aspect ratio, and then resize the video object to fit the correct video size(and add black or white background if necessary) to show it correctly...  But that might be differently handled depending on how you are displaying the video in Flash...

CyanBlue
0
 
LVL 3

Author Comment

by:marcparillo
ID: 22730844
Thanks CyanBlue,

Your suggestion is what I was leaning towards.   Since the video has to be loaded first to get the metadata, I thought I would:

1. hide the video container
2. load meta data
3. once i get the width and height information, resize the player
4. once the player is resized, show the player and automatically start the video

Is that the best solution?
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 22733078
Exactly...  ;)

CyanBlue
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question