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

mingw編譯vlc

發布時間: 2023-06-18 23:04:56

『壹』 如何使 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編碼了。

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

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

『叄』 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/

『肆』 Mingw 如何編譯進程函數

MinGW用的是Windows的API來實現這些功能。網上去找這些函數的使用說明,模仿示例代碼,多試幾次

信號燈是啥……我只知道信號量,是說semaphore嗎?
CreateSemaphore創建信號量/CloseHandle關閉信號量/ReleaseSemaphore釋放信號量資源/WaitForSingleObject獲取一個信號量資源

CreateFileMapping創建共享內存對象/CloseHandle關閉共享內存對象/MapViewOfFile映射共享內存/UnmapViewOfFile取消映射共享內存

創建的對象和Linux那一套函數不同,默認是不會繼承到CreateProcess創建的子進程里,你需要SetHandleInformation來允許它繼承。(對於有名字的這類對象,除了直接繼承、也可以在子進程里用名字打開)

內容太多太復雜,自己去搜。或者要書的話,推薦一本《Windows核心編程

『伍』 如何使用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地址。

『陸』 mingw安裝完後該如何編譯C語言

應該是先安裝MSYS,再安裝
mingw , 在mingw文件夾裡面應該有個bin
文件夾 ,留意一下該文件夾裡面「應該」有gcc.exe的應用程序,假設該bin文件夾的全稱路徑是X:\..\mingw\bin,那麼將它添加將它添加到環境變數裡面。
上面是配置環境,下面是編譯運行一個C程序:
在比如新建"D:\main.c"文件,裡面寫main(){
printf("Hello!\n");
},保存;
然後打開cmd控制台,執行:gcc
D:\main.c
-o
D:\main.exe
這個時候D盤會生成名為main的應用程序,控制台繼續執行:D:\main.exe
就運行了,應該顯示出Hello!了

『柒』 如何在Windows里的MingW里編譯安裝OpenCV2.4.X

安裝方法:1、下載opencv for windows安裝包,目前最新的安裝包opencv-2.4.8版本。雙擊打開解壓,如:解壓目錄為D:\Program Files。2、解壓後D:\Program Files下多了一個opencv文件夾,裡面只有兩個文件,如下圖所示:

『捌』 在windows平台如何用MinGW編譯工程工程中有Makefile.an和Makefile.in文件,要輸入什麼命令呢

在mingw下,安裝automake,Makefile.an和.in應該是automake要用到得,需要通過automake生成configure,具體再看automake相關部分

熱點內容
java位與運算 發布:2025-02-08 18:48:22 瀏覽:217
sift演算法詳解 發布:2025-02-08 18:35:23 瀏覽:580
linux標准錯誤的是 發布:2025-02-08 18:32:07 瀏覽:916
蠻多小說怎麼緩存書架的小說 發布:2025-02-08 18:30:16 瀏覽:889
光遇花開腳本封號嗎 發布:2025-02-08 18:23:15 瀏覽:535
怎麼弄ld帳號和密碼 發布:2025-02-08 18:11:42 瀏覽:629
新逍客20發動機壓縮比 發布:2025-02-08 17:58:10 瀏覽:116
qq號和密碼我都知道為什麼登不上 發布:2025-02-08 17:52:21 瀏覽:873
寶塔伺服器ip進不去 發布:2025-02-08 17:52:18 瀏覽:383
擔保中介源碼 發布:2025-02-08 17:14:37 瀏覽:413