0

私が実際に望んでいるのは、ffMPEGを使用して、ビデオのフレームをchar配列に格納することです。
制約は、MSVCのみを使用することです。保守性の問題により 、 Windowsの構築の微調整を使用することは許可されていません。

そのため、共有ビルドを使用してタスクを実行することを検討してください。DLLのみで構成されています。ファイルがないlibので、を使用してDLLの1つをロードしてみましたが、HINSTANCE hInstLibrary = LoadLibrary("avcodec-54.dll");動作します。しかし、このDLLのインターフェイスはどこにも公開されていませんでした。誰かがこれを手伝ってもらえますか?呼び出すことができるDLLの関数と、ビデオフレームを取得するために渡すことができるパラメーターを知るにはどうすればよいですか?

4

1 に答える 1

2

からffmpegのパブリックインターフェイスを使用します

ffmpegdir/include/libavcodec/
ffmpegdir/include/libavformat/
etc.

たとえば、読み取り用にファイルを開くには、ffmpegdir / include / libavformat/avformat.hのavformat_open_inputを使用します。

AVFormatContext * ctx= NULL;
int err = avformat_open_input(&ctx, file_name, NULL, NULL);

ffmpegの最新ビルドはhttp://ffmpeg.zeranoe.com/builds/から入手できます。

パブリックヘッダーファイルは、開発ビルド(http://ffmpeg.zeranoe.com/builds/win32/dev/)にあります。

UPD: これが実際の例です(追加の静的リンクはありません)

#include "stdafx.h"
#include <windows.h>
#include <libavformat/avformat.h>

typedef int (__cdecl *__avformat_open_input)(AVFormatContext **, const char *, AVInputFormat *, AVDictionary **);
typedef void (__cdecl *__av_register_all)(void);

int _tmain(int argc, _TCHAR* argv[])
{
    const char * ffp = "f:\\Projects\\Temp\\testFFMPEG\\Debug\\avformat-54.dll";
    HINSTANCE hinstLib = LoadLibraryA(ffp);
    __avformat_open_input __avformat_open_input_proc  = (__avformat_open_input)GetProcAddress(hinstLib, "avformat_open_input");

    __av_register_all __av_register_all_proc = (__av_register_all)GetProcAddress(hinstLib, "av_register_all");
    __av_register_all_proc();

    ::AVFormatContext * ctx = NULL;
    int err = __avformat_open_input_proc(&ctx, "g:\\Media\\The Sneezing Baby Panda.flv", NULL, NULL);
    return 0;
  }
于 2012-11-07T07:38:17.433 に答える