#9542: FFprobe doesn't get exif metadata
------------------------------------+--------------------------------------
             Reporter:  Aightt      |                     Type:  defect
               Status:  new         |                 Priority:  normal
            Component:  ffprobe     |                  Version:  git-master
             Keywords:  mjpeg exif  |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+--------------------------------------
 Hello,

 Summary of the bug:
 Since this commit
 
(https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/e93c9986027d17917c3b4f533b28ee4a2ce7cd4c),
 the mpjeg decoder detect the rotation in the exif metadata and
 automatically rotate the frames. But unfortunately when analyzing the same
 file with ffprobe, we don't get the rotate information.


 How to reproduce:
 {{{
 % ffprobe -i input -of json -show_streams -show_format
 ffprobe / ffmpeg built from master
 built on debian
 }}}
 Result:
 {{{
 {
 Input #0, jpeg_pipe, from '036538dd-700c-4884-9bf4-da1f4d85baed':
   Duration: N/A, bitrate: N/A
   Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
 bt470bg/unknown/unknown), 1280x960 [SAR 72:72 DAR 4:3], 25 fps, 25 tbr, 25
 tbn
     "streams": [
         {
             "index": 0,
             "codec_name": "mjpeg",
             "codec_long_name": "Motion JPEG",
             "profile": "Baseline",
             "codec_type": "video",
             "codec_tag_string": "[0][0][0][0]",
             "codec_tag": "0x0000",
             "width": 1280,
             "height": 960,
             "coded_width": 1280,
             "coded_height": 960,
             "closed_captions": 0,
             "film_grain": 0,
             "has_b_frames": 0,
             "sample_aspect_ratio": "1:1",
             "display_aspect_ratio": "4:3",
             "pix_fmt": "yuvj420p",
             "level": -99,
             "color_range": "pc",
             "color_space": "bt470bg",
             "chroma_location": "center",
             "refs": 1,
             "r_frame_rate": "25/1",
             "avg_frame_rate": "25/1",
             "time_base": "1/25",
             "bits_per_raw_sample": "8",
             "disposition": {
                 "default": 0,
                 "dub": 0,
                 "original": 0,
                 "comment": 0,
                 "lyrics": 0,
                 "karaoke": 0,
                 "forced": 0,
                 "hearing_impaired": 0,
                 "visual_impaired": 0,
                 "clean_effects": 0,
                 "attached_pic": 0,
                 "timed_thumbnails": 0,
                 "captions": 0,
                 "descriptions": 0,
                 "metadata": 0,
                 "dependent": 0,
                 "still_image": 0
             }
         }
     ],
     "format": {
         "filename": "036538dd-700c-4884-9bf4-da1f4d85baed",
         "nb_streams": 1,
         "nb_programs": 0,
         "format_name": "jpeg_pipe",
         "format_long_name": "piped jpeg sequence",
         "size": "272927",
         "probe_score": 26
     }
 }
 }}}
 We can see there is no informations about the rotate metadata.
 But when reencoding:
 {{{
 ffmpeg -y -loop 1 -t 5 -f image2 -i input output.mp4
 ffprobe -i output.mp4 -of json -show_streams -show_format
 }}}
 Result:
 {{{
 {
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2avc1mp41
     encoder         : Lavf59.9.102
   Duration: 00:00:05.00, start: 0.000000, bitrate: 351 kb/s
   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661),
 yuvj420p(pc, bt470bg/unknown/unknown, progressive), 960x1280 [SAR 1:1 DAR
 3:4], 347 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
     "streams": [
         {
             "index": 0,
             "codec_name": "h264",
             "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part
 10",
             "profile": "High",
             "codec_type": "video",
             "codec_tag_string": "avc1",
             "codec_tag": "0x31637661",
             "width": 960,
             "height": 1280,
             "coded_width": 960,
             "coded_height": 1280,
             "closed_captions": 0,
             "film_grain": 0,
             "has_b_frames": 2,
             "sample_aspect_ratio": "1:1",
             "display_aspect_ratio": "3:4",
             "pix_fmt": "yuvj420p",
             "level": 32,
             "color_range": "pc",
             "color_space": "bt470bg",
             "chroma_location": "center",
             "field_order": "progressive",
             "refs": 1,
             "is_avc": "true",
             "nal_length_size": "4",
             "id": "0x1",
             "r_frame_rate": "25/1",
             "avg_frame_rate": "25/1",
             "time_base": "1/12800",
             "start_pts": 0,
             "start_time": "0.000000",
             "duration_ts": 64000,
             "duration": "5.000000",
             "bit_rate": "347878",
             "bits_per_raw_sample": "8",
             "nb_frames": "125",
             "extradata_size": 51,
             "disposition": {
                 "default": 1,
                 "dub": 0,
                 "original": 0,
                 "comment": 0,
                 "lyrics": 0,
                 "karaoke": 0,
                 "forced": 0,
                 "hearing_impaired": 0,
                 "visual_impaired": 0,
                 "clean_effects": 0,
                 "attached_pic": 0,
                 "timed_thumbnails": 0,
                 "captions": 0,
                 "descriptions": 0,
                 "metadata": 0,
                 "dependent": 0,
                 "still_image": 0
             },
             "tags": {
                 "language": "und",
                 "handler_name": "VideoHandler",
                 "vendor_id": "[0][0][0][0]"
             }
         }
     ],
     "format": {
         "filename": "output.mp4",
         "nb_streams": 1,
         "nb_programs": 0,
         "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
         "format_long_name": "QuickTime / MOV",
         "start_time": "0.000000",
         "duration": "5.000000",
         "size": "219803",
         "bit_rate": "351684",
         "probe_score": 100,
         "tags": {
             "major_brand": "isom",
             "minor_version": "512",
             "compatible_brands": "isomiso2avc1mp41",
             "encoder": "Lavf59.9.102"
         }
     }
 }
 }}}
 We can see the resolution is not the same in output because the mjpeg
 decoder automatically rotate the frame.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9542>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
ffmpeg-trac-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to