Reputation: 1
i'm trying to use FFmpeg with visual sudio 2022 .NET 6 through an MSVC project. I followed this tutorial: https://www.youtube.com/watch?v=qMNr1Su-nR8&ab_channel=HakanSoyalp. I mean I have configureg Include (.h) file, library (.lib) files and dynamic (.dll) file copied into bin folder. If I call for example the avformat_alloc_context() method inside the avformat.lib all work rightly, if I call for example av_file_map(...) inside the avutil.lib the compiler give me an error: LNK2019 unresolved external symbol "int __cdecl av_file_map ... But the avutil.lib is linked!!! The same happen if I call other methods inside avutil.lib module.
Thanks for help...
Code:
extern "C"
{
#include <libavformat/avformat.h>
#include <libavutil/file.h> // av_file_map
}
int ConvertJPEGtoNALs(int argc, char* argv[])
{
AVFormatContext* fmt_ctx = NULL;
AVIOContext* avio_ctx = NULL;
uint8_t* buffer = NULL, * avio_ctx_buffer = NULL;
size_t buffer_size, avio_ctx_buffer_size = 4096;
char* input_filename = NULL;
int ret = 0;
struct buffer_data bd = { 0 };
if (argc != 2) {
fprintf(stderr, "usage: %s input_file\n"
"API example program to show how to read from a custom buffer "
"accessed through AVIOContext.\n", argv[0]);
return 1;
}
input_filename = argv[1];
/* register codecs and formats and other lavf/lavc components*/
//av_register_all(); //!deprecated
/* slurp file content into buffer */
ret = av_file_map(input_filename, &buffer, &buffer_size, 0, NULL);
/* fill opaque structure used by the AVIOContext read callback */
bd.ptr = buffer;
bd.size = buffer_size; ???
if (!(fmt_ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
goto end;
}
//... to be continue ...
}
Upvotes: 0
Views: 336