[FFmpeg-trac] #9988(undetermined:new): Resolution metadata for JPEG with orientation

FFmpeg trac at avcodec.org
Mon Oct 24 17:27:19 EEST 2022


#9988: Resolution metadata for JPEG with orientation
-------------------------------------+-------------------------------------
             Reporter:  Jozef        |                    Owner:  (none)
  Chutka                             |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:  mjpeg        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Description changed by Jozef Chutka:

Old description:

> In the current version (N-108614-g37ee36f689-20221011) of FFmpeg and
> FFprobe when a JPEG with orientation side data is in use, the reported
> resolution does not respect the applied orientation.
>
> ```
> ffprobe -i input.jpg
> ...
> Input #0, image2, from 'input.jpg':
>   Duration: 00:00:00.04, start: 0.000000, bitrate: 50360 kb/s
>   Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
> bt470bg/unknown/unknown), 1800x1200 [SAR 72:72 DAR 3:2], 25 fps, 25 tbr,
> 25 tbn
> ```
>
> For example image 1800x1200 with orientation 90, should report resolution
> 1200x1800.
>
> Following are the main reasons:
>
> 1. when such media is being loaded and encoded the output has the correct
> resolution `ffmpeg -i input.jpg -y output.png` will change from reported
> 1800x1200 to 1200x1800 (confusing).
>
> ```
> Input #0, image2, from 'input.jpg':
>   Duration: 00:00:00.04, start: 0.000000, bitrate: 50360 kb/s
>   Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
> bt470bg/unknown/unknown), 1800x1200 [SAR 72:72 DAR 3:2], 25 fps, 25 tbr,
> 25 tbn
> ...
> Output #0, image2, to 'output.png':
>   Metadata:
>     encoder         : Lavf59.34.101
>   Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown, progressive),
> 1200x1800 [SAR 1:1 DAR 2:3], q=2-31, 200 kb/s, 2
> ```
>
> 2. Any software (photoshop, chrome, ...) that opens JPEG with orientation
> will report resolution following the orientation metadata.
>
> 3. The resolution information without orientation respected has no real
> life use for end user I can think of.
>
> 4. Correct me if I am wrong, but it seems impossible to extract
> orientation information using `ffmpeg` executable, the only way I managed
> to discover is to use `ffprobe -show_frames` and parse SIDE_DATA

New description:

 In the current version (N-108614-g37ee36f689-20221011) of FFmpeg and
 FFprobe when a JPEG with orientation side data is in use, the reported
 resolution does not respect the applied orientation.

 {{{
 ffprobe -i input.jpg
 ...
 Input #0, image2, from 'input.jpg':
   Duration: 00:00:00.04, start: 0.000000, bitrate: 50360 kb/s
   Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
 bt470bg/unknown/unknown), 1800x1200 [SAR 72:72 DAR 3:2], 25 fps, 25 tbr,
 25 tbn
 }}}

 For example image 1800x1200 with orientation 90, should report resolution
 1200x1800.

 Following are the main reasons:

 1. when such media is being loaded and encoded the output has the correct
 resolution `ffmpeg -i input.jpg -y output.png` will change from reported
 1800x1200 to 1200x1800 (confusing).

 {{{
 Input #0, image2, from 'input.jpg':
   Duration: 00:00:00.04, start: 0.000000, bitrate: 50360 kb/s
   Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
 bt470bg/unknown/unknown), 1800x1200 [SAR 72:72 DAR 3:2], 25 fps, 25 tbr,
 25 tbn
 ...
 Output #0, image2, to 'output.png':
   Metadata:
     encoder         : Lavf59.34.101
   Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown, progressive),
 1200x1800 [SAR 1:1 DAR 2:3], q=2-31, 200 kb/s, 2
 }}}

 2. Any software (photoshop, chrome, ...) that opens JPEG with orientation
 will report resolution following the orientation metadata.

 3. The resolution information without orientation respected has no real
 life use for end user I can think of.

 4. Correct me if I am wrong, but it seems impossible to extract
 orientation information using `ffmpeg` executable, the only way I managed
 to discover is to use `ffprobe -show_frames` and parse SIDE_DATA

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


More information about the FFmpeg-trac mailing list