FFmpeg in Win32-Projekt einbinden

Danke sheel, hab ich gar nicht mehr dran gedacht. :)

Allerdings bekomme ich jetzt wieder haufenweise Fehlermeldungen, die Warscheinlich auf Bibliotheken und dlls zurückzuführen sind.
Hier mal die Ausgabe:
Code:
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void * __cdecl av_malloc(unsigned int)" (?av_malloc@@YAPAXI@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl av_free(void *)" (?av_free@@YAXPAX@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl av_freep(void *)" (?av_freep@@YAXPAX@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""char const * __cdecl av_get_sample_fmt_name(enum AVSampleFormat)" (?av_get_sample_fmt_name@@YAPBDW4AVSampleFormat@@@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl av_samples_get_buffer_size(int *,int,int,enum AVSampleFormat,int)" (?av_samples_get_buffer_size@@YAHPAHHHW4AVSampleFormat@@H@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl av_opt_set(void *,char const *,char const *,int)" (?av_opt_set@@YAHPAXPBD1H@Z)" in Funktion ""void __cdecl video_encode_example(char const *,int)" (?video_encode_example@@YAXPBDH@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl av_get_channel_layout_nb_channels(unsigned __int64)" (?av_get_channel_layout_nb_channels@@YAH_K@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""struct AVFrame * __cdecl av_frame_alloc(void)" (?av_frame_alloc@@YAPAUAVFrame@@XZ)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl av_frame_free(struct AVFrame * *)" (?av_frame_free@@YAXPAPAUAVFrame@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl avcodec_register_all(void)" (?avcodec_register_all@@YAXXZ)" in Funktion "_main".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""struct AVCodecContext * __cdecl avcodec_alloc_context3(struct AVCodec const *)" (?avcodec_alloc_context3@@YAPAUAVCodecContext@@PBUAVCodec@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_open2(struct AVCodecContext *,struct AVCodec const *,struct AVDictionary * *)" (?avcodec_open2@@YAHPAUAVCodecContext@@PBUAVCodec@@PAPAUAVDictionary@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_close(struct AVCodecContext *)" (?avcodec_close@@YAHPAUAVCodecContext@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl av_init_packet(struct AVPacket *)" (?av_init_packet@@YAXPAUAVPacket@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl av_free_packet(struct AVPacket *)" (?av_free_packet@@YAXPAUAVPacket@@@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""struct AVCodec * __cdecl avcodec_find_decoder(enum AVCodecID)" (?avcodec_find_decoder@@YAPAUAVCodec@@W4AVCodecID@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_decode_audio4(struct AVCodecContext *,struct AVFrame *,int *,struct AVPacket const *)" (?avcodec_decode_audio4@@YAHPAUAVCodecContext@@PAUAVFrame@@PAHPBUAVPacket@@@Z)" in Funktion ""void __cdecl audio_decode_example(char const *,char const *)" (?audio_decode_example@@YAXPBD0@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_decode_video2(struct AVCodecContext *,struct AVFrame *,int *,struct AVPacket const *)" (?avcodec_decode_video2@@YAHPAUAVCodecContext@@PAUAVFrame@@PAHPBUAVPacket@@@Z)" in Funktion ""int __cdecl decode_write_frame(char const *,struct AVCodecContext *,struct AVFrame *,int *,struct AVPacket *,int)" (?decode_write_frame@@YAHPBDPAUAVCodecContext@@PAUAVFrame@@PAHPAUAVPacket@@H@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""struct AVCodec * __cdecl avcodec_find_encoder(enum AVCodecID)" (?avcodec_find_encoder@@YAPAUAVCodec@@W4AVCodecID@@@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_encode_audio2(struct AVCodecContext *,struct AVPacket *,struct AVFrame const *,int *)" (?avcodec_encode_audio2@@YAHPAUAVCodecContext@@PAUAVPacket@@PBUAVFrame@@PAH@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_encode_video2(struct AVCodecContext *,struct AVPacket *,struct AVFrame const *,int *)" (?avcodec_encode_video2@@YAHPAUAVCodecContext@@PAUAVPacket@@PBUAVFrame@@PAH@Z)" in Funktion ""void __cdecl video_encode_example(char const *,int)" (?video_encode_example@@YAXPBDH@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl avcodec_fill_audio_frame(struct AVFrame *,int,enum AVSampleFormat,unsigned char const *,int,int)" (?avcodec_fill_audio_frame@@YAHPAUAVFrame@@HW4AVSampleFormat@@PBEHH@Z)" in Funktion ""void __cdecl audio_encode_example(char const *)" (?audio_encode_example@@YAXPBD@Z)".
1>decoding_encoding.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""int __cdecl av_image_alloc(unsigned char * * const,int * const,int,int,enum AVPixelFormat,int)" (?av_image_alloc@@YAHQAPAEQAHHHW4AVPixelFormat@@H@Z)" in Funktion ""void __cdecl video_encode_example(char const *,int)" (?video_encode_example@@YAXPBDH@Z)".
1>C:\Users\\documents\visual studio 2012\Projects\ConsoleApplication4\Debug\ConsoleApplication4.exe : fatal error LNK1120: 23 nicht aufgelöste Externe
========== Alles neu erstellen: 0 erfolgreich, 1 fehlerhaft, 0 übersprungen ==========

Die Librarys (lib) hab ich alle schon mit #pragma comment(lib, "libname.lib") hinzugefügt. Jetzt sind jedoch auch noch .def Dateien und .dll.a Dateien vorhanden. Muss ich diese auch hinzufügen? Falls ja wie?

Mfg
Hunter :)
 
Hallo Hunter

Die Libraries wurden mit C-Linkage erstellt, entsprechend darfst du die Namen nicht C++-dekorieren lassen, also Beispielsweise:
C++:
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>
}
 
Danke Cromon, leider hat dies keinen Unterschied gemacht, auch wenn es wichtig ist. :)


Ich hab gerade das Beispiel gefunden: http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio - Habe es versucht zu kompilieren, jedoch dort auch diesselben Fehler...


EDIT: Fehler gefunden! Da ich die 64Bit Version der Librarys verwendet habe funktionierte es nicht, mit der 32Bit Version funktionierts!

Danke nochmal an alle für die Hilfe :)
 
Zuletzt bearbeitet:
Noch eine Frage: Wie includiere ich die DLLs? Denn mir fehlt die avcodec-55.dll.
 
Zuletzt bearbeitet:
Hallo Hunter

DLLs werden nicht inkludiert, sie müssen einfach in einem der Suchpfade der Exe liegen (working directory, SetDllDirectory, system32/syswow64 folder, 16 bit system directory, windows directory, PATH - in der Reihenfolge)

Viele Grüsse
Cromon
 
Vielen Dank Cromon.

Jedoch ist das glaub ich nicht wirklich die richtige DLL, denn es kommt immer der Fehler:
Der Prozedureinsprungpunkt "av_frame_new_side_data" wurde in der DLL "C:\Users\...\documents\visual Studio 2012\Projects\ConcoleApplication4\Debug\avcodec-55.dll" nicht gefunden.

Ich weiß jetzt nicht von wo ich diese DLL jetzt herbekomme... Oder könnt ihr mir eine andere Bibliothek empfehlen?


Mfg
Hunter :)
 

Neue Beiträge

Zurück