A tool to quickly mark and save segments of a YouTube video as a json file.
A segment is a contiguous time interval. YTIntervals allows you to group several segments into segment-groups. A segment-group is simply a set of non-overlapping segments.
In video https://www.youtube.com/watch?v=IcDI1iWmIp8 (note all times are in seconds):
- Segment-group "smile" may be associated with segments 33.2-41.2s and 51.3-53.5s.
- Segment-group "frown" may be associated with segments 30.0-35.0s, 70.0-71.9s and 82.1-84.7s.
Using YTIntervals, you can name these
segment-groups, mark the segments in each segment-group and save the
results into a intervals.json
file in your downloads folder. In
this example, the file will contain the following:
{"url": "https://www.youtube.com/watch?v=IcDI1iWmIp8",
"smile":
[{"startTime":33.2,"endTime":41.2,"active":false},
{"startTime":51.3,"endTime":53.5,"active":false}],
"frown":
[{"startTime":30.0,"endTime":35.0,"active":false},
{"startTime":70.0,"endTime":71.9,"active":false},
{"startTime":82.1,"endTime":84.7,"active":false}]}
- Clone this repository to your local computer.
- As described in the next three sub-steps, enable developer mode in
Chrome, then load the repository as an unpacked extension:
- Go to
chrome://extensions
- Toggle the button on the top right-hand corner to enable developer mode.
- Click on "Load Unpacked" (top middle of the page) and select the directory you cloned the repo into. You should get an extension button with a "scraper" icon () at the top right hand that says "YTIntervals" when you hover over it.
- Go to
- Go to any YouTube video and pause it. The tool works whether the video is paused or running. However, it is usually much easier to precisely label a paused video by moving the slider around.
- For each new named segment-group you want to add, click the extension
button . Enter the name of the
new segment-group at the prompt.
- Now mark the segments corresponding to the segment-group. For each segment:
- Move the slider to where you want your segment to
start. Press
Shift
- Move the slider to the end of the segment. Press
Shift
again. - YTIntervals will show you the segment you just marked using a white rectangle along the slider.
- Move the slider to where you want your segment to
start. Press
- If you need to delete a segment, just click on its rectangle.
- Now mark the segments corresponding to the segment-group. For each segment:
- When you are done labeling, use
Ctrl-Shift-s
to save anintervals.json
file to yourDownloads
folder.