How do I build a static libvlc under CentOS7?

This forum is about all development around libVLC.
myxingkong
New Cone
New Cone
Posts: 4
Joined: 29 May 2018 05:02
VLC version: 2.2.8
Operating System: Windows7/macOS10.12

How do I build a static libvlc under CentOS7?

Postby myxingkong » 16 Jul 2018 09:07

I have a program written by PyQt that plays video by binding libvlc.

Code: Select all

# -*- coding: utf-8 -*- import sys import os import vlc from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import * class vlc_demo(QWidget): def __init__(self): super(vlc_demo, self).__init__() self.__ui__() self.__load__() def __ui__(self): self.setFixedSize(800,600) t_lay_parent = QVBoxLayout() self.m_label_media = QLabel() t_lay_bottom = QHBoxLayout() self.m_button_one = QPushButton("one") self.m_button_too = QPushButton("too") self.m_button_three = QPushButton("three") t_lay_bottom.addWidget(self.m_button_one) t_lay_bottom.addWidget(self.m_button_too) t_lay_bottom.addWidget(self.m_button_three) self.m_button_one.clicked.connect(self.slt_one) self.m_button_too.clicked.connect(self.slt_too) self.m_button_three.clicked.connect(self.slt_three) t_lay_parent.addWidget(self.m_label_media) t_lay_parent.addLayout(t_lay_bottom) self.setLayout(t_lay_parent) def __load__(self): self.m_instance = vlc.Instance() self.m_player = self.m_instance.media_player_new() self.m_win_id = self.m_label_media.winId() if sys.platform.startswith('linux'): # linux self.m_player.set_xwindow(self.m_win_id) elif sys.platform == "win32": # windows self.m_player.set_hwnd(self.m_win_id) elif sys.platform == "darwin": # mac self.m_player.set_nsobject(self.m_win_id) def slt_one(self): self.m_label_media.show() media = self.m_instance.media_new("1.mp4") self.m_player.set_media(media) self.m_player.play() def slt_too(self): self.m_label_media.show() media = self.m_instance.media_new("2.mp4") self.m_player.set_media(media) self.m_player.play() def slt_three(self): self.m_label_media.hide() if __name__ == "__main__": app = QApplication(sys.argv) win = vlc_demo() win.show() sys.exit(app.exec_())
Under windows, copy the following files and directories in the VLC media player directory. The program can run on the machine without VLC media player.

Code: Select all

- libvlc.dll - libvlccore.dll - plugins
Under CentOS7, is there any way to run the program without installing VLC media player?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: How do I build a static libvlc under CentOS7?

Postby mfkl » 16 Jul 2018 10:53

https://mfkl.github.io

myxingkong
New Cone
New Cone
Posts: 4
Joined: 29 May 2018 05:02
VLC version: 2.2.8
Operating System: Windows7/macOS10.12

Re: How do I build a static libvlc under CentOS7?

Postby myxingkong » 17 Jul 2018 03:19

Thank you very much. It's very useful to me


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 31 guests