Python VLC MediaPlayer - Getting Cursor Last Updated : 09 Feb, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we will see how we can get the cursor position in the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediPlyer object is the basic object in vlc module for playing the video. We can create a MediaPlayer object with the help of MediaPlayer method. Mouse pointer coordinates over a video are expressed as 2-tuple (x, y). Coordinates are expressed in terms of the decoded video resolution, not in terms of pixels on the screen/viewport. In order to do this we will use video_get_cursor method with the MediaPlayer object Syntax : media_player.video_get_cursor() Argument : It takes no argument Return : It returns tuple Below is the implementation Python3 1== # importing vlc module import vlc # importing time module import time # creating vlc media player object media_player = vlc.MediaPlayer() # media resource locator mrl = "death_note.mkv" # setting mrl to the media player media_player.set_mrl(mrl) # start playing video media_player.play() # wait so the video can be played for 5 seconds # irrespective for length of video time.sleep(5) # getting cursor co-ordinates value = media_player.video_get_cursor() # printing cursor co-ordinates print("Cursor Co-ordinates : ") print(value) Output : Cursor Co-ordinates : (655, 436) Another example Below is the implementation Python3 1== # importing vlc module import vlc # importing time module import time # creating vlc media player object media_player = vlc.MediaPlayer() # media resource locator mrl = "1.mp4" # setting mrl to the media player media_player.set_mrl(mrl) # start playing video media_player.play() # wait so the video can be played for 5 seconds # irrespective for length of video time.sleep(5) # getting cursor co-ordinates value = media_player.video_get_cursor() # printing cursor co-ordinates print("Cursor Co-ordinates : ") print(value) Output : Cursor Co-ordinates : (607, 267) Comment More infoAdvertise with us Next Article Python VLC MediaPlayer - Getting Current State R rakshitarora Follow Improve Article Tags : Python Python vlc-library Practice Tags : python Similar Reads Python VLC MediaPlayer - Getting FPS In this article we will see how we can get the fps i.e frame rate per second in the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediaPlayer object i 2 min read Python VLC MediaPlayer - Getting Current State In this article we will see how we can get current state of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediaPlayer object is the basic object i 2 min read Python VLC MediaPlayer â Getting Track Count In this article we will see how we can get track count of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediPlyer object is the basic object in vl 2 min read Python VLC MediaPlayer âGetting Audio Delay In this article we will see how we can get audio delay to the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediPlyer object is the basic object in vl 2 min read Python VLC MediaPlayer â Getting Current Subtitle In this article we will see how we can get the current subtitle of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediPlyer object is the basic obj 2 min read Python VLC MediaListPlayer - Getting Current State In this article we will see how we can get current state of the MediaListPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. Media list player is used to play mu 2 min read Like