lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

detect-crop: invalid byte sequence in UTF-8 #247

Closed BDaddyG closed 5 years ago

BDaddyG commented 5 years ago

Hello

I have run into an issue where --crop detect and the detect-crop tool are failing with error Invalid byte sequence in UTF-8

Reading through other similar issues I see that you request the following to help troubleshoot:

Output of detect-crop --scan

ffmpeg version: 3.4.4-0ubuntu0.18.04.1

MediaInfo output:

General Unique ID : 213572251583476125320549392133108706377 (0xA0AC84FB6D7D1DBB5EEF2B4B5D76AC49) Complete name : Cannon S05E01.mkv Format : Matroska Format version : Version 2 File size : 1.83 GiB Duration : 50 min 23 s Overall bit rate mode : Variable Overall bit rate : 5 191 kb/s Movie name : Cannon S05E01 Encoded date : UTC 2019-01-26 23:14:45 Writing application : MakeMKV v1.14.2 linux(x64-release) Writing library : libmakemkv v1.14.2 (1.3.5/1.4.7) x86_64-linux-gnu

Video ID : 1 ID in the original source medium : 224 (0xE0) Format : MPEG Video Format version : Version 2 Format profile : Main@Main Format settings : BVOP Format settings, BVOP : Yes Format settings, Matrix : Default Format settings, GOP : M=3, N=15 Codec ID : V_MPEG2 Codec ID/Info : MPEG 1 or 2 Video Duration : 50 min 23 s Bit rate mode : Variable Bit rate : 4 993 kb/s Maximum bit rate : 9 500 kb/s Width : 720 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate mode : Constant Frame rate : 29.970 (30000/1001) FPS Standard : NTSC Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.482 Time code of first frame : 00:00:00:00 Time code source : Group of pictures header GOP, Open/Closed : Closed Stream size : 1.76 GiB (96%) Language : English Default : No Forced : No Original source medium : DVD-Video

Audio ID : 2 ID in the original source medium : 189 (0xBD)128 (0x80) Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 50 min 23 s Bit rate mode : Constant Bit rate : 192 kb/s Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 SPF) Bit depth : 16 bits Compression mode : Lossy Stream size : 69.2 MiB (4%) Title : Stereo Service kind : Complete Main Default : Yes Forced : No Original source medium : DVD-Video

Menu 00:00:00.066 : en:Chapter 01 00:10:49.315 : en:Chapter 02 00:20:54.119 : en:Chapter 03 00:30:15.280 : en:Chapter 04 00:40:43.007 : en:Chapter 05 00:50:07.371 : en:Chapter 06

This issue is happening with all files from this DVD season of the show. Files from another DVD season worked fine.

Differences between seasons: Non-working:

Working:

Thanks for any help!

samhutchins commented 5 years ago

@donmelton I'm not sure what the issue is, I'd guess it's something to do with that Unknown (AC3) audio track?

lisamelton commented 5 years ago

@BDaddyG First, let me apologize for not responding to your issue sooner. I am so sorry. For some strange reason I didn't get a notification from GitHub when you submitted it. And then it disappeared from my list of issues. If it wasn't for the always-helpful @samhutchins, I wouldn't have even known about it at all, much less know that it had suddenly re-appeared.

Again, my apologies, sir.

Now, to your issue...

We need to isolate the invalid byte sequence in UTF-8 error you're seeing to determine whether it's coming from HandBrakeCLI, ffmpeg or the Ruby runtime since detect-crop itself doesn't have a diagnostic message like that.

Can you include as a comment or attach as a text file the entire progress and error output from detect-crop -vv Cannon S05E01.mkv here?

Thanks!

BDaddyG commented 5 years ago

@samhutchins Thanks for the thoughts about Unknown (AC3) ... that was my thinking also as I don't think missing subtitles would be a factor.

@donmelton Absolutely no worries! The issue with the disappearing message was that the GitHub bot flagged my account. It took a few days for the GitHub staff to remove the flag and make my post viewable to the public again.

Here is the output from detect-crop -vv Cannon S05E01.mkv. Looks like it's faulting with ffmpeg, right? Thanks so much for your help and thoughts!

detect-crop -vv Cannon\ S05E01.mkv detect-crop 0.22.0 Copyright (c) 2013-2018 Don Melton Processing: Cannon S05E01.mkv... Scanning media title 1 with HandBrakeCLI... HandBrake 1.2.0 found... Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 [19:38:30] hb_init: starting libhb thread [19:38:30] thread 7fbcfe216700 started ("libhb") HandBrake 1.2.0 (2018122200) - Linux x86_64 - https://handbrake.fr 4 CPUs detected Opening Cannon S05E01.mkv... [19:38:30] CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz [19:38:30] - Intel microarchitecture Ivy Bridge [19:38:30] - logical processor count: 4 [19:38:30] hb_scan: path=Cannon S05E01.mkv, title_index=1 udfread ERROR: ECMA 167 Volume Recognition failed disc.c:323: failed opening UDF image Cannon S05E01.mkv disc.c:424: error opening file BDMV/index.bdmv disc.c:424: error opening file BDMV/BACKUP/index.bdmv [19:38:30] bd: not a bd - trying as a stream/file instead libdvdnav: Using dvdnav version 6.0.0 libdvdread: Encrypted DVD support unavailable. libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed libdvdread: Can't open file VIDEO_TS.IFO. libdvdnav: vm: failed to read VIDEO_TS.IFO [19:38:30] dvd: not a dvd - trying as a stream/file instead Input #0, matroska,webm, from 'Cannon S05E01.mkv': Metadata: title : Cannon S05E01 encoder : libmakemkv v1.14.2 (1.3.5/1.4.7) x86_64-linux-gnu creation_time : 2019-01-26T23:14:45.000000Z Duration: 00:50:23.39, start: 0.000000, bitrate: 5190 kb/s Chapter #0:0: start 0.066733, end 649.315333 Metadata: title : Chapter 01 Chapter #0:1: start 649.315333, end 1254.119533 Metadata: title : Chapter 02 Chapter #0:2: start 1254.119533, end 1815.280133 Metadata: title : Chapter 03 Chapter #0:3: start 1815.280133, end 2443.007233 Metadata: title : Chapter 04 Chapter #0:4: start 2443.007233, end 3007.371033 Metadata: title : Chapter 05 Chapter #0:5: start 3007.371033, end 3023.392000 Metadata: title : Chapter 06 Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc Metadata: BPS-eng : 4992877 DURATION-eng : 00:50:23.387033333 NUMBER_OF_FRAMES-eng: 90611 NUMBER_OF_BYTES-eng: 1886925220 SOURCE_ID-eng : 0100E0 _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 linux(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-01-26 23:14:45 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID Stream #0:1(): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: title : Stereo BPS-eng : 192000 DURATION-eng : 00:50:23.392000000 NUMBER_OF_FRAMES-eng: 94481 NUMBER_OF_BYTES-eng: 72561408 SOURCE_ID-eng : 0180BD _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 linux(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-01-26 23:14:45 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID [19:38:30] scan: decoding previews for title 1 [19:38:30] scan: audio 0x1: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) [19:38:30] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/10/6, aspect 4:3, PAR 8:9 [19:38:30] libhb: scan thread found 1 valid title(s)

{:title=>1, :size=>1961677039, :directory=>false, :duration=>3023, :width=>720, :height=>480, :fps=>29.97, :autocrop=>{:top=>0, :bottom=>0, :left=>10, :right=>6}} Detecting crop with ffmpeg... ffmpeg version 3.4.4-0ubuntu0.18.04.1 found... /usr/local/rvm/gems/ruby-2.5.3/bin/detect-crop: invalid byte sequence in UTF-8

lisamelton commented 5 years ago

@BDaddyG I'm glad you got the GitHub issue worked out! 'Bots! They were bound to turn on us. I mean, seriously, we've all seen "The Terminator," right? :)

Anyway, I'm starting to believe @samhutchins is even more of a genius than I thought.

Yes, it's ffmpeg that appears to be failing. Probably on that Unknown (AC3) audio track as Sam guessed, but I think that's because 3.4.4 is a really old version of ffmpeg. Which is something I should have noticed before. Apologies!

The current version of ffmpeg is 4.1. Your version is over two years old. The libAV library from FFmpeg that HandBrake includes is a very recent version, from late last year. Which is probably why HandBrake is not barfing on that audio track.

So, my recommendation is to upgrade your version of ffmpeg and see if that fixes the problem. Is that easy or even possible on Ubuntu?

BDaddyG commented 5 years ago

@donmelton

I'm using Ubuntu Server 18.04. I found a PPA that allows for the installation of ffmpeg 4.1 and have updated to that version. Unfortunately no luck. Here is the new output from detect-crop -vv:

detect-crop 0.22.0 Copyright (c) 2013-2018 Don Melton Processing: Cannon S05E01.mkv... Scanning media title 1 with HandBrakeCLI... HandBrake 1.2.0 found... Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 [22:17:15] hb_init: starting libhb thread [22:17:15] thread 7f7bb2721700 started ("libhb") HandBrake 1.2.0 (2018122200) - Linux x86_64 - https://handbrake.fr 4 CPUs detected Opening Cannon S05E01.mkv... [22:17:15] CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz [22:17:15] - Intel microarchitecture Ivy Bridge [22:17:15] - logical processor count: 4 [22:17:15] hb_scan: path=Cannon S05E01.mkv, title_index=1 udfread ERROR: ECMA 167 Volume Recognition failed disc.c:323: failed opening UDF image Cannon S05E01.mkv disc.c:424: error opening file BDMV/index.bdmv disc.c:424: error opening file BDMV/BACKUP/index.bdmv [22:17:15] bd: not a bd - trying as a stream/file instead libdvdnav: Using dvdnav version 6.0.0 libdvdread: Encrypted DVD support unavailable. libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed libdvdread: Can't open file VIDEO_TS.IFO. libdvdnav: vm: failed to read VIDEO_TS.IFO [22:17:15] dvd: not a dvd - trying as a stream/file instead Input #0, matroska,webm, from 'Cannon S05E01.mkv': Metadata: title : Cannon S05E01 encoder : libmakemkv v1.14.2 (1.3.5/1.4.7) x86_64-linux-gnu creation_time : 2019-01-26T23:14:45.000000Z Duration: 00:50:23.39, start: 0.000000, bitrate: 5190 kb/s Chapter #0:0: start 0.066733, end 649.315333 Metadata: title : Chapter 01 Chapter #0:1: start 649.315333, end 1254.119533 Metadata: title : Chapter 02 Chapter #0:2: start 1254.119533, end 1815.280133 Metadata: title : Chapter 03 Chapter #0:3: start 1815.280133, end 2443.007233 Metadata: title : Chapter 04 Chapter #0:4: start 2443.007233, end 3007.371033 Metadata: title : Chapter 05 Chapter #0:5: start 3007.371033, end 3023.392000 Metadata: title : Chapter 06 Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc Metadata: BPS-eng : 4992877 DURATION-eng : 00:50:23.387033333 NUMBER_OF_FRAMES-eng: 90611 NUMBER_OF_BYTES-eng: 1886925220 SOURCE_ID-eng : 0100E0 _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 linux(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-01-26 23:14:45 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID Stream #0:1(): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: title : Stereo BPS-eng : 192000 DURATION-eng : 00:50:23.392000000 NUMBER_OF_FRAMES-eng: 94481 NUMBER_OF_BYTES-eng: 72561408 SOURCE_ID-eng : 0180BD _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 linux(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-01-26 23:14:45 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID [22:17:15] scan: decoding previews for title 1 [22:17:15] scan: audio 0x1: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) [22:17:15] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/10/6, aspect 4:3, PAR 8:9 [22:17:15] libhb: scan thread found 1 valid title(s)

{:title=>1, :size=>1961677039, :directory=>false, :duration=>3023, :width=>720, :height=>480, :fps=>29.97, :autocrop=>{:top=>0, :bottom=>0, :left=>10, :right=>6}} Detecting crop with ffmpeg... ffmpeg version 4.1-1~18.04.york0 found... /usr/local/rvm/gems/ruby-2.5.3/bin/detect-crop: invalid byte sequence in UTF-8

lisamelton commented 5 years ago

@BDaddyG Dang! I was hoping that was it. :(

I've been looking into it more while you were doing the hard work of upgrading and I now suspect the error is being generated from within the Ruby runtime. This is because it matches an error message within that code.

It's possible that ffmpeg is returning some bogus character data when I call its cropdetect filter. And then Ruby barfs when I apply a regular expression to parse that output.

In the past, I've had to put in workarounds for similar problems with the output from HandBrakeCLI. I suppose I could do that again here. But I'm not certain that would fix the problem.

Are you comfortable with patching your own copy of my code? If so, I can send you a "fix" you can insert to test if whether that solves the problem.

lisamelton commented 5 years ago

@BDaddyG BTW, if you're not comfortable applying a patch yourself, I can land this change I'm talking about as a "prescriptive fix" and release it next week when I plan to roll out some other new features.

BDaddyG commented 5 years ago

@donmelton I'm willing to give the patch a try.. it's been a long time since I done something like that and it could be a fun trip down memory lane :-)

lisamelton commented 5 years ago

@BDaddyG OK, here's the patch:

diff --git a/lib/video_transcoding/crop.rb b/lib/video_transcoding/crop.rb
index 7183a37..816b116 100644
--- a/lib/video_transcoding/crop.rb
+++ b/lib/video_transcoding/crop.rb
@@ -51,6 +51,8 @@ module VideoTranscoding
                 last_seconds = seconds
               end

+              line.encode! 'UTF-8', 'binary', invalid: :replace, undef: :replace, replace: ''
+
               if line =~ / crop=([0-9]+):([0-9]+):([0-9]+):([0-9]+)$/
                 d_width, d_height, d_x, d_y = $1.to_i, $2.to_i, $3.to_i, $4.to_i
                 crop_width  = d_width   if crop_width   < d_width

Obviously make a copy of the installed video_transcoding Gem before you apply this. :) And since it's only a two-line addition, it might be easier to just open the lib/video_transcoding/crop.rb file in an editor and insert the text starting with line.encode! in the code.

I'll be AFK most of today but I'll check back here by sometime mid-afternoon. Good luck!

BDaddyG commented 5 years ago

@donmelton That did it! Thanks so much! Here is the output of detect-crop -vv:

detect-crop -vv Cannon\ S05E01.mkv detect-crop 0.22.0 Copyright (c) 2013-2018 Don Melton Processing: Cannon S05E01.mkv... Scanning media title 1 with HandBrakeCLI... HandBrake 1.2.0 found... Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 Cannot load libnvidia-encode.so.1 [10:19:57] hb_init: starting libhb thread [10:19:57] thread 7fdf5eac7700 started ("libhb") HandBrake 1.2.0 (2018122200) - Linux x86_64 - https://handbrake.fr 4 CPUs detected Opening Cannon S05E01.mkv... [10:19:57] CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz [10:19:57] - Intel microarchitecture Ivy Bridge [10:19:57] - logical processor count: 4 [10:19:57] hb_scan: path=Cannon S05E01.mkv, title_index=1 udfread ERROR: ECMA 167 Volume Recognition failed disc.c:323: failed opening UDF image Cannon S05E01.mkv disc.c:424: error opening file BDMV/index.bdmv disc.c:424: error opening file BDMV/BACKUP/index.bdmv [10:19:57] bd: not a bd - trying as a stream/file instead libdvdnav: Using dvdnav version 6.0.0 libdvdread: Encrypted DVD support unavailable. libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed libdvdread: Can't open file VIDEO_TS.IFO. libdvdnav: vm: failed to read VIDEO_TS.IFO [10:19:57] dvd: not a dvd - trying as a stream/file instead Input #0, matroska,webm, from 'Cannon S05E01.mkv': Metadata: title : Cannon S05E01 encoder : libmakemkv v1.14.2 (1.3.5/1.4.7) x86_64-linux-gnu creation_time : 2019-01-26T23:14:45.000000Z Duration: 00:50:23.39, start: 0.000000, bitrate: 5190 kb/s Chapter #0:0: start 0.066733, end 649.315333 Metadata: title : Chapter 01 Chapter #0:1: start 649.315333, end 1254.119533 Metadata: title : Chapter 02 Chapter #0:2: start 1254.119533, end 1815.280133 Metadata: title : Chapter 03 Chapter #0:3: start 1815.280133, end 2443.007233 Metadata: title : Chapter 04 Chapter #0:4: start 2443.007233, end 3007.371033 Metadata: title : Chapter 05 Chapter #0:5: start 3007.371033, end 3023.392000 Metadata: title : Chapter 06 Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc Metadata: BPS-eng : 4992877 DURATION-eng : 00:50:23.387033333 NUMBER_OF_FRAMES-eng: 90611 NUMBER_OF_BYTES-eng: 1886925220 SOURCE_ID-eng : 0100E0 _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 linux(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-01-26 23:14:45 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID Stream #0:1(): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: title : Stereo BPS-eng : 192000 DURATION-eng : 00:50:23.392000000 NUMBER_OF_FRAMES-eng: 94481 NUMBER_OF_BYTES-eng: 72561408 SOURCE_ID-eng : 0180BD _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.2 linux(x64-release) _STATISTICS_WRITING_DATE_UTC-eng: 2019-01-26 23:14:45 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID [10:19:57] scan: decoding previews for title 1 [10:19:57] scan: audio 0x1: ac3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch) [10:19:57] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/10/6, aspect 4:3, PAR 8:9 [10:19:57] libhb: scan thread found 1 valid title(s)

{:title=>1, :size=>1961677039, :directory=>false, :duration=>3023, :width=>720, :height=>480, :fps=>29.97, :autocrop=>{:top=>0, :bottom=>0, :left=>10, :right=>6}} Detecting crop with ffmpeg... ffmpeg version 4.1-1~18.04.york0 found... [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-160 t:-0.160000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-126 t:-0.126000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-93 t:-0.093000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-60 t:-0.060000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-26 t:-0.026000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:7 t:0.007000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:40 t:0.040000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:74 t:0.074000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x56094a788e80] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:141 t:0.141000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-386 t:-0.386000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-353 t:-0.353000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-320 t:-0.320000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-286 t:-0.286000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-253 t:-0.253000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-219 t:-0.219000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-186 t:-0.186000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-153 t:-0.153000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x5601bc0a4980] x1:11 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-86 t:-0.086000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-513 t:-0.513000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-479 t:-0.479000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-446 t:-0.446000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-413 t:-0.413000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-379 t:-0.379000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-346 t:-0.346000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-312 t:-0.312000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-279 t:-0.279000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55fa24674b00] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-212 t:-0.212000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-239 t:-0.239000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-205 t:-0.205000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-172 t:-0.172000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-139 t:-0.139000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-105 t:-0.105000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-72 t:-0.072000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-38 t:-0.038000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-5 t:-0.005000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x5601318825c0] x1:10 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:62 t:0.062000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:173 x2:486 y1:94 y2:432 w:312 h:338 x:174 y:94 pts:-265 t:-0.265000 crop=312:338:174:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:172 x2:487 y1:94 y2:432 w:316 h:338 x:172 y:94 pts:-232 t:-0.232000 crop=316:338:172:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:172 x2:487 y1:94 y2:432 w:316 h:338 x:172 y:94 pts:-198 t:-0.198000 crop=316:338:172:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:172 x2:487 y1:94 y2:432 w:316 h:338 x:172 y:94 pts:-165 t:-0.165000 crop=316:338:172:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:172 x2:487 y1:94 y2:433 w:316 h:340 x:172 y:94 pts:-131 t:-0.131000 crop=316:340:172:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:17 x2:489 y1:94 y2:433 w:472 h:340 x:18 y:94 pts:-98 t:-0.098000 crop=472:340:18:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:17 x2:489 y1:94 y2:433 w:472 h:340 x:18 y:94 pts:-65 t:-0.065000 crop=472:340:18:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:17 x2:490 y1:94 y2:433 w:472 h:340 x:18 y:94 pts:-31 t:-0.031000 crop=472:340:18:94 [Parsed_cropdetect_0 @ 0x55f105b2c980] x1:17 x2:490 y1:94 y2:433 w:472 h:340 x:18 y:94 pts:35 t:0.035000 crop=472:340:18:94 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-491 t:-0.491000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-458 t:-0.458000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-425 t:-0.425000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-391 t:-0.391000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-358 t:-0.358000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-325 t:-0.325000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-291 t:-0.291000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-258 t:-0.258000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x55ee124b6480] x1:12 x2:714 y1:0 y2:479 w:702 h:480 x:12 y:0 pts:-191 t:-0.191000 crop=702:480:12:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-618 t:-0.618000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-584 t:-0.584000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-551 t:-0.551000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-518 t:-0.518000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-484 t:-0.484000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-451 t:-0.451000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-418 t:-0.418000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-384 t:-0.384000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x564ff1b70d40] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-318 t:-0.318000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-344 t:-0.344000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-310 t:-0.310000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-277 t:-0.277000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-244 t:-0.244000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-210 t:-0.210000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-177 t:-0.177000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-144 t:-0.144000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-110 t:-0.110000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55e0474d5d00] x1:9 x2:714 y1:0 y2:479 w:704 h:480 x:10 y:0 pts:-44 t:-0.044000 crop=704:480:10:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:659 y1:0 y2:479 w:646 h:480 x:14 y:0 pts:-470 t:-0.470000 crop=646:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:662 y1:0 y2:479 w:648 h:480 x:14 y:0 pts:-437 t:-0.437000 crop=648:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-404 t:-0.404000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-370 t:-0.370000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-337 t:-0.337000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-303 t:-0.303000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-270 t:-0.270000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-237 t:-0.237000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bf873ed180] x1:14 x2:663 y1:0 y2:479 w:650 h:480 x:14 y:0 pts:-170 t:-0.170000 crop=650:480:14:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:-196 t:-0.196000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:-163 t:-0.163000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:-130 t:-0.130000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:-96 t:-0.096000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:-63 t:-0.063000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:-29 t:-0.029000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:4 t:0.004000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:37 t:0.037000 crop=706:480:8:0 [Parsed_cropdetect_0 @ 0x55bb41e709c0] x1:8 x2:714 y1:0 y2:479 w:706 h:480 x:8 y:0 pts:104 t:0.104000 crop=706:480:8:0 Results differ...

From HandBrakeCLI:

mpv --no-audio --vf "lavfi=[drawbox=10:0:704:480:invert:1]" Cannon\ S05E01.mkv mpv --no-audio --vf crop=704:480:10:0 Cannon\ S05E01.mkv

transcode-video --crop 0:0:10:6 Cannon\ S05E01.mkv

From ffmpeg:

mpv --no-audio --vf "lavfi=[drawbox=8:0:706:480:invert:1]" Cannon\ S05E01.mkv mpv --no-audio --vf crop=706:480:8:0 Cannon\ S05E01.mkv

transcode-video --crop 0:0:8:6 Cannon\ S05E01.mkv

Done.

lisamelton commented 5 years ago

@BDaddyG Great! OK, that change will go in the upcoming release.

lisamelton commented 5 years ago

Whoops! I pasted the original version of this comment into the wrong issue. :) Sorry about that!

lisamelton commented 5 years ago

BTW, I did check in the patch today so it's definitely going in the next release.

lisamelton commented 5 years ago

@BDaddyG I just release version 0.23.0 with this fix. Thanks again for finding the problem!