This a hack-day experiment to programmatically detect the approximate timestamp of the end credits for a given video.
The end credit is a particularly useful timestamp for video players to show additional content in the UI. For example, Netflix will displays a piece of UI to navigate to the next episode when the end credits starts playing for the current video.
To run the project, curl
, docker
and docker-compose
are required.
./scripts/setup.sh
docker-compose build
docker-compose run main
This demo takes advantage of the following core dependencies.
The rough approach is to:
- Capture frames for the video for some interval e.g. 1 frame per second.
- Score each frame for how likely it is a end credit frame.
- Analyze the pattern of scores to determine the beginning of the end credit.
To score the likelihood that a given frame is a end credit frame, we can use the following heuristics.
- Whether certain keywords are present. e.g.
"Produced By"
,"Director"
,"Dolby"
. - How many lines of text are present or text density end credit screen likely contain dense text count.
- The background color of the frame since end credit screen are often (though not always) black.