0

So I am running VLC on a Pi 4 and I have installed an extension to VLC that shows the elapsed seconds for the video. However, when I use python-vlc to launch VLC it does not enable the extension. Is there a way to do this using python-vlc?

  • What do you mean by "the elapsed seconds for the video"? Do you mean the countdown in seconds of the duration of the video? – Baraa Aug 07 '20 at 13:57
  • `player.get_time()` will return the current position in thousandths of a second i.e. at the 45 second point, it would return 45000, so dividing by 1000 would give 45 seconds. – Rolf of Saxony Aug 07 '20 at 14:28
  • What the extension does is actually print on the bottom-right the number of seconds elapsed and total for the video. So basically a countdown on top of the video, like a subtitle. But when I launch it through python-vlc the extension isn't activated and so nothing shows up. – Nikhil Joshi Aug 08 '20 at 08:30
  • Here is a description of the extension: https://aboutdevice.com/show-vlc-timing-in-millisecond/ – Nikhil Joshi Aug 08 '20 at 08:36
  • As far as I'm aware because extensions are `not` part of `vlc` the python api knows diddly squat about it. You'll have to code your own time display, thus the remark concerning `player.get_time()`. – Rolf of Saxony Aug 08 '20 at 16:59
  • But how do you overlay a time display onto a video? – Nikhil Joshi Aug 09 '20 at 08:21

1 Answers1

0

I think you're confusing VLC and LibVLC? By "extension", I believe you mean VLC app add-ons. I don't think you can easily have these running when using standard libvlc builds.

However, there is a way to achieve what you want using the LibVLC APIs. Look into the marquee APIs, which is a video filter that allows you to display custom text at custom locations on the video.

Docs: https://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__video.html#ga53b271a8a125a351142a32447e243a96

mfkl
  • 1,914
  • 1
  • 11
  • 21
  • Please set your question as answered then. – mfkl Aug 11 '20 at 07:57
  • So I am able to set the marquee to a string, but I can't seem to figure out how to add the elapsed video time to the string. You can use certain variables to show the *system* time, but I can't figure out how to show just the number of seconds that have passed since the start of the video, i.e. a counter. Any ideas? – Nikhil Joshi Aug 13 '20 at 06:53