BrettSheleski / comchap

Commercial detection script to add chapters into video file
MIT License
138 stars 26 forks source link

comcut doesn't add the last piece of video from last commercial to end of file #46

Open texasreddog opened 3 years ago

texasreddog commented 3 years ago

I've been downloading some videos from Tubi and attempted to use comcut on Ubuntu to strip out the commercials. It seems to work fine, except that the last part of video from the last commercial to the end of the file is missing from the new file. I was trying to figure out what the issue is, but not exactly sure at this point. I'll post the log file I captured to this issue later.

texasreddog commented 3 years ago

the log I captured is here.

99116 frames decoded in 395.26 seconds (250.76 fps) Input #0, ffmetadata, from 'fi4x01.ffmeta': Duration: 00:38:58.63, start: 0.000000, bitrate: 0 kb/s Chapter #0:0: start 0.000000, end 0.970000 Metadata: title : Chapter 1 Chapter #0:1: start 0.970000, end 415.180000 Metadata: title : Chapter 2 Chapter #0:2: start 415.179000, end 1500.629000 Metadata: title : Chapter 3 Chapter #0:3: start 1500.629000, end 1757.379000 Metadata: title : Chapter 4 Chapter #0:4: start 1757.380000, end 2338.630000 Metadata: title : Chapter 5 [h264 @ 0x55b2f4a7dac0] Reinit context to 1280x720, pix_fmt: yuv420p [mpegts @ 0x55b2f4a6df80] max_analyze_duration 5000000 reached at 5013600 microseconds st:1 Input #1, mpegts, from 'concat:fi4x01.part-1.ts|fi4x01.part-2.ts|fi4x01.part-3.ts|fi4x01.part-4.ts|fi4x01.part-5.ts': Duration: 00:09:41.30, start: 1.442989, bitrate: 13444 kb/s Program 1 Metadata: service_name : service_provider: FFmpeg Stream #1:0[0x100]: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(progressive, left), 1280x720, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Stream #1:10x101: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 258 kb/s Output #0, mp4, to '4x01new.mp4': Metadata: encoder : Lavf58.45.100 Chapter #0:0: start 0.000000, end 0.970000 Metadata: title : Chapter 1 Chapter #0:1: start 0.970000, end 415.180000 Metadata: title : Chapter 2 Chapter #0:2: start 415.179000, end 1500.629000 Metadata: title : Chapter 3 Chapter #0:3: start 1500.629000, end 1757.379000 Metadata: title : Chapter 4 Chapter #0:4: start 1757.380000, end 2338.630000 Metadata: title : Chapter 5 Stream #0:0: Video: h264 (Main), 1 reference frame (avc1 / 0x31637661), yuv420p(progressive, left), 1280x720 (0x0), q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 258 kb/s Stream mapping: Stream #1:0 -> #0:0 (copy) Stream #1:1 -> #0:1 (copy) Automatically inserted bitstream filter 'aac_adtstoasc'; args='' [mpegts @ 0x55b2f4a6df80] Packet corrupt (stream = 0, dts = 37402122).55.9kbits/s speed= 592x
[mpegts @ 0x55b2f4a6df80] Packet corrupt (stream = 0, dts = 97813809).3195.6kbits/s speed= 628x
[mpegts @ 0x55b2f4a6df80] Packet corrupt (stream = 0, dts = 23230869).3196.1kbits/s speed= 624x
No more output streams to write to, finishing.ime=00:35:50.21 bitrate=3200.0kbits/s speed= 614x
Not writing 'clli' atom. No content light level info.

It's an hour long file, and it looks like the last 9 minutes and 41 seconds are being ignored and only the 38:58 part is being written to in the new output file.

glenstewart commented 3 weeks ago

Yes, I've seen the same. I had to add always_keep_last_seconds=1620 to the comskip.ini file. It allows commercials in at the end, but preserves the movie endings.