当前位置:首页 » 操作系统 » vlcplayer源码

vlcplayer源码

发布时间: 2022-06-26 21:05:33

A. 求vlc播放器的源代码

最新版源码下载地址: http://download.videolan.org/pub/videolan/vlc/1.1.7/vlc-1.1.7.tar.bz2
但是官方不支持使用VC编译,并且不建议使用VC,移植难度很大。
官方支持的是MingW或者Cygwin,也就是GCC的Windows版。编译方法见官方Wiki:
- http://wiki.videolan.org/Win32CompileMSYS
- http://wiki.videolan.org/Win32CompileCygwin

B. 如何在MacOSX Lion上编译VLC media player

11.03
在Mac OS X Lion下编译VLC media player
Prerequisite
Mac OS X Lion
XCode 4.4.1
0.建立一个文件夹并进入
$ mkdir vlc_osx && cd vlc_osx
1.设置编译器
$ export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
$ export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
$ export OBJC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
2. 下载源码至本地
$ git clone git://git.videolan.org/vlc.git
3. 编译autoconfig等工具
$ cd vlc/extras/tools
$ ./bootstrap && make
$ cd ../..
$ export PATH=$PWD/extras/tools/build/bin:$PATH
(注意第四项设置非常重要,确保自行编译生成的工具所在的路径在系统原有路径之前,否则会调用
系统原有的lib tool工具,由于版本问题,可以会导致下面的步骤出错)
4. 设置操作系统版本
$ export OSX_VERSION=10.7
5. 编译
$ cd contrib
$ mkdir -p osx && cd osx
$ ../bootstrap --host=x86_64-apple-darwin11 --build=x86_64-apple-darwin11
6.编译第三方库
6.1 下载编译好的第三方库(推荐)
$ make prebuilt
6.2 从源码自行编译第三方库(反正我是没有编译成功)
$ make -j4 .gettext
$ export PATH=$PWD/../x86_64-apple-darwin11/bin:$PATH
7.Bootstrap VLC
$ cd ../..
$ ./bootstrap
8.配置编译选项(Configure)
$ mkdir -p build && cd build
$ ../extras/package/macosx/configure.sh --enable-debug --disable-ncurses --host=x86_64-apple-darwin11 --build=x86_64-apple-darwin11
9.编译VLC
$ make -j4 或 $./compile.sh
10.开始使用
此时在当前目录下(即build目录)下应有一个VLC.app目录
$VLC.app/Contents/MacOS/VLC
应该可以看到vlc media player正确启动了
Reference
http://wiki.videolan.org/OSXCompile

C. 如何在Ubuntu上安装VLC播放器,以及DASH VLC plugin,使其支持DASH访问

最简单的方法,打开软件中心或新立得,直接搜vlc,找到后安装。

稍微难一点的方法,打开终端,输入命令

sudoapt-getinstallvlc

我没有命令行安装过vlc,不知道软件库里还是不是vlc,如果不是一般可以这样解决

sudoapt-getinstallvlc*

最难的方法,下载源码自己编译安装。


********************************************************

插件那个安装,建议先安装新立得(建议必装)

sudoapt-getinstallsynaptic

用sudo权限打开后直接查找相关的插件名,然后安装。

或者用上面的方法

sudoapt-getinstallvlc*

除了vlc之外还会显示很多可用插件,选择你需要的,安装即可,例如

sudoapt-getinstallvlcvlc-dash-plugin

上面命令我瞎编的不能信,具体看你终端里的反馈。

D. vlc播放器是用什么写出来的

以下是编译VLC源代码时所需的库:

Third party libraries used by VLC
You'll find a complete list on the wiki.

But, here are the most important libraries.

Audio/Video codecs
liba52 - an ATSC A/52 (aka AC3) audio decoder
libmad - an MPEG audio decoder
libmpeg2 - an MPEG1/2 video decoder
libavcodec (ffmpeg) - an extensive audio/video codec library which supports several formats like MPEG4, H263, WMV/A etc...
libogg - an Ogg bitstream parser
libvorbis - a Vorbis audio decoder
libflac - a FLAC (Free Lossless Audio Codec) audio decoder
libspeex - a Speex (Free speech codec) audio decoder
libtheora - a Theora video decoder
libfaad2 - an AAC audio decoder
libdv - a DV video decoder (deprecated in favor of libavcodec)
libxvidcore (xvid) - an ISO MPEG-4 compliant video codec (deprecated in favor of libavcodec)
libdca - A DTS Coherent Acoustics decoding library.

GUI framework libraries
wxWidgets - a cross-platform C++ GUI framework that keeps the look and feel of each platform
QT4 - a C++ Cross-Platform Rich Client Development Framework

Audio/Video output libraries
libsdl - a cross-platform multimedia library designed to provide level access to audio, and 2D video framebuffer

Miscellaneous libraries
libdvdcss - a library for accessing encrypted DVDs
libdvdnav - a library for DVD navigation
libdvdread - a library for reading DVD-Video images
libdvbpsi - a library designed for decoding and generation of MPEG TS and DVB PSI tables
libopenslp - an open-source implementation of Service Location Protocol
gettext - a set of tools that provides a framework to help applications proce multi-lingual messages
libfreetype2 - a software font engine that is designed to be small, efficient, highly customizable and portable while capable of procing high-quality output (glyph images).
fribidi - A Free Implementation of the Unicode Bidirectional Algorithm
liveMedia - C++ libraries for multimedia streaming (RTP/RTCP, RTSP, SIP)
matroska - a new, extensible open standard Audio/Video container format

If you're using those libs to compile VLC for windows with mingw-gcc 3.3.1, you can use our Win32 contribs.

如果需要更权威的回答,这里是VLC官方提供的源码下载:
http://download.videolan.org/pub/vlc/

E. 我的电脑为什么安装不了VLC media player

http://download.videolan.org/pub/videolan/
这里有vlc各个版本的源代码和二进制文件,直接下你想要的版本的二进制文件解压后就可以用了,不用安装。(注意选与自己操作系统一值的压缩包)

F. 怎么用java调用vlc播放器

最简单的方法,打开软件中心或新立得,直接搜vlc,找到后安装。稍微难一点的方法,打开终端,输入命令sudo apt-get install vlc我没有命令行安装过vlc,不知道软件库里还是不是vlc,如果不是一般可以这样解决sudo apt-get install vlc*最难的方法,下载源码自己编译安装。********************************************************插件那个安装,建议先安装新立得(建议必装)sudo apt-get install synaptic用sudo权限打开后直接查找相关的插件名,然后安装。或者用上面的方法sudo apt-get install vlc*除了vlc之外还会显示很多可用插件,选择你需要的,安装即可,例如sudo apt-get install vlc vlc-dash-plugin上面命令我瞎编的不能信,具体看你终端里的反馈。

G. VLC播放器看网络电视,应该打开什么文件,是什么格式的,代码是什么,谢谢!

、转发服务端设置

首先将一个性能好的电脑作为转发服务器,运行VLC Media Player软件,在菜单栏里,通过[文件]→[打开文件],选择[网络],选“HTTP/HTTPS/FTP/MMS”传输协议,在网址填写框内填写需要播放卫星节目的网址,网上的教程均介绍应该填写“ xxx/video.m3u”,但发现不能成功,正确的方式应该填写卫星节目的详细网址,这就和在WEB页面调用VLC Media Player软件时,必须先下载后方能播放成功是一样的道理。

如何知道卫星节目的详细网址呢?以我们转发70.5°E的“Trace TV”音乐频道为例,具体方法如下:

首先进入DM500S接收机的WEB管理控制界面,选择“Trace TV”频道,点击“VLC”,待下载完成后点击播放,此时出现VLC Media Player软件播放该频道的界面。在菜单栏里,通过[查看]→[串流及媒体信息],选择[一般]。

复制“URI”栏目内的网址(注:“URI”应该为“URL”,汉化错误),粘贴到[文件] →[打开文件] →[网络] →[网址]框内,再将[串流/保护]前选项框内打“√”,即可点击“设置”按钮。

进入[串流输出]设置界面。

首先选择[输出]方式,这里选用MMSH协议,地址栏填写转发服务端的IP地址“192.168.1.2”。然后选择[封装方法],一般选用ASF,也可采用MP4、WAV封装方法,不过只能采用MMSH协议输出,如果采用HTTP协议输出,则客户端播放没有画面。

通过VLC串流转码。实际上就是VLC Media Player解码DM500S的TS流,然后VLC Media Player又重新封装打包并且传回网络的过程,这个封装方式可以在[转码选项]中自行变更。在[转码选项]中,选择视频编码器、音频编码器的编码格式时,应考虑客户端有无相应的解码包。一般视频编码器可选择常用的WMV1、WMV2格式,音频编码器选用MP3格式。比特率的选择应考虑网络带宽及转发服务器的性能,在条件允许的情况下,选择较大的比特率有利于画质和音质的提高。选择时注意,视频编码器中的“尺寸”是指播放画面的大小;音频编码器中的“频道”为汉化错误,应该为“声道”,通常选择“2”,表示双声道。

以上的设置完成后,按两次“确定”后退出设置界面,此时VLC Media Player播放器底端会有计时器出现,说明软件已开始进行串流发送。至于成功不成功,我们可以通过菜单栏[查看]→[串流及媒体信息]→[Statistics]来查看。

在下面的[串流]区域内,已有各项发送数据统计数字,表示转发功能正常。注意:在转发时,VLC Media Player软件是没有画面显示和声音输出的,因此其视频和音频区域的“已显示的帧”和“已播放的缓冲器”的统计数字均为“0”。

2、客户端播放

由于转发服务端采用MMSH协议输出,因此只要打开Windows Media Player播放软件,通过[文件]→[打开URL],输入mms://192.168.1.2:1234或,播放软件经过片刻的连接和缓冲后,就可观看节目了,界面的最下方为播放速率。注意:如果转发服务端采用HTTP协议输出,则客户端只能输入地址。

3、使用注意事项

采用该方案关键是转发服务端设置,如果客户端无法播放,首先应该检查转发服务器有无串流输出。对于客户端只有伴音输出而没有画面播出的,则应该检查所选用的输出协议是否正确,其次是所选的视频编码器在客户端有无相应的解码包。

对于广播来讲,它是一种同时向大量客户传输数据的方法。在广播时,是通过使用广播发布点来实现的。在我们上面所介绍的两种方案中,广播发布点就是客户端要输入网址和端口号。使用广播方案时,接收广播的客户端是不能切换频道的,只能是播什么看什么。当服务端(DM500S)或转发服务端(台式机)换机时,客户端(笔记本电脑)软件需要重新启动播放功能。

H. 如何将vlc嵌入到android中

做vlc-android移植的道友都应该知道,当编译完vlc-android 源码后EventManager.java
类中定义了许多事件,下面是源码一部分:

public class EventManager {/*

* Be sure to subscribe to events you need in the JNI too.

*///public static final int MediaMetaChanged = 0;

//public static final int MediaSubItemAdded = 1;

//public static final int MediaDurationChanged = 2;

//public static final int MediaParsedChanged = 3;

//public static final int MediaFreed = 4;

//public static final int MediaStateChanged = 5;//public static final int MediaPlayerMediaChanged = 0x100;

//public static final int MediaPlayerNothingSpecial = 0x101;

//public static final int MediaPlayerOpening = 0x102;

//public static final int MediaPlayerBuffering = 0x103;

public static final int MediaPlayerPlaying = 0x104;

public static final int MediaPlayerPaused = 0x105;

public static final int MediaPlayerStopped = 0x106;......

}

可是对于这些事件有很多都被注释掉了,当我们需要被注释掉的事件时,就算把注释拿掉,再调用mEventManager.addHandler(EventManager.getInstance())添加事件之后,也不会在定义的mEventHandler
的handleMessage()中监听到,下面为一个mEventHandler定义的demo:

[java] view plain

private final VideoEventHandler mEventHandler = new VideoEventHandler(this);

private class VideoEventHandler extends WeakHandler<DtvPlayer>{

public VideoEventHandler(DtvPlayer owner) {

super(owner);

}

@Override

public void handleMessage(Message msg) {

DtvPlayer activity = getOwner();

if(activity == null) return;

switch (msg.getData().getInt("event")) {

case EventManager.MediaPlayerBuffering:

Log.d(TAG, "MediaPlayerBuffering");

break;

case EventManager.MediaPlayerEncounteredError:

Log.d(TAG, "MediaPlayerEncounteredError");

break;

......

default:

Log.e(TAG, String.format("Event not handled (0x%x)", msg.getData().getInt("event")));

break;

}

super.handleMessage(msg);

}

}

那么如何才能够在mEventHandler中监听到我们需要的事件呢,下面将进入主题。

在libvlcjni.c中有一个静态常量,其中指定了我们目前需要获取哪些事件:

[html] view plain

static const libvlc_event_type_t mp_events[] = {

libvlc_MediaPlayerPlaying,

libvlc_MediaPlayerPaused,

libvlc_MediaPlayerEndReached,

libvlc_MediaPlayerStopped,

libvlc_MediaPlayerVout,

libvlc_MediaPlayerPositionChanged

};

你可以将自己需要的事件添加在里面,然后将EventManager中响应的事件注释拿掉,之后重新编译源码就可以再mEventHandler中获取你刚添加的事件了。

(例如:你要想获取MediaPlayerEncounteredError事件,先将libvlc_MediaPlayerEncounteredError添加在mp_events[]静态常量中(注意,这里前面多了libvlc_),然后把EventManager中的public
static final int MediaPlayerEncounteredError =
0x10a;注释拿掉,重新编译源码之后就可以在你得mEventHandler
的handleMessage()中获取到EventManger.MediaPlayerEncounteredError事件)。

在vlc-android/vlc/lib/event.c中定义了所有事件:

[cpp] view plain

#define DEF( a ) { libvlc_##a, #a, },typedef struct

{

int type;

const char name[40];

} event_name_t;static const event_name_t event_list[] = {

DEF(MediaMetaChanged)

DEF(MediaSubItemAdded)

DEF(MediaDurationChanged)

DEF(MediaParsedChanged)

DEF(MediaFreed)

DEF(MediaStateChanged)DEF(MediaPlayerMediaChanged)

DEF(MediaPlayerNothingSpecial)

DEF(MediaPlayerOpening)

DEF(MediaPlayerBuffering)

DEF(MediaPlayerPlaying)

DEF(MediaPlayerPaused)

DEF(MediaPlayerStopped)

DEF(MediaPlayerForward)

DEF(MediaPlayerBackward)

DEF(MediaPlayerEndReached)

DEF(MediaPlayerEncounteredError)

DEF(MediaPlayerTimeChanged)

DEF(MediaPlayerPositionChanged)

DEF(MediaPlayerSeekableChanged)

DEF(MediaPlayerPausableChanged)

DEF(MediaPlayerTitleChanged)

DEF(MediaPlayerSnapshotTaken)

DEF(MediaPlayerLengthChanged)

DEF(MediaPlayerVout)DEF(MediaListItemAdded)

DEF(MediaListWillAddItem)

DEF(MediaListItemDeleted)

DEF(MediaListWillDeleteItem)DEF(MediaListViewItemAdded)

DEF(MediaListViewWillAddItem)

DEF(MediaListViewItemDeleted)

DEF(MediaListViewWillDeleteItem)DEF(MediaListPlayerPlayed)

DEF(MediaListPlayerNextItemSet)

DEF(MediaListPlayerStopped)DEF(MediaDiscovererStarted)

DEF(MediaDiscovererEnded)DEF(VlmMediaAdded)

DEF(VlmMediaRemoved)

DEF(VlmMediaChanged)

DEF(VlmMediaInstanceStarted)

DEF(VlmMediaInstanceStopped)

DEF(VlmMediaInstanceStatusInit)

DEF(VlmMediaInstanceStatusOpening)

DEF(VlmMediaInstanceStatusPlaying)

DEF(VlmMediaInstanceStatusPause)

DEF(VlmMediaInstanceStatusEnd)

DEF(VlmMediaInstanceStatusError)

};

#undef DEF

其中DEF()将MediaPlayerEncounteredError定义为libvlc_MediaPlayerEncounteredError,当本地代码产生MediaPlayerEncounteredError事件时会将libvlc_MediaPlayerEncounteredError传递给jni,与此同时jni又会传递给java层。不管是本地libvlc_MediaPlayerEncounteredError还是java层MediaPlayerEncounteredError,对于同一个事件被定义的值都是相同的,传输的是同一个消息值。本地代码定义在vlc-android/vlc/include/libvlc_events.h,
java代码定义在EventManager.java中。
转载

I. vlc是开源的还有开源的播放器吗

在github上搜索player就会有一堆

热点内容
炉石传说文件夹 发布:2024-05-13 03:05:11 浏览:265
百度识图缓存的图片在哪里 发布:2024-05-13 03:04:28 浏览:990
搬家公司源码 发布:2024-05-13 03:04:24 浏览:649
博士地编程 发布:2024-05-13 03:02:06 浏览:838
硫酸是怎么配置的 发布:2024-05-13 02:22:11 浏览:626
如何把安装密码弄没 发布:2024-05-13 02:16:36 浏览:24
中文转unicodephp 发布:2024-05-13 02:15:42 浏览:415
小白编程网 发布:2024-05-13 02:10:15 浏览:783
数学新算法 发布:2024-05-13 02:09:18 浏览:246
怎么改变文件存储的磁盘 发布:2024-05-13 01:53:50 浏览:558