FFmpeg安裝與測試


時間:2020年9月30日,學習FFmpeg!

學習版本:N-99352-gd8ce8e8

下載:

https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2

安裝:

1. Type `./configure` to create the configuration. A list of configure options is printed by running `configure --help`.

 ./configure --prefix=FFmpeg --disable-shared --enable-static --disable-x86asm

在這里為了方便移植,僅僅編譯出了靜態庫,並且把所有的庫安裝在了自定義文件夾FFmpeg里面!

2. Then type `make` to build FFmpeg.

make

3. Type `make install` to install all binaries and libraries you built.

make install

簡單測試:

在ffmpeg根目錄下建立文件夾Example,並添加以下c文件。

#include <stdio.h>
#include "../FFmpeg/include/libavformat/avformat.h"
#include "../FFmpeg/include/libavcodec/avcodec.h"
#include "../FFmpeg/include/libavdevice/avdevice.h"
int main() {

    void * iterate = NULL;
    const AVOutputFormat *inputFormat = av_muxer_iterate(&iterate);
    const AVInputFormat *outputFormat = av_demuxer_iterate(&iterate);
    while (inputFormat) {
        printf("[In][%15s]\n", inputFormat->name);
        inputFormat = av_muxer_iterate(&iterate);
    }
    while (outputFormat) {
        printf("[Out][%15s]\n", outputFormat->name);
        outputFormat = av_demuxer_iterate(&iterate);
    }

    return 0;
}

編譯:

gcc -o demo demo.c   -I../FFmpeg/include -L../FFmpeg/lib/ -lavformat -lavfilter -lavcodec -lswscale -lavutil -lswresample  -lm -lpthread -lavdevice -lz -llzma

運行:

./demo

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM