Opened 5 years ago

Closed 5 years ago

#348 closed defect (fixed)

Disable cropping for large values

Reported by: cehoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

http://thread.gmane.org/gmane.comp.video.ffmpeg.libav.user/6639
Attached file contains both parts of a 1280x720 3D frame in one 1920x1088 frame ("Sisvel 3D"). Cropping values are set to produce a 2D 720p frame, but current FFmpeg crops a few columns and lines (so an application could not recreate the whole 3D frame). Attached patch disables cropping for the "brainfart" case.

$ ffmpeg -i sisvel3D.ts
ffmpeg version N-31438-g6b61920, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 14 2011 00:39:27 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc --enable-gpl --enable-libopencore-amrnb --enable-version3
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  7. 0 / 53.  7. 0
  libavformat  53.  5. 0 / 53.  5. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 25. 0 /  2. 25. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[h264 @ 0x12d6540] brainfart cropping not supported, this could look slightly wrong ...
    Last message repeated 1 times
[h264 @ 0x12d4420] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (50/2)
Input #0, h264, from 'sisvel3D.ts':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264 (High), yuv420p, 1906x1074, 25 fps, 25 tbr, 1200k tbn, 50 tbc
At least one output file must be specified
$ ffmpeg -i sisvel3D.ts
ffmpeg version N-31438-g6b61920, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 14 2011 00:39:27 with gcc 4.5.3
  configuration: --cc=/usr/local/gcc-4.5.3/bin/gcc --enable-gpl --enable-libopencore-amrnb --enable-version3
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  7. 0 / 53.  7. 0
  libavformat  53.  5. 0 / 53.  5. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 25. 0 /  2. 25. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[h264 @ 0x12d6540] brainfart cropping (right: 320, bottom: 184) not supported, disabling cropping.
    Last message repeated 1 times
[h264 @ 0x12d4420] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (50/2)
Input #0, h264, from 'sisvel3D.ts':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264 (High), yuv420p, 1920x1088, 25 fps, 25 tbr, 1200k tbn, 50 tbc
At least one output file must be specified

Attachments (3)

patchsisvel3D.diff (897 bytes) - added by cehoyos 5 years ago.
sisvel3D.ts (419.0 KB) - added by cehoyos 5 years ago.
patchsisvel3Dnew.diff (666 bytes) - added by cehoyos 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by cehoyos

Changed 5 years ago by cehoyos

Changed 5 years ago by cehoyos

comment:1 Changed 5 years ago by reimar

I think partial cropping is a bad idea, it will never make anyone happy.
However the patch probably should add a comment to the code as to why, explaining e.g. this use case.

comment:2 Changed 5 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed

Cropping is now disabled in the brainfart case.

If FFmpeg supports arbitrary cropping, this will still be a valid solution for the sample (it does request the cropping after all), it should be possible to disable automatic cropping for users who need the full resolution.

Note: See TracTickets for help on using tickets.