Opened 11 years ago

Closed 14 months ago

#4489 closed enhancement (fixed)

mkv cropping

Reported by: Carl Eugen Hoyos Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords: videolan mkv cropping
Cc: nfxjfg@googlemail.com, dave@dericed.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

(videolan ticket 13982)

I will attach a sample that has cropping defined in its mkv headers.

$ ffmpeg -i Matroska\ Crop_cut.mkv
ffmpeg version N-71483-g8768f8f Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      54. 22.101 / 54. 22.101
  libavcodec     56. 34.100 / 56. 34.100
  libavformat    56. 30.100 / 56. 30.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, matroska,webm, from 'Matroska Crop_cut.mkv':
  Metadata:
    encoder         : libebml v1.2.2 + libmatroska v1.3.0
    creation_time   : 2012-08-03 22:48:21
  Duration: 00:03:42.12, start: 0.000000, bitrate: 92 kb/s
    Stream #0:0(eng): Audio: aac (LC), 44100 Hz, stereo, fltp (default)
    Stream #0:1: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
At least one output file must be specified

Attachments (1)

Matroska Crop_cut.mkv (2.4 MB ) - added by Carl Eugen Hoyos 11 years ago.

Change History (8)

by Carl Eugen Hoyos, 11 years ago

Attachment: Matroska Crop_cut.mkv added

comment:1 by gjdfgh, 11 years ago

Cc: nfxjfg@googlemail.com added

This is impossible to implement correctly without adding cropping hints to AVFrame. (Think about hardware decoding.)

comment:2 by dave rice, 10 years ago

Adding another sample file. This mkv uses a PixelCropLeft and PixelCropRight of 240 on each side. http://archive.org/download/BBC_Top_of_the_Pops_1979_12_25/BBC_Top_of_the_Pops_1979_12_25.mkv to mask pillarboxing (the pillarboxing doesn't actually start until about 30 seconds in).

comment:3 by dave rice, 10 years ago

Cc: dave@dericed.com added

comment:4 by kieranjol, 8 years ago

comment:5 by dave rice, 21 months ago

seems like https://trac.ffmpeg.org/ticket/7437 was closed as cropped via the clap atom was implemented in mov. Would love to see this cropping support in mkv too. :D

comment:6 by Bobby Bingham, 14 months ago

This was fixed in https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/79e8e980c241da6f86a2cf80f570f7af52d36fbc

$ ffmpeg -i Matroska\ Crop_cut.mkv
ffmpeg version N-118903-g4b18bc50a6 Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 14 (Gentoo 14.2.1_p20250301 p8)
  configuration: --enable-libcdio --enable-libdvdnav --enable-libdvdread --enable-libbluray --enable-libdav1d --enable-libsvtav1 --enable-libx264 --enable-libx265 --enable-libopus --enable-gpl
  libavutil      59. 60.100 / 59. 60.100
  libavcodec     61. 33.102 / 61. 33.102
  libavformat    61.  9.107 / 61.  9.107
  libavdevice    61.  4.100 / 61.  4.100
  libavfilter    10.  9.100 / 10.  9.100
  libswscale      8. 13.103 /  8. 13.103
  libswresample   5.  4.100 /  5.  4.100
  libpostproc    58.  4.100 / 58.  4.100
Input #0, matroska,webm, from 'Matroska Crop_cut.mkv':
  Metadata:
    encoder         : libebml v1.2.2 + libmatroska v1.3.0
    creation_time   : 2012-08-03T22:48:21.000000Z
  Duration: 00:03:42.12, start: 0.000000, bitrate: 92 kb/s
  Stream #0:0(eng): Audio: aac (LC), 44100 Hz, stereo, fltp (default)
  Stream #0:1: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], SAR 1088:1053 DAR 17408:9477, 29.97 fps, 29.97 tbr, 1k tbn (default)
    Side data:
      Frame cropping: 164/180/86/90
At least one output file must be specified

comment:7 by Bobby Bingham, 14 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.