Created
February 5, 2014 18:44
-
-
Save pauldotknopf/8830358 to your computer and use it in GitHub Desktop.
FFMpegHelper.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
extern "C" | |
{ | |
#ifndef __STDC_CONSTANT_MACROS | |
#define __STDC_CONSTANT_MACROS | |
#endif | |
#include <libavcodec\avcodec.h> | |
#include <libavformat\avformat.h> | |
} | |
#pragma comment(lib, "..\\SDKs\\FFMPEG\\lib\\avcodec.lib") | |
#pragma comment(lib, "..\\SDKs\\FFMPEG\\lib\\avutil.lib") | |
#pragma comment(lib, "..\\SDKs\\FFMPEG\\lib\\avformat.lib") | |
typedef struct mux_ctx_t | |
{ | |
char *filename; | |
AVFormatContext * oc; | |
AVStream * video_st; | |
AVStream * audio_st; | |
AVOutputFormat * fmt; | |
uint8_t *audio_outbuf ; | |
int audio_outbuf_size ; | |
} mux_ctx_t; | |
class FFMpegHelper | |
{ | |
public: | |
FFMpegHelper(void); | |
~FFMpegHelper(void); | |
static int init_ffmpeg(mux_ctx_t *pMux_ctx, int VidWidth, int VidHeight, double frame_rate, int profile, int level, bool useAudio); | |
static int close_ffmpeg(mux_ctx_t *pMux_ctx); | |
private: | |
static AVStream *add_audio_stream (AVFormatContext *oc, int codec_id); | |
static void open_audio (AVFormatContext *oc, AVStream *st); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment