tfabris / CrowCam

A set of Bash scripts to control and maintain a YouTube live cam from a Synology NAS.
GNU General Public License v3.0
4 stars 3 forks source link

Investigate automatically inserting timeline cuepoints for motion events. #32

Open tfabris opened 5 years ago

tfabris commented 5 years ago

Youtube api allows me to insert cuepoints on the timeline in realtime using the YouTube API: https://developers.google.com/youtube/v3/live/docs/liveCuepoints

Investigate to see if the Synology API will allow me to trigger each time for these things. If Synology can trigger these, then I can hook these two up and then my live streams will get motion markers.

Note: the following is not the way to get motion detection events, it's how to enumerate the motion detection settings (MotionEnum): https://global.download.synology.com/download/Document/DeveloperGuide/Surveillance_Station_Web_API_v2.0.pdf

Look to see if you can trigger a script on each motion event?

tfabris commented 5 years ago

Actually that same document does have a way to query for events. Instead of using MotionEnum, look instead for this section: "2.3.11 SYNO.SurveillanceStation.Event"

tfabris commented 4 years ago

Update:

New docs URL: https://global.download.synology.com/download/Document/Software/DeveloperGuide/Package/SurveillanceStation/All/enu/Surveillance_Station_Web_API.pdf

"2.3.21.8 ListHistory method" (did not produce any results, so abandoning attempts to use this API)

This works to produce a "count" of events which occured within a given time range if I use a time range that is "from (5 minutes ago) to (now)" "2.3.11.6 CountByCategory method" entry.cgi?api=SYNO.SurveillanceStation.Recording&version=4&method=CountByCategory&limit=100&locked=0&fromTime=$fromTime&toTime=$toTime

To do:

tfabris commented 4 years ago

For the YouTube side of things, I have noticed that some newer videos seem to be taking advantage of a new feature which allows for titled segmented sections of the videos. Here is an example of one video which takes advantage of this new feature. Move your mouse pointer over the scrub bar timeline to see the titled sections: https://www.youtube.com/watch?v=be44AgtJgX8

In the video description this feature seems to be called "Chapters", but I'm not sure if that's what the YouTube API calls them.

Here's another one, the Joni Mitchell/Pat Metheny Group concert "Shadows and Light", with the chapter markers: https://www.youtube.com/watch?v=Z1XFbhSMxIM

This is a new feature that went live in spring 2020. Instructions: https://support.google.com/youtube/thread/49733199

Video Chapters is an optional feature. If you choose to add chapters, we’ll use the timestamp data listed in your video description. To enable the feature, make sure the first timestamp listed in your video description starts at 0:00, and that your video has at least 3 timestamps or chapters, with each chapter being 10 seconds or longer. If you want to disable video chapters on any of your content, you can adjust the first timestamp in your video description to be something other than 0:00 for example, just change it to be "0:01."