Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8092357

MediaView does not scale content correctly



    • Enhancement
    • Resolution: Unresolved
    • P3
    • tbd
    • fx2.1
    • javafx
    • Windows 7, JDK 7, JavaFX 2.1 b14


      I recently experimented with the new mp4 support a bit and had problems getting some example videos displayed with the correct proportions. The problem seems to be that the MediaView only considers the storage pixel ratio of the media but ignores all internal flags which would indicate that the display has to be scaled in order to preserve the actual display aspect ratio of the media file. This problem arises if you have to deal with media with non-square pixels or with an anamorphic compression. For example: My mp4 video file comes from a digital TV recorder. It is stored with 720x576 pixels but according to the PAL standard these pixels are not square pixels so the display has to be scaled. The second issue is that this was a 16:9 movie which is stored anamorphic (which is also the standard for DVDs). In order to display this correctly the image has to be stretched in this case to 1024x576. (Actually a little bit more and then a bit clipped off)

      The problem now is that the ImageView neither does this correction automatically nor does it seem to provide any relevant media info so that the programmer could make these corrections manually. At least I haven't found any.

      To my opionion the MediaView should ...
         try to correct the display size automatically according to the internal media data.
         provide the relevant media data
         provide a way to override these automatik settings because very often the internal media data is not correctly set.

      A discussion of these media size issues can be found here:




            almatvee Alexander Matveev
            dpausjfx Dr. Michael Paus (Inactive)
            2 Vote for this issue
            3 Start watching this issue