filtering_audio.c File Reference

API example for audio decoding and filtering. More...

#include <unistd.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
#include <libavutil/opt.h>
Include dependency graph for filtering_audio.c:

Go to the source code of this file.

Functions

static int open_input_file (const char *filename)
 
static int init_filters (const char *filters_descr)
 
static void print_frame (const AVFrame *frame)
 
int main (int argc, char **argv)
 

Variables

const char * filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono"
 
const char * player = "ffplay -f s16le -ar 8000 -ac 1 -"
 
static AVFormatContextfmt_ctx
 
static AVCodecContextdec_ctx
 
AVFilterContextbuffersink_ctx
 
AVFilterContextbuffersrc_ctx
 
AVFilterGraphfilter_graph
 
static int audio_stream_index = -1
 

Detailed Description

API example for audio decoding and filtering.

Definition in file filtering_audio.c.

Function Documentation

static int init_filters ( const char *  filters_descr)
static

Definition at line 85 of file filtering_audio.c.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 188 of file filtering_audio.c.

static int open_input_file ( const char *  filename)
static

Definition at line 51 of file filtering_audio.c.

Referenced by main().

static void print_frame ( const AVFrame frame)
static

Definition at line 174 of file filtering_audio.c.

Referenced by main().

Variable Documentation

int audio_stream_index = -1
static

Definition at line 49 of file filtering_audio.c.

Referenced by init_filters(), main(), and open_input_file().

AVFilterContext* buffersink_ctx

Definition at line 46 of file filtering_audio.c.

Referenced by init_filters().

AVFilterContext* buffersrc_ctx

Definition at line 47 of file filtering_audio.c.

Referenced by init_filters().

AVCodecContext* dec_ctx
static
const char* filter_descr = "aresample=8000,aformat=sample_fmts=s16:channel_layouts=mono"

Definition at line 41 of file filtering_audio.c.

Referenced by main().

AVFilterGraph* filter_graph

Definition at line 48 of file filtering_audio.c.

AVFormatContext* fmt_ctx
static

Definition at line 44 of file filtering_audio.c.

const char* player = "ffplay -f s16le -ar 8000 -ac 1 -"

Definition at line 42 of file filtering_audio.c.

Referenced by main().