Skip to content

Chapter/timestamp support #271

Description

@rigelk

nota: this issue is the result of preliminary discussion that happened on framacolibri [in french]. Thanks to HerrNaja, Pouhiou and Chenille33!

Hello all,

Adding chapters to a video could be of great use for authors that want to pinpoint specific parts of a video:

  • much like in YT's use use case, where chapters are non-existant but timestamps can be reached via a GET attribute (e.g.: http://pouhioutube.com/masupervideo?t=6m22s ). Authors typically add the url(s) of each "chapter" with the corresponding parameters in the description afterwards. This isn't ideal but should definitely be easy to implement and put us on par with YT featurewise.

  • with a WebVTT file given alongside the upload, or when editing the video object after the upload. (standard way to do, but the .vtt file has to be done beforehand in an editor…).

  • with a simple timestamp given alongside the upload or when editing the video object after the upload. (simple to implement, as a third party plugin exists for video.js)

    Timestamp demo in video.js

For either of the last two options, a visual way to make them stand out would be most welcome by authors. It would also put emphasis on structured videos:

Chapter thumbnails in video.js

I found this already implemented in chemoish/videojs-chapter-thumbnails's third party plugin for video.js.

Activity

  1. trymeouteh commented on Jan 2, 2021

    @trymeouteh

    This is a new thing on YouTube and would be cool to see on Peertube for any video or audio. If Peertube could also get the chapters from the file when uploaded and allow the uploader to create and delete chapters would be cool.

  2. samlich commented on Feb 8, 2021

    @samlich

    I've created a plugin to do this https://www.npmjs.com/package/peertube-plugin-chapters (although you'll have to wait for v0.1.4 to be indexed by PeerTube as v0.1.3 doesn't have the dist folder). Chapters are entered in the plugins settings tab when editing a video. It uses video.js's chapter support which has a menu in the video menu bar.

    It has SponsorBlock-like tags, in that they are flagged for other plugins. It does not show them in different colors on the timeline. I think it would make more sense to add segmented timeline support to video.js. The coloring could maybe be part of video.js, or part of this plugin.

    It doesn't support uploading a vtt at the moment, although support can easily be added as it creates a WebVTT from the input.

    Edit: And the validation and preview does not currently work on the publish page, but does work on the update page. Not sure why yet.

  3. quicktrick commented on Apr 5, 2022

    @quicktrick

    Hi @samlich! Is there any working example where to see your plugin in production? Does it work in embedded videos as well?

    Edit
    I found a working link in the issues on your GitHub. The plugin works in the embedded videos, too.

  4. samlich commented on Apr 29, 2022

    @samlich

    Hi @samlich! Is there any working example where to see your plugin in production? Does it work in embedded videos as well?

    I should probably put that somewhere, thanks for pointing that out. I'll embed a video in the readme in the next update, and on the webpage which I seem to have not linked anywhere in the repo.

  5. 0lhi commented on Jun 24, 2022

    @0lhi

    I would like it a lot if PeerTube would support Chapters via ffmetadatafiles:

    ;FFMETADATA1
    major_brand=isom
    minor_version=512
    compatible_brands=isomiso2avc1mp41
    encoder=Lavf58.29.100
    
    [CHAPTER]
    TIMEBASE=1/1000
    START=0
    END=3036999
    title=1st Stream
    
    [CHAPTER]
    TIMEBASE=1/1000
    START=3037000
    END=6963999
    title=2nd Stream
    
    [CHAPTER]
    TIMEBASE=1/1000
    START=6964000
    END=8097999
    title=3rd Stream
    

    That has the advantage that it can be included into the .mp4 directly, so a User who downloads the Video will have the Chapters available in a local video player.

    Here https://ikyle.me/blog/2020/add-mp4-chapters-ffmpeg it's described how to add it with ffmpeg easily:

    ffmpeg -i INPUT.mp4 -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT.mp4

  6. abcdw commented on Jan 13, 2023

    @abcdw

    There is already complete #1312, which adds hyperlinks for timecodes in the description. It would be really cool to generate chapters from those timestamps and have visual marks on progress line with small tooltip/label about a chapter.

    image

  7. Chocobozzz commented on Mar 2, 2023

    @Chocobozzz
    Owner

    Hi,

    This feature is planned in our 2023 roadmap: https://joinpeertube.org/news/roadmap-v6
    If you want to help to fund this feature, you can make a donation on https://support.joinpeertube.org

  8. Chocobozzz commented on Oct 12, 2023

    @Chocobozzz
    Owner

    This feature has been implemented in 77b7070 and will be available in PeerTube 6 planned at the end of the year 🎉

    Chapters can be set using the web interface:
    screen_2023-10-12-15_41_03

    If not explicitly set by the user, PeerTube will try to import chapters from the video file (mkv for example) or from the remote website (using youtube-dl/yt-dlp).

    Chapters are displayed in the player progress bar, on hover:

    screen_2023-10-12-15_45_54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions