five82 / batchtranscode

GNU General Public License v2.0
2 stars 1 forks source link

Crop detect rewrite #19

Closed five82 closed 5 years ago

five82 commented 5 years ago

Add crop detect verification so bad crop values are not used. Get rid of cropscanstart, cropscanlength, and fallback values so the end user won't have to manage them. Scan at timestamps that are determined by "percentage of video complete" so we can easily handle both shorter and longer videos.

five82 commented 5 years ago

Run multiple passes at different times and compare. Each pass is 10 seconds. If the majority of the values match, verification passes.

Two of our three or three out of five.

25%, 50%, 75%

15%, 30%, 45%, 60%, 75%

five82 commented 5 years ago

FFmpeg cropdetect for HDR also needs to be fixed. The current approach of changing black levels from 24 to 150 is flawed and causes inaccurate results from cropdelect, especially with darker videos.

Two possible approaches to fix:

  1. Properly transcode the video to HDR so black levels are maintained.
  2. Properly transcode the video to SDR so black levels are maintained.

Edit: I used approach 2 since ffmpeg's cropdetect wasn't able to property detect black bars with HDR video.

five82 commented 5 years ago

Implemented with commit f2de47e1964cd8f76e8906122979cce0e5c3fb81