Show a complete VLC player with libvlc

This forum is about all development around libVLC.
stefan__o
New Cone
New Cone
Posts: 4
Joined: 18 Aug 2019 01:14

Show a complete VLC player with libvlc

Postby stefan__o » 02 Jun 2022 11:09

Hello,
I like to use VLC in a simple Python application. I used the python-bindings for libvlc, but I cannot figure out how to open a complete VLC player window (with all controls and settings etc.). I also tried the http-Interface, but that lacks one feature I need: sub-second time resolution (I realized VLC doesn't seem to offer exact timing, only about 1/4 second resolution, which is just about enough, if one could increase the resolution somehow would be great).
  • Is it (and if yes how) possible to open a complete VLC player with libvlc from Python?
  • If previous answer is no, is it possible with the http interface to access millisecond timing somehow?
  • Is it possible to increase VLCs internal time resolution?
Best regards
Stefan

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Show a complete VLC player with libvlc

Postby Rémi Denis-Courmont » 02 Jun 2022 16:40

No. No. No.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

stefan__o
New Cone
New Cone
Posts: 4
Joined: 18 Aug 2019 01:14

Re: Show a complete VLC player with libvlc

Postby stefan__o » 02 Jun 2022 17:29

There is a time extension that displays milliseconds on the display, isn't it possible to create an extension that either adds one entry to the status.json or provides a new file?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Show a complete VLC player with libvlc

Postby Rémi Denis-Courmont » 02 Jun 2022 18:01

Everything is possible if you don't care about actual accuracy.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

stefan__o
New Cone
New Cone
Posts: 4
Joined: 18 Aug 2019 01:14

Re: Show a complete VLC player with libvlc

Postby stefan__o » 02 Jun 2022 18:44

The accuracy of vlc.player.get_time() would not be ideal, but just enough (if I can consider the value accurate in the way, that this a rounded value of the current frame).
The question is, how can I provide the output of vlc.player.get_time() to the http interface. I tried adding a status2.json:

Code: Select all

<?vlc local dkjson = require ("dkjson") s ={} s.time = vlc.player.get_time() s.rate = vlc.player.get_rate() s=removeArrayIndicators(s) output=dkjson.encode (s, { indent = true }) print(output) ?>
Unfortunately the vlc object doesn't seem to exist in this context, and the httprequests.lua that provides the info for the status.json is a compiled binary

Krilya
New Cone
New Cone
Posts: 6
Joined: 02 Aug 2022 10:30

Re: Show a complete VLC player with libvlc

Postby Krilya » 02 Aug 2022 10:44

Hey Stefan__o,
It is possible to start a complete VLC user interface with python-vlc.
PS : I code for fun not a savvy.

import vlc
from tkinter import Tk

root = Tk()
root.withdraw()

vlc_instance = vlc.Instance()
media_player = vlc.MediaPlayer()
vlc.libvlc_add_intf(vlc_instance, name=None)

root.mainloop()


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests