How to Use FFmpeg in VC++ 2010

For the developers that use FFmpeg in their software.
Post Reply
kaushal
Posts: 9
Joined: Tue Jun 27, 2017 4:13 am

How to Use FFmpeg in VC++ 2010

Post by kaushal » Tue Jun 27, 2017 4:24 am

Hello Friends,

i want to use FFmpeg in my VC++ 2010 Project. plz tell me

which flavor/version i have to download as there are many flavor/version available like static, shared and dev. ?
https://ffmpeg.zeranoe.com/builds/

and what is the procedure to add this tool to my project or how to use this in vc++ project?

i have windows 10 Running on 64 bit machine and i am using VC++ 2010 version.

Regards

kaushal

User avatar
Zeranoe
Site Admin
Posts: 703
Joined: Sat May 07, 2011 7:12 pm
Contact:

Re: How to Use FFmpeg in VC++ 2010

Post by Zeranoe » Wed Jun 28, 2017 4:23 pm

You'll need the shared and dev builds. After that you can use the def provided to create a lib and link against that.

kaushal
Posts: 9
Joined: Tue Jun 27, 2017 4:13 am

Re: How to Use FFmpeg in VC++ 2010

Post by kaushal » Thu Jun 29, 2017 7:07 am

You'll need the shared and dev builds.

both shared and dev from https://ffmpeg.zeranoe.com/builds/ ..?

After that you can use the def provided to create a lib and link against that.

Adding path to tool build properties like in VC++ 2010

1. Project property-->VC++ Directories--> Include Directories--> { path of downloaded shared & dev include folder}

2. Project property-->Linker-->Input-->Additional Dependencies-->{ path of downloaded shared & dev lib folder}

---------------------------
i have download the dev build from https://ffmpeg.zeranoe.com/builds/
Version: 20170628-c1d1274
Architecture: 64 bit
Linking : Dev

after building the sample code i got following errors (attached)

sample code is the one provided by ffmpeg (muxing.c)
ffmpeg-20170626-3594788-win64-dev-->doc-->example-->muxing.c


Regards

kaushal
Attachments
error-1.jpg
error-1.jpg (522.14 KiB) Viewed 2648 times

kaushal
Posts: 9
Joined: Tue Jun 27, 2017 4:13 am

Re: How to Use FFmpeg in VC++ 2010

Post by kaushal » Fri Jun 30, 2017 11:18 am

in this issue after adding following header files in Sample Code.

#include "C:\ffmpeg-3.3.2\ffmpeg\header\stdint.h"
#include "C:\ffmpeg-3.3.2\ffmpeg\header\inttypes.h"

the error message change now i have two errors (below)

Error 1 error C1189: #error : missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS c:\ffmpeg-3.3.2\ffmpeg\include\libavutil\timestamp.h 30
2 IntelliSense: #error directive: missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS c:\ffmpeg-3.3.2\ffmpeg\include\libavutil\timestamp.h 30

kaushal
Posts: 9
Joined: Tue Jun 27, 2017 4:13 am

Re: How to Use FFmpeg in VC++ 2010

Post by kaushal » Thu Jul 06, 2017 8:25 am

Hello Thanx for your time.

Problem is sorted out by putting header files extern to main() body .

1. #define __STDC_CONSTANT_MACROS


2. extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}

int main( int argc, char* argv[] ) {
av_register_all();
return 0;
}



Regards

kaushal

Post Reply
'