BrettSheleski / comchap

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

Why are intermediate files MPEG-TS? #50

Closed skittlesvampir closed 1 year ago

skittlesvampir commented 1 year ago

First of all I want to say thank you for this awesome script. Second of all, I want to make clear that this is not meant as criticism of any kind, I'm just curious.

I'm currently working on a highly personalized fork of this project, most notably 'comcut'. So I noticed that intermediate files (infile.part-1.ts, etc) have an .TS extension and I would like to know if they were chosen for a specific reason.

The reason I'm asking is because I'm thinking about switching them (for my fork) to Matroska so that they can support subrip subtitles and I'm worried that this will cause trouble.

BrettSheleski commented 1 year ago

I dont recall off the top of my head (it's been a while since doing any sort of real development for this), but I think the intermediate .ts files are raw MPEG files. Meaning they don't have extra compression added on them with whatever codec. I think this was chosen because it'll end up taking all the intermediate files and concatenate them into a single file with the desired compression/codec and then deleted. There's really no point in wasting processing power to apply compression/codecs to these intermediate files because they'll end up just being reprocessed anyway (and then deleted when done). Also, I would think that by applying the desired end codec once instead of multiple times then there's less of a chance of loss of quality in the end result.

skittlesvampir commented 1 year ago

Thank you for your insight. I tried to just use .MKV containers and it failed horribly (weird framerates, too short, etc.) so I'm now using .TS again.