Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#156 closed defect (fixed)

Full HD Material from Canon 5D treated as 1920x1088

Reported by: rmk Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Full HD material from the Canon 5D is detected and treated as 1920x1088 resulting in a black padding of 8 pixels at the bottom when played or transcoded. Both Quicktime and Mediainfo report the display size as 1920x1080.

Since I do not have access to that camera I cannot upload a file but material is publicly available, e.g. here:

http://www.dpreview.com/reviews/canoneos5dmarkii/page19.asp

Mediainfo output for the video track of a sample file:

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : Baseline@L5.0
Format settings, CABAC           : No
Format settings, ReFrames        : 1 frame
Codec ID                         : avc1
Codec ID/Info                    : Advanced Video Coding
Duration                         : 28s 700ms
Bit rate mode                    : Variable
Bit rate                         : 39.1 Mbps
Width                            : 1 920 pixels
Height                           : 1 080 pixels
Original height                  : 1 088 pixels
Display aspect ratio             : 16:9
Frame rate mode                  : Constant
Frame rate                       : 30.000 fps
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.629
Stream size                      : 134 MiB (97%)
Language                         : English
Encoded date                     : UTC 2009-06-18 12:26:06
Tagged date                      : UTC 2009-06-18 12:26:06
Color primaries                  : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics         : BT.709-5, BT.1361
Matrix coefficients              : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M

Change History (8)

comment:1 by Carl Eugen Hoyos, 13 years ago

Status: newopen

Complete, uncut, verbose output of ffmpeg missing.

(Apart from the fact that Mediainfo clearly reports 1088 pixels, afaict.)

comment:2 by rmk, 13 years ago

You're right, here it is:

ffmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers

built on May 5 2011 11:07:13 with gcc 4.2.1 (Apple Inc. build 5664)
configuration: --enable-gpl --enable-nonfree --enable-libx264 --enable-libfaac --enable-libmp3lame
libavutil 51. 2. 0 / 51. 2. 0
libavcodec 53. 3. 0 / 53. 3. 0
libavformat 53. 0. 3 / 53. 0. 3
libavdevice 53. 0. 0 / 53. 0. 0
libavfilter 2. 4. 0 / 2. 4. 0
libswscale 0. 14. 0 / 0. 14. 0

Seems stream 0 codec frame rate differs from container frame rate: 6000.00 (6000/1) -> 30.00 (30/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/krueger/testdata/video/canon-5dm2/3775850.mov':

Metadata:

major_brand : qt
minor_version : 537331968
compatible_brands: qt CAEP
creation_time : 2009-06-18 12:26:06

Duration: 00:00:28.70, start: 0.000000, bitrate: 40535 kb/s

Stream #0.0(eng): Video: h264 (Constrained Baseline), yuvj420p, 1920x1088, 39121 kb/s, 30 fps, 30 tbr, 3k tbn, 6k tbc
Metadata:

creation_time : 2009-06-18 12:26:06

Stream #0.1(eng): Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
Metadata:

creation_time : 2009-06-18 12:26:06

At least one output file must be specified

Regarding Mediainfo output, you saw both lines?

Height : 1 080 pixels
Original height : 1 088 pixels

Shall I send a screenshot that displays the Quicktime media inspector displaying 1080?


comment:3 by Carl Eugen Hoyos, 13 years ago

I was unable to find a sample for this ticket, could you make one available?

comment:4 by ami_stuff, 13 years ago

I found this:

http://img.photographyblog.com/reviews/canon_eos_5d_mark_ii/sample_images/canon_eos_5d_mark_ii_01.mov

C:\>ffmpeg -i C:\canon_eos_5d_mark_ii_01.mov
ffmpeg version N-32077-g5f5e37e, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 24 2011 02:29:36 with gcc 4.5.0 20100414 (Fedora MinGW 4.5.0-1.fc
14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapshots/buil
d/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/snapshots/b
uild/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --enable-n
onfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-libopencor
e-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil    51. 13. 0 / 51. 13. 0
  libavcodec   53. 12. 0 / 53. 12. 0
  libavformat  53.  9. 0 / 53.  9. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 34. 2 /  2. 34. 2
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0

Seems stream 0 codec frame rate differs from container frame rate: 6000.00 (6000
/1) -> 30.00 (30/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\canon_eos_5d_mark_ii_01.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2008-12-03 14:26:49
  Duration: 00:00:05.46, start: 0.000000, bitrate: 41551 kb/s
    Stream #0.0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yu
vj420p, 1920x1088, 40136 kb/s, 30 fps, 30 tbr, 3k tbn, 6k tbc
    Metadata:
      creation_time   : 2008-12-03 14:26:49
    Stream #0.1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, 2 channels
, s16, 1411 kb/s
    Metadata:
      creation_time   : 2008-12-03 14:26:49
At least one output file must be specified

comment:5 by reimar, 13 years ago

While the mov headers specify 1920x1080, the SPS specifies a size of 1920x1088.
I sent a hackish patch that avoids the issue, however it is questionable and the file could probably be considered broken - not to mention that it can be non-obvious which should be used.

comment:6 by yellow, 12 years ago

As far as I've tested Quicktime crops bottom 8.

Although Canon 5D MKII appears to have 8 rows of black this is not the case for the other cameras in the range which are also 1088 h264 AVC in a mov container, they actually have 8 rows of image data. Easy to see comparison of a QT decoded 1088 frame and a ffmpeg decoded frame overlaid in Gimp for example will show QT crops 8 off, ffmpeg gives full 1088 lines of usable image data, no so called black padding not surprising since there is more than enough data coming off the 18MP camera sensor, even line skipped without the need to add black padding. ;-) Why the 5D does black is odd.

What does appear suspect with the Canon movs is that ffmpeg treats them as yuvj420 not yuv420 so when transcoding to say lossless huffyuv the full range luma levels in the original camera file are squeezed into 16 - 235 unless the movs are first remuxed to something like mkv.

comment:7 by Michael Niedermayer, 12 years ago

Reproduced by developer: set
Resolution: fixed
Status: openclosed

comment:8 by Roger Pack, 11 years ago

@yellow could you elaborate on yuvj420 vs yuv420? Is this still a concern?

Note: See TracTickets for help on using tickets.