Skip to content

chapters files as sidecars #11248

@calestyo

Description

@calestyo

Hey.

What I'd like to have is a way to specify custom chapters for any file type in side-car file, which - if present - is automatically loaded by mpv.

The difference to --chapters-file= is, that these should be automatically loaded without the need to specify them.

The main motivation for no just somehow adding the chapters to the file itself is, that one often may want to keep that in its pristine form.

I think an option should allow to enable that feature (defaulting to off) and also allow to select from where the sidecar files would be actually loaded, for which I see a number of possibilities:

  1. a file that really accompanies the actual media file in its directory, e.g. if the latter is video.mp4, it would look for a sidecar file like video.mp4.chapters.xml or so.
  2. some central directory like .config/mpv/chapter-sidecars or so, where e.g the media file’s SHA256 sum is used as name for the sidecar file.

Ideally users could configure to choose either or both, as each has it's pros and cons:

(1):

  • may clutter up the directories containing the actual media files with sidecar files, which people may not want
  • there could be subtle security issues (when auto-interpreting such sidecar file, which has been e.g. just un-tar-ed from some untrusted location - which may not be so easy the case with (2)
  • renaming/moving the original file would require to rename/move the sidecar as well, which is not the case in (2), at least if the files don't change

(2):

  • perhaps less easy to find the corresponding sidecar file
  • if media files change their content a lot (probably only the case for creators), the sidecars would get "lost" every time, as the hash changes

Possibly an additional nice feature would be if one could configure (perhaps even per sidecar file), whether the sidecar’s chapters replace any native chapters (in the media file itself) or add to them.

There's already https://github.com/shinchiro/mpv-createchapter, but AFAICs this is only for writing such XML files and the author thought it wouldn't be possible to do the reverse.

Thanks,
Chris

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions