FFmpeg  2.1.1
Functions | Variables
demuxing.c File Reference

libavformat demuxing API use example. More...

#include <libavutil/imgutils.h>
#include <libavutil/samplefmt.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>

Go to the source code of this file.

Functions

static int decode_packet (int *got_frame, int cached)
 
static int open_codec_context (int *stream_idx, AVFormatContext *fmt_ctx, enum AVMediaType type)
 
static int get_format_from_sample_fmt (const char **fmt, enum AVSampleFormat sample_fmt)
 
int main (int argc, char **argv)
 

Variables

static AVFormatContextfmt_ctx = NULL
 
static AVCodecContextvideo_dec_ctx = NULL
 
static AVCodecContextaudio_dec_ctx
 
static AVStreamvideo_stream = NULL
 
static AVStreamaudio_stream = NULL
 
static const char * src_filename = NULL
 
static const char * video_dst_filename = NULL
 
static const char * audio_dst_filename = NULL
 
static FILE * video_dst_file = NULL
 
static FILE * audio_dst_file = NULL
 
static uint8_tvideo_dst_data [4] = {NULL}
 
static int video_dst_linesize [4]
 
static int video_dst_bufsize
 
static int video_stream_idx = -1
 
static int audio_stream_idx = -1
 
static AVFrameframe = NULL
 
static AVPacket pkt
 
static int video_frame_count = 0
 
static int audio_frame_count = 0
 

Detailed Description

libavformat demuxing API use example.

Show how to use the libavformat and libavcodec API to demux and decode audio and video data.

Definition in file demuxing.c.

Function Documentation

static int decode_packet ( int *  got_frame,
int  cached 
)
static

Definition at line 56 of file demuxing.c.

Referenced by main().

static int open_codec_context ( int *  stream_idx,
AVFormatContext fmt_ctx,
enum AVMediaType  type 
)
static

Definition at line 119 of file demuxing.c.

Referenced by main().

static int get_format_from_sample_fmt ( const char **  fmt,
enum AVSampleFormat  sample_fmt 
)
static

Definition at line 155 of file demuxing.c.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 184 of file demuxing.c.

Variable Documentation

AVFormatContext* fmt_ctx = NULL
static

Definition at line 37 of file demuxing.c.

AVCodecContext* video_dec_ctx = NULL
static

Definition at line 38 of file demuxing.c.

AVCodecContext * audio_dec_ctx
static

Definition at line 38 of file demuxing.c.

Referenced by decode_packet(), and main().

AVStream* video_stream = NULL
static

Definition at line 39 of file demuxing.c.

AVStream * audio_stream = NULL
static

Definition at line 39 of file demuxing.c.

Referenced by main().

const char* src_filename = NULL
static

Definition at line 40 of file demuxing.c.

Referenced by main(), and open_codec_context().

const char* video_dst_filename = NULL
static

Definition at line 41 of file demuxing.c.

Referenced by main().

const char* audio_dst_filename = NULL
static

Definition at line 42 of file demuxing.c.

Referenced by main().

FILE* video_dst_file = NULL
static

Definition at line 43 of file demuxing.c.

Referenced by decode_packet(), and main().

FILE* audio_dst_file = NULL
static

Definition at line 44 of file demuxing.c.

Referenced by decode_packet(), and main().

uint8_t* video_dst_data[4] = {NULL}
static

Definition at line 46 of file demuxing.c.

Referenced by decode_packet(), and main().

int video_dst_linesize[4]
static

Definition at line 47 of file demuxing.c.

Referenced by decode_packet(), and main().

int video_dst_bufsize
static

Definition at line 48 of file demuxing.c.

Referenced by decode_packet(), and main().

int video_stream_idx = -1
static

Definition at line 50 of file demuxing.c.

Referenced by decode_packet(), and main().

int audio_stream_idx = -1
static

Definition at line 50 of file demuxing.c.

Referenced by decode_packet(), and main().

AVFrame* frame = NULL
static

Definition at line 51 of file demuxing.c.

AVPacket pkt
static

Definition at line 52 of file demuxing.c.

Referenced by main().

int video_frame_count = 0
static

Definition at line 53 of file demuxing.c.

Referenced by decode_packet().

int audio_frame_count = 0
static

Definition at line 54 of file demuxing.c.

Referenced by decode_packet().