You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Flowplayer Full Screen Control - 4:3 and 16:9 Created Oct 12, 2009

This thread is solved

Views: 9874     Replies: 11     Last reply Aug 7, 2011  
You must login first before you can use this feature

vicelist
http://www.ViceList.com

Posts: 9

Registered:
Jun 11, 2009

Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

We're streaming H.264 on FMS 3.5. The first issue we had is that none of the native scaling options within Flowplayer can handle both 4:3 and 16:9 content.

We addressed this by databasing all of our content and changing the player size based on this parameter.

However, when Flowplayer is used in Full Screen mode, it sizes to fit based on whatever the user's monitor is...regardless of aspect ratio.

We want to fix (hack) this behavior to impose both horizontal or vertical letterboxing in Full Screen mode based on the content and monitor size.

Any suggestions?

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: Flowplayer Full Screen Control - 4:3 and 16:9, from vicelist
Have you tried scaling: 'fit' in clip properties?

vicelist
http://www.ViceList.com

Posts: 9

Registered:
Jun 11, 2009

» » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » Flowplayer Full Screen Control - 4:3 and 16:9, from edge
Yes, none of the scaling options work universally. That's why we essentially have hardcoded the behavior on the default size. We're wanting to do the same thing now in the Full Screen mode, but also account for the users' monitor sizes as well.

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » Flowplayer Full Screen Control - 4:3 and 16:9, from vicelist
I don't think flash+H.264 supports PAR - pixel based aspect ratio. Eg the videos need to be encoded to the correct height based off width and source aspect.

I've yet to see a flash player play h264 with par stating the aspect correctly. I think its a flash+H.264 issue, not flowplayer.

vicelist
http://www.ViceList.com

Posts: 9

Registered:
Jun 11, 2009

» » » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » » Flowplayer Full Screen Control - 4:3 and 16:9, from edge
Yes, we have 4:3 and 16:9 videos. Everything has been sized correctly on the encoding. That's not the issue. And we have that info stored in our database, so we can adjust player's vars.

I've either read or been told that Flowplayer's Full Screen sizing can be controlled. Is this not true?

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» » » » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » » » Flowplayer Full Screen Control - 4:3 and 16:9, from vicelist
If it doesn't scale correctly using either
scaling: 'orig'
or
scaling: 'fit'
Then the h.264 video is improperly encoded for flash based viewing.

Those control both normal and full screen mode's.

You could try searching a bit. http://flowplayer.org/search.html?q=Full+Screen+sizing+

Without seeing a test clip + code snippets its hard to say.

gmccomb

Posts: 746

Registered:
Apr 9, 2009

» » » » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » » » Flowplayer Full Screen Control - 4:3 and 16:9, from vicelist
You may be missing Edge's point here: That is, if your 16:9 videos are encoded with a 4:3 stored aspect ratio but rectangular pixels you'll get distortion. The only method in Flash to work around this is to artificially stretch the player, which is bad for two reasons: 1, it decreases playback efficiency and 2, it does nothing for fullscreen mode.

Your description of the problem strongly suggests your 16:9 videos are not encoded properly for Flash playback. YouTube has some decent tutorials on what's needed here. In the end, what you want is a video with square pixels and a "true" 16:9 stored aspect ratio.

vicelist
http://www.ViceList.com

Posts: 9

Registered:
Jun 11, 2009

» » » » » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » » » » Flowplayer Full Screen Control - 4:3 and 16:9, from gmccomb
I think you guys are missing the point.

I just want to manipulate the size of Flow Player in full screen mode.

I said at the beginning that the default scaling options don't work, and that my videos are properly encoded.

For instance, if my user has a 4:3 monitor and I have 16:9 content, I want horizontal letterbox bars in FULL SCREEN.

For instance, if my user has a 16:9 monitor and I have 4:3 content, I want vertical letterbox bars in FULL SCREEN.

Again, I have all this information in my database and can pass vars.

gmccomb

Posts: 746

Registered:
Apr 9, 2009

» » » » » » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » » » » » Flowplayer Full Screen Control - 4:3 and 16:9, from vicelist
We're talking at cross-purposes here.

Flash correctly displays the right aspect ratio in fullscreen mode IF your content is properly encoded. You don't need to do anything IF your content has the right aspect ratio to begin with.

It *very much sounds* like yourt 16:9 content is anamorphic. Flash does not support anamorphic video; that is, it will not "unsqueeze" anamorphic pixels.

A setting of 'scaling:fit' is supposed to maintain the original aspect ratio (we're talking stored aspect ratio; Flowplayer and Flash have no knowledge of pixel aspect ratios).

Edge
Vizmu Media ------------------- http://vizmu.com/

Posts: 576

Registered:
Nov 29, 2008

» » » » » » » » Flowplayer Full Screen Control - 4:3 and 16:9

Posted: Oct 12, 2009

Reply to: » » » » » » » Flowplayer Full Screen Control - 4:3 and 16:9, from gmccomb
-Flowplayer and Flash have no knowledge of pixel aspect ratios).

Exactly...

If your video resolution is correct based of the actual aspect, the player will correctly do exactly what your asking "letterbox bars in FULL SCREEN" for any aspect.

I ran into the Exact same issue your having due to anamorphic h.264 content encoding via ffmpeg without setting the correct height every time.

r11532

Posts: 30

Registered:
Dec 7, 2009

Correction for Wrong Video Aspect Ratio to Play in Fullscreen

Posted: Dec 13, 2009

Reply to: Flowplayer Full Screen Control - 4:3 and 16:9, from vicelist
How to modify an flv video encoded at the wrong aspect ratio, so flowplayer will play it in fullscreen mode without it appearing either stretched or squashed.

Ideally, the perfect solution should be reencoded a video to the proper aspect ratio. However, for long videos, such as movies, a simple workaround can be a preferable alternative to the many hours that reencoding may require.

This approach works for x264 mp4 videos with mp3 audio wrapped into an flv. With modification, though, the approach should apply to videos created with different encoders and audios.

The downloadable freeware tools required are: FLVExtractCL.exe, MP4Box.exe/libgpac.dll, ffmpeg.exe, and yamdi.exe.

The procedure sequence is:
1. FLVExtract to demux a movie.flv file into separate movie.264 and audio files.
2. MP4box to add a PAR aspect ratio flag to the movie.264 file and save it as movie.mp4.
3. ffmpeg to mux the movie.mp4 and the audio file into a new flv.
4. yamdi to add/replace metadata assigning width and height values to 0.
5. The final step is to specify bufferLength: "0" in the flowplayer script configuration.

Here is an example "convert flv.bat" script I used to change a 23.976 fps video encoded at 720x480, (aspect ratio of 1.5) but needing correction to an aspect ratio of 2.333.
PAR conversion calculation = 2.333/1.5 = 1.555:1 = 14:9 (determine closest integer ratio and edit into the bat file.)

Put all the files in the same folder, compose and then run the bat file.
-----------------folder contents-------------------
convert flv.bat
ffmpeg.exe
FLVExtractCL.exe
libgpac.dll
movie.flv
MP4Box.exe
yamdi.exe
-------------------end of folder--------------------

--------------convert flv.bat contents------------
:: Demux flv into separate video and audio files, 264 and mp3 for example.
FLVExtractcl -v -a movie.flv

:: Set PAR aspect ratio flag. par=width:height ratio integers and -fps to the fps of movie.flv
:: When the bat file runs, verify that the displayed video fps and encoding fps are equal.
mp4box -add movie.264#1:par=14:9 -fps 23.976 -nodrop movie.mp4

:: Remux video and audio to a new flv
ffmpeg -i movie.mp4 -vcodec copy -i movie.mp3 -acodec copy temp.flv

:: Set metadata height and width to 0. Final output to movie2.flv.
yamdi -i temp.flv -o movie2.flv

:: Delete intermediate files
del movie.264
del movie.mp3
del movie.mp4
del temp.flv

:: Pause to keep dos window open to check for errors if conversion fails.
pause
---------------------end of bat---------------------

Conversion success can be verified with a downloadable freeware flv viewer such as FLV Player 2.0.

This is part of the script for flowplayer I use to play corrected videos in fullscreen without the stretching or squashing associated with the originals. The expected video aspect ratio is seen with properly assigned black borders top/bottom or left/right.

<script>
flowplayer("player", "flowplayer-3.1.4.swf",
{clip: {
url: "movie2.flv",
scaling: "fit", bufferLength: "0"
}});
</script>

Why this procedure works is somewhat a mystery but I've applied it to all 50+ movies in my Intranet library without any failures.

lol