hvirtual/quicktime/ffmpeg/output_example.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "avformat.h"

Include dependency graph for output_example.c:

Go to the source code of this file.

Defines

#define M_PI   3.1415926535897931
#define STREAM_DURATION   5.0
#define STREAM_FRAME_RATE   25
#define STREAM_NB_FRAMES   ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT   PIX_FMT_YUV420P

Functions

AVStream * add_audio_stream (AVFormatContext *oc, int codec_id)
void open_audio (AVFormatContext *oc, AVStream *st)
void get_audio_frame (int16_t *samples, int frame_size, int nb_channels)
void write_audio_frame (AVFormatContext *oc, AVStream *st)
void close_audio (AVFormatContext *oc, AVStream *st)
AVStream * add_video_stream (AVFormatContext *oc, int codec_id)
AVFramealloc_picture (int pix_fmt, int width, int height)
void open_video (AVFormatContext *oc, AVStream *st)
void fill_yuv_image (AVFrame *pict, int frame_index, int width, int height)
void write_video_frame (AVFormatContext *oc, AVStream *st)
void close_video (AVFormatContext *oc, AVStream *st)
int main (int argc, char **argv)

Variables

float t
float tincr
float tincr2
int16_t * samples
uint8_t * audio_outbuf
int audio_outbuf_size
int audio_input_frame_size
AVFramepicture
AVFrametmp_picture
uint8_t * video_outbuf
int frame_count
int video_outbuf_size


Define Documentation

#define M_PI   3.1415926535897931

Definition at line 31 of file output_example.c.

#define STREAM_DURATION   5.0

Definition at line 37 of file output_example.c.

Referenced by main().

#define STREAM_FRAME_RATE   25

Definition at line 38 of file output_example.c.

Referenced by add_video_stream().

#define STREAM_NB_FRAMES   ((int)(STREAM_DURATION * STREAM_FRAME_RATE))

Definition at line 39 of file output_example.c.

Referenced by write_video_frame().

#define STREAM_PIX_FMT   PIX_FMT_YUV420P

Definition at line 40 of file output_example.c.

Referenced by add_video_stream().


Function Documentation

AVStream* add_audio_stream ( AVFormatContext *  oc,
int  codec_id 
)

AVStream* add_video_stream ( AVFormatContext *  oc,
int  codec_id 
)

AVFrame* alloc_picture ( int  pix_fmt,
int  width,
int  height 
)

Definition at line 224 of file output_example.c.

References av_free(), avcodec_alloc_frame(), avpicture_fill(), avpicture_get_size(), and NULL.

Here is the call graph for this function:

void close_audio ( AVFormatContext *  oc,
AVStream *  st 
)

Definition at line 166 of file output_example.c.

References audio_outbuf, av_free(), avcodec_close(), and samples.

Referenced by main().

Here is the call graph for this function:

void close_video ( AVFormatContext *  oc,
AVStream *  st 
)

Definition at line 380 of file output_example.c.

References av_free(), avcodec_close(), and video_outbuf.

Referenced by main().

Here is the call graph for this function:

void fill_yuv_image ( AVFrame pict,
int  frame_index,
int  width,
int  height 
)

Definition at line 293 of file output_example.c.

Referenced by write_video_frame().

void get_audio_frame ( int16_t *  samples,
int  frame_size,
int  nb_channels 
)

Definition at line 127 of file output_example.c.

References t, tincr, and tincr2.

Referenced by write_audio_frame().

int main ( int  argc,
char **  argv 
)

void open_audio ( AVFormatContext *  oc,
AVStream *  st 
)

void open_video ( AVFormatContext *  oc,
AVStream *  st 
)

void write_audio_frame ( AVFormatContext *  oc,
AVStream *  st 
)

void write_video_frame ( AVFormatContext *  oc,
AVStream *  st 
)


Variable Documentation

Definition at line 49 of file output_example.c.

Referenced by open_audio(), and write_audio_frame().

uint8_t* audio_outbuf

Definition at line 47 of file output_example.c.

Referenced by close_audio(), open_audio(), and write_audio_frame().

Definition at line 48 of file output_example.c.

Referenced by open_audio(), and write_audio_frame().

int16_t* samples

Definition at line 46 of file output_example.c.

float t

float tincr

Definition at line 45 of file output_example.c.

Referenced by audio_encode_example(), get_audio_frame(), and open_audio().

float tincr2

Definition at line 45 of file output_example.c.

Referenced by get_audio_frame(), and open_audio().

Definition at line 177 of file output_example.c.

uint8_t* video_outbuf

Definition at line 178 of file output_example.c.

Referenced by close_video(), open_video(), and write_video_frame().

Definition at line 179 of file output_example.c.

Referenced by open_video(), and write_video_frame().


Generated on Mon Apr 28 14:06:48 2008 for Cinelerra by  doxygen 1.5.5