Any volunteers to implement the ability to import OBS markers into Kdenlive?

This would be a very nice time-saving feature to have! Anyone want to take point on this one?

From the ticket (https://bugs.kde.org/523460)

OBS for some time has had the feature to insert markers while you are recording
with a assigned hotkey. These are saved as chapters, and can be read with
ffprobe. 

Example output:
  Chapters:
    Chapter #0:0: start 0.000000, end 6.250000
      Metadata:
        title           : Start
    Chapter #0:1: start 6.250000, end 10.083000
      Metadata:
        title           : Unnamed 1
    Chapter #0:2: start 10.083000, end 11.666000
      Metadata:
        title           : Unnamed 2
    Chapter #0:3: start 11.666000, end 12.900000
      Metadata:
        title           : Unnamed 3
It would be great if kdenlive could read this upon video import, and assign
markers in the clip when it is brought into the timeline (markers in the clip are
preferable, timeline markers are less useful since they don't move along as you
cut up the clip).

Potential roadmap for the algorithm ?

INPUT: Video file path
OUTPUT: List of markers with timecode and name

ALGORITHM:
1. Invoke ffprobe with JSON output format to extract chapter metadata
   - Command: ffprobe -v quiet -print_format json -show_chapters <video_file>
   
2. Parse JSON output to extract chapters array
   - Each chapter has:
     * start_time: beginning in seconds (float)
     * end_time: ending in seconds (float)
     * tags.title: chapter name (string, optional - use "Unnamed N" if missing)

3. For each chapter:
   a. Convert start_time (seconds) to GenTime object
   b. Extract chapter title from tags.title
   c. Create CommentedTime marker with:
      - Position: start_time as GenTime
      - Comment: chapter title
      - Type: default marker type (0 or user preference)
      - Duration: optional range marker (end_time - start_time)

4. Import markers into clip using existing importJsonMarkers method
   - Convert list to JSON format matching Kdenlive's marker structure
   - Call ProjectClip::importJsonMarkers(json)

bumping for visibility

Hi, I don’t know much about Kdenlive but can give this a try.

Thank you :pray:
Feel free to post your progress to this thread. Maybe some devs can help clarify issues or methodologies ?

Any luck with progress on this, @saurabhs ?

Hi, yeah I managed to extract the markers, though was wondering why do I need to convert to GenTime and CommentedTimeobjects when I can convert the markers to Kdenlive json format in a similar way as one done in the SceneSplitTask::runsince there’s GenTimeor CommentedTimeor even the QList don’t have a way to export to json?

Hi @saurabhs, thanks for looking into this. Best way to get answers for your valid questions is to create a MR in the Kdenlive repo so that the developer and other core team members can look into this and give you guidance or suggestions.

@saurabhs are you planning to make an MR as bernd suggested ?

Hi, here’s the MR, though I’m not sure about
auto binId = pCore->projectItemModel()->getAllClipIds()[0]; but I couldn’t find any other way to get the ProjectClip refenrence.