DVR-Scan icon indicating copy to clipboard operation
DVR-Scan copied to clipboard

Separators in 'Comma-separated timecode values' section

Open ocram opened this issue 3 years ago • 4 comments

In the CLI text output, in the section named “Comma-separated timecode values”, is it actually intended behavior that the separators are all commas, both between start and end time of a single event as well as between separate events?

While the comma between start and end times is fine, I guess if the next comma (i.e. every other comma) between two events were replaced with either a semicolon (or a newline), that would simplify processing without any downsides or obvious reasons not to do it.

ocram avatar Feb 10 '22 12:02 ocram

The original intention for this was that you could feed the list of splits to mkvmerge and thus end up with some video clips representing the exact motion events. Since then though, mkvmerge takes a timecode range now, and this output format also isn't very useful for ffmpeg.

Could you share a bit more about your use case for this? I'm open to changing the format, or allowing a CLI option to change the timecode output (maybe as an option when -so is specified) between different formats. Happy to hear any suggestions you or others may have.

Breakthrough avatar Feb 10 '22 23:02 Breakthrough

I don’t have any specific use case in mind, only something roughly like the obsolete mkvmerge use case. It’s just that the current output is not really useful for anything, while replacing every other comma with a semicolon (compact) or newline (less compact) would make this a generally useful, CSV-like output for various use cases and processing tasks.

ocram avatar Feb 12 '22 19:02 ocram

The mkvmerge docs use the following syntax:

start1-end1[,[+]start2-end2[,[+]start3-end3...]]

So I would propose using - as a separator, thus the output would be something like:

00:01:20.000-00:02:45.000,00:05:50.000-00:10:30.000

Thoughts? I'm okay making this a breaking change, since this should likely be the default behaviour, and it should be pretty easy to update any scripts relying on the old behaviour to use --split parts[...] with mkvmerge instead of --split timecodes:[...]

Breakthrough avatar Feb 12 '22 22:02 Breakthrough

So instead of turning (without the spaces)

a , b , c , d

into

a , b ; c , d

turn it into the following?

a - b , c - d

That’s perfect!

ocram avatar Feb 12 '22 22:02 ocram