[FFmpeg-trac] #7623(avcodec:closed): Wrong interpretation of (m)jpeg aspect ratio

FFmpeg trac at avcodec.org
Thu Dec 20 14:50:19 EET 2018


#7623: Wrong interpretation of (m)jpeg aspect ratio
--------------------------------------+-----------------------------------
             Reporter:  UlfZibis      |                    Owner:
                 Type:  defect        |                   Status:  closed
             Priority:  normal        |                Component:  avcodec
              Version:  git-master    |               Resolution:  invalid
             Keywords:  mjpeg aspect  |               Blocked By:
             Blocking:                |  Reproduced by developer:  0
Analyzed by developer:  0             |
--------------------------------------+-----------------------------------
Changes (by Gyan):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 As per the JPEG specification at
 https://www.w3.org/Graphics/JPEG/jfif3.pdf, (last tip on pg 7)

   if you only want to specify a pixel aspect ratio, put 0 for the units
 field in the special APP0 field. Xdensity and Ydensity can then be
 programmed for the desired aspect ratio. Xdensity = 1, Ydensity = 1 will
 program a 1:1 aspect ratio.  Xdensity and Ydensity should always be non-
 zero.

 Also, see on pg. 5

   units = 0:  no units, X and Y specify the pixel aspect ratio
   units = 1:  X and Y are dots per inch
   units = 2:  X and Y are dots per cm

 Our encoder always writes units as 0, so Irfanview is at fault here.

 `put_bits(p,  8, 0);              /* units type: 0 - aspect ratio */`

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7623#comment:10>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list