當前位置:首頁 » 編程軟體 » vlcmingw編譯

vlcmingw編譯

發布時間: 2023-04-16 06:57:52

① 求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

② vlc for android 源碼能不能在windows環境下編譯

1. 准備編譯環境

基本上按照這篇wiki的介紹就足夠了,為了順利完成編譯,建議首先保證相關的軟體或者依賴庫都已經下載好了,我再強調一下幾個重點注意事項。

(1) Android SDK:必須使用SDK Platform Android 5.0, API 21,因為VLC-for-android用到了Android 5.0 的一些API。

(2) 最好通過apt-get install 把下面這些依賴的軟體都安裝一遍,或更新到最新版

git,apache-ant (or ant), autoconf, automake, autopoint, cmake,
gawk (or nawk), gcc, g++, libtool, m4, patch, pkg-config, ragel,
subversion, unzip.

2. 下載源碼包

直接通過git下載VLC-for-android最新的源碼即可:

git clone git://git.videolan.org/vlc-ports/android.git

3. 編譯VLC源碼和VLC Android工程

(1) 配置編譯環境變數

具體參考wiki的介紹,你可以寫個shell腳本來執行,避免每次編譯都要配置,下面是我的環境變數,可以根據你的路徑修改:

#! /bin/sh

export ANDROID_SDK=/opt/android/sdk/

export ANDROID_NDK=/opt/android/android-ndk-r10/

export ANT_DIR=/opt/android/ant/

export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:$ANT_DIR

export ANDROID_ABI=armeabi-v7a

(2) 執行編譯

sh compile.sh

VLC不愧是使用這么廣泛的播放器,它的編譯腳本寫得非常強大和智能,直接通過執行compile.sh,它會自動check所有的依賴,並通過網路去下載缺失的庫。

首先,它會下載vlc的源碼,並存放在當前目錄下。然後去下載依賴的第三方庫文件。

當然,由於GFW的存在,有的時候下載會失敗,這個時候,就需要你手動去Google搜索它正在下載的依賴文件,手動下載好了之後放到 vlc/contrib/tarballs目錄下,然後再回到命令行重新執行 sh compile.sh

它依賴的全部第三方庫文件如圖所示:

(3) 編譯問題

編譯過程還算順利,只出現過一個大問題,如下:

google/protobuf/unittest.proto:853:21: Missing field number.

google/protobuf/unittest.proto:862:1: Reached end of input in message definition (missing '}').

make[3]: *** [unittest_proto_middleman] Error 1

網上也搜不到解決方案,我看了下GitHub上Protobuf的Readme,然後下載了最新的protobuf放到vlc/contrib
/tarballs/contrib-android-arm-linux-androideabi/protobuf目錄下,執行.
/configure --disable-shared,再編譯,沒想到就直接過了。

4. 載入VLC-For-Android的Java工程

編譯通過後,就可以直接在vlc-android/bin目錄下看到debug版的apk了,下面簡單說說在Eclipse中載入vlc-android的整個工程。

打開Eclipse,選擇Import,把vlc-for-android目錄下所有的工程到導入到Eclipse中(我去掉了TV工程),如圖所
示,有5個必須的工程,其中,VLC是主工程,其他四個都是Lib工程。沒有什麼意外的話,直接運行VLC工程,就可以在Android手機上看到VLC
播放器應用了!

③ 如何使 vlc 支持 fdk-aac 編碼windows平台

可能是由於fdk-aac開源協議的原因,VLC默認是不支持fdk-aac編碼的,fdk-aac 是非常優秀的AAC編碼庫,並且支持AAC-LD AAC-ELD, 對於要求低延遲的場景下很有用。
可以通過修改VLC的編譯腳本,並加入fdkaac庫來使用VLC支持fdkaac編碼器。
我是在64位的ubuntu16.04下編譯的,vlc的編譯方法參考VLC官網的編譯文檔。

1 修改vlc/extras/package/win32/configure.sh , 加入--enable-fdkaac, 這樣VLC就會編譯fdkaac這個模塊。
執行make,會出現編譯錯誤
as/package/win32/../../../moles/codec/fdkaac.c:56:32: fatal error: fdk-aac/aacenc_lib.h: No such file or directory
這是因為缺少fdk-aac庫相關的頭文件。

2 編譯fdk-aac庫
下載源碼https://github.com/mstorsjo/fdk-aac.git
在terminal下進入源碼目錄,輸入
mkdir winBuild
cd winBuild
../configure --host=i686-w64-mingw32 --prefix=VLCPATH/contrib/i686-w64-mingw32
make install

VLCPATH 替換成VLC代碼的路徑

3 編譯VLC代碼
make packag-win32-zip
這時應該可以編譯通過了, 在mole/codec/ 目錄下會生成libfakaac_plugin.dll文件。
還需要把這個模塊依賴的VLCPATH/contrib/i686-w64-mingw32/libfdk-aac-1.dll動態庫復制到這個目錄下。

現在VLC就可以支持fdk-aac編碼了。

④ 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/

⑤ VLC源代碼包如何在linux下編譯+調試

你是為了裝軟體還是為了學習?如果只是裝個軟體,為什麼不裝二進製版的呢(.deb .rpm)。自己編譯挺麻煩的。
如果非想自己編譯,一般都是(我沒編譯過VLC,編譯過其他的,感覺像VLC這么大的軟體應該得較長時間!):先解壓下載的源碼包(tar.bz),然後從終端進入解壓後的源碼目錄,在終端輸入:一 ./configure ;二 make ;三 make install ;
一,好像是為了檢查當前系統參數,也可以在後面加環境變數參數(./configure [options])。如果沒問題便生成makefile
二,根據makefile編譯
三,編譯安裝。(二,可省略)
其實,不管是windows還是linux下載了軟體解壓後第一件事是讀readme!!!!!!!!!!!(其實你應該自己看readme和install,因為別人也不知道你下的軟體什麼情況,這兩個文件一般都會告訴你怎樣安裝以及軟體依賴什麼包!!)
再是讀install ,這是基本素質。要養成自覺性,這在linux下尤為重要!

至於調試,比較麻煩,不過如果只是裝軟體而不改代碼的情況下,不用專門調試(難道你還要用專門工具調試?) 既然說是菜鳥,又稿這么復雜的東西,並且搞這么復雜的東西又不在更專業的地方提問,網路知道一般是解決日常問題的地方!!!
不過一般情況下執行上述三步時會報錯,根據它報錯情況自己想辦法解決,一般來說是依賴不能滿足!

⑥ 編譯VLC出錯,請幫我看看是怎麼回事

運行./compile 的出現兩個error:
ERROR : glx.c:49: 36: X11/extensions/XShm.h: No such file or directory
In file included from glx.c:57:
ERROR : xcommon.h: 357: expected specifier-qualifier-list before 'XShmSegmentInfo'
make: *** [all] Error 2
-------------------------------------------------------------------------------------
好像都是X11/extensions的問題,裝xorg-dev這個包

⑦ windows平台下編譯vlc,使用的是mingw+msys,到了make prebuilt,出現了pkg-config command not found

做這么專業的工作,還用WINDOWS。

⑧ 解決Android Vlc編譯報錯couldn't find "libcompat.7.so

在build.gradle的defaultConfig下面添卜讓困加

ndk{

    abiFilters"armeabi","armeabi-v7a","x86","mips"

}

重新編譯即可。。

具體什麼原因。。低級錯誤就型念不解釋滑基了

⑨ 如何使用FFMPEG+H264實現RTP傳輸數據

開發環境:
WINDOWS7 32bit
MINGW
eclipse juno cdt
1、首先你要編譯好FFMPEG,
a) 方法一:可以去官網下載源碼,用MINGW編譯(編譯時記得支持H264,當然,事先得下載並編譯好libx264,視頻技術論壇里有很多介紹)
b) 方法二:更加省心省力的方法是,下載別人已經編譯好的資源,如ZeranoeFFmpeg的冊好賀,下載他的襪前dev版本,包含了頭文件,鏈接庫等必須的東西,當然,這東西已經是支持H264的了。
2、以下的就是代碼部分了:
a) 先聲明必要的變數:
AVFormatContext *fmtctx;
AVStream *video_st;
AVCodec *video_codec;
const int FPS = 25; /* 25 images/s */
const char *RDIP = 「127.0.0.1」;
unsigned int RDPORT = 5678;
const unsigned int OUTWIDTH = 720;
const unsigned int OUTHEIGHT = 480;
av_register_all();
avformat_network_init();

b) 初始化AV容器
fmtctx = avformat_alloc_context();

c) 獲得輸出格式,這里是RTP網路流
fmtctx->oformat = av_guess_format("rtp", NULL, NULL);

d)打開網路流
snprintf(fmtctx->filename, sizeof(fmtctx->filename),"rtp://%s:%d",RDIP,RDPORT);
avio_open(&fmtctx->pb,fmtctx->filename, AVIO_FLAG_WRITE)

e) 開始添加H264視頻流
video_st = NULL;video_st = add_video_stream(fmtctx, &video_codec, AV_CODEC_ID_H264);

其中,add_video_stream函數為:
add_video_stream(AVFormatContext *oc,AVCodec **codec, enum AVCodecID codec_id)
{
AVCodecContext *c;
AVStream *st;
/* find the video encoder */
*codec = avcodec_find_encoder(codec_id);
st = avformat_new_stream(oc, *codec);
c = st->codec;
avcodec_get_context_defaults3(c, *codec);
c->codec_id = codec_id;
c->width = OUTWIDTH;
c->州派height = OUTHEIGHT;
c->time_base.den = FPS;
c->time_base.num = 1;
c->pix_fmt = PIX_FMT_YUV420P;
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
c->flags|= CODEC_FLAG_GLOBAL_HEADER;
av_opt_set(c->priv_data, "preset", "ultrafast", 0);
av_opt_set(c->priv_data, "tune","stillimage,fastdecode,zerolatency",0);
av_opt_set(c->priv_data, "x264opts","crf=26:vbv-maxrate=728:vbv-bufsize=364:keyint=25",0);return st;}
// OPEN THE CODE
avcodec_open2(video_st->codec, video_codec, NULL);
/* Write the stream header, if any. */
avformat_write_header(fmtctx, NULL);

f) 現在,就可以不斷的編碼數據,並發生數據了
AVFrame* m_pYUVFrame = avcodec_alloc_frame();
while(1) //這里設置成無限循環,你可以設置成250,或其他數進行測試,觀看結果
{
fill_yuv_image(m_pYUVFrame, video_st->codec->frame_number,OUTWIDTH, OUTHEIGHT);
/* encode the image */
AVPacket pkt;
int got_output = 0;
av_init_packet(&pkt);
pkt.data = NULL; // packet data will be allocated by the encoder
pkt.size = 0;
pkt.pts = AV_NOPTS_VALUE;
pkt.dts =AV_NOPTS_VALUE;
m_pYUVFrame->pts = video_st->codec->frame_number;
ret = avcodec_encode_video2(c, &pkt,frame, &got_output);
if (ret < 0) {fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
exit(1);
}
/* If size is zero, it means the image was buffered. */
if (got_output)
{
if (c->coded_frame->key_frame)pkt.flags |= AV_PKT_FLAG_KEY;
pkt.stream_index = st->index;
if (pkt.pts != AV_NOPTS_VALUE )
{
pkt.pts = av_rescale_q(pkt.pts,video_st->codec->time_base, video_st->time_base);
}
if(pkt.dts !=AV_NOPTS_VALUE )
{
pkt.dts = av_rescale_q(pkt.dts,video_st->codec->time_base, video_st->time_base);
}
/* Write the compressed frame to the media file. */
ret = av_interleaved_write_frame(oc,&pkt);
}
else {
ret = 0;
}
}

g) Fill_yuv_image函數:
/* Prepare a mmy image. */
static void fill_yuv_image(AVPicture *pict,int frame_index,int width, int height)
{
int x, y, i;
i = frame_index;
/* Y */
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
pict->data[0][y * pict->linesize[0] +x] = x + y + i * 3;
/* Cb and Cr */
for (y = 0; y < height / 2; y++)
{
for (x = 0; x < width / 2; x++)
{
pict->data[1][y * pict->linesize[1] +x] = 128 + y + i * 2;
pict->data[2][y * pict->linesize[2] +x] = 64 + x + i * 5;
}
}
}

h) 列印sdp信息,僅需一次,列印的sdp信息,用在VLC播放器結束網路視頻流時用到
//列印sdp信息
char sdp[2048];
av_sdp_create(&fmtctx,1, sdp, sizeof(sdp));
printf("%s\n",sdp);
fflush(stdout);

i)最後,做一些清理工作
avcodec_free_frame(&m_pYUVFrame);
av_write_trailer(fmtctx);
/* Free the streams. */
for (unsigned int i = 0; i< fmtctx->nb_streams;i++)
{
av_freep(&fmtctx->streams->codec);
av_freep(&fmtctx->streams);
}
if(!(fmtctx->oformat->flags& AVFMT_NOFILE))
/* Close the output file. */
avio_close(fmtctx->pb);
/*free the stream */
av_free(fmtctx);

3、編譯代碼,記得添加庫文件,運行一次代碼,不用死循環,設置不用循環,因為是要讓他列印出sdp文件的信息。得到sdp信息,比如我精簡成如下:
c=IN IP4 127.0.0.1
m=video 56782 RTP/AVP 96
a=rtpmap:96 H264/90000
a=framerate:25
a=fmtp:96 packetization-mode=1

把這些信息保存到一個文本文件,並改名為sdp後綴,如mySDP.sdp。
4、從官網下載VLC播放器,重新運行上述的代碼,這一次要循環,具體循環多久,你自己決定,這一次是正式測試了。代碼跑起來後,把剛剛的sdp文件用VLC打開,直接把sdp文件拖到VLC播放器中就行了。等待緩沖,就可以看到效果了。
5、代碼中剩掉了出錯檢查部分,請自行添加。
6、關於IP地址,這里是127.0.0.1,是供本機測試,可以改成制定的接受數據的電腦IP地址,或者廣播地址IP地址。

⑩ 要做畢業設計,正在學習VLC,問個小白的問題,VLC一定要自己編譯么網上下載和自己編譯的有什麼區別呢

你自己編譯和網上你下載的版本的編譯連接選項可能不一樣,可能甚至編譯器都不一樣,所以最終生成的vlc可執行程序當然是不一樣的。vlc的編解碼器好多都是用的ffmpeg的,還用到一些版權保護的編譯器,你自己的本地機器上衫敏滲拿檔可能沒有,所以或脊,最終生成的vlc幾乎不可能和他的一樣。

問一句,畢業設計學vlc,用來做什麼呢?編解碼的話,直接ffmpeg就可以了。

熱點內容
商湯科技存儲負責人 發布:2025-07-15 01:24:21 瀏覽:252
文件夾如何批量替換文件名 發布:2025-07-15 01:19:15 瀏覽:68
ftp上傳網頁 發布:2025-07-15 01:13:09 瀏覽:182
音樂文件夾圖標 發布:2025-07-15 01:03:41 瀏覽:494
安卓機怎麼反向充電 發布:2025-07-15 01:03:40 瀏覽:501
電腦使用華為雲伺服器 發布:2025-07-15 00:48:10 瀏覽:534
中考應該如何排解壓力 發布:2025-07-15 00:17:54 瀏覽:362
安卓第三方應用軟體是什麼 發布:2025-07-15 00:12:06 瀏覽:149
程序業務配置存儲 發布:2025-07-14 23:52:16 瀏覽:685
csdn編程挑戰 發布:2025-07-14 23:52:08 瀏覽:791