Look Based Media Player

Anjali Bhavsar
3 min readNov 10, 2021

--

Usually when you are watching a video and someone calls you, you have to look somewhere else or go away from pc for some time so you miss some part of the video. Later you need to drag back the video from where you saw it. Well here is a solution to this problem.

A look based media player that pauses automatically when user is not looking or paying attention and resumes as soon as the user is looking at it or his attention to the video is restored.

This is done using the camera or webcam on top of the computer. As long as the camera detects the users face looking at it, the media is played. The player pauses as soon as users face is not completely seen. The look based media player does not allow user to miss a single part of the media user is watching. The system user camera to sense if user is looking at it, the system pauses the media being played as soon as it detects user is not looking at it.

Algorithm

  • The Media Player is created using PyQt5
  • Face Detection is done using opencv cascade classifier
  • Eye blinking and drowiness is done using dlib’s pre-trained facial landmark detector.

Functionality

Media Player GUI :

Click on Open Video and choose the file you want to play then press the Play button

Press Face Detection button to enable Face Detection and Drowsiness feature Webcam feed window will be shown:

Note: To regain manual control over media player, Press ESC to release webcam feed .You can return back to face detection feature by pressing face detection button

On entering a wrong file format or no file at all, file error window will pop up

Pressing Retry button, will enable the user to choose another file
Pressing Abort button, will close open file window

On detecting eyes dowsiness and sleepliness, Drowsiness window will pop up

Pressing Retry button, will enable the user to continue watching
Pressing Abort button, will close and exit the mediaPlayer

Note: On pressing Retry user’s eyes should be wide open to continue playing the video otherwise it might take a couple of times pressing Retry button.

Supported Formats

  • .mp3
  • .mp4
  • .mov
  • .mkv
  • .wav

--

--

No responses yet