doc/examples/muxing.c File Reference

libavformat API example. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "libavutil/mathematics.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"

Go to the source code of this file.

Defines

#define STREAM_DURATION   200.0
#define STREAM_FRAME_RATE   25
#define STREAM_NB_FRAMES   ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT   PIX_FMT_YUV420P

Functions

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

Variables

static int sws_flags = SWS_BICUBIC
static float t
static float tincr
static float tincr2
static int16_tsamples
static uint8_t * audio_outbuf
static int audio_outbuf_size
static int audio_input_frame_size
static AVFramepicture
static AVFrametmp_picture
static uint8_t * video_outbuf
static int frame_count
static int video_outbuf_size


Detailed Description

libavformat API example.

Output a media file in any supported libavformat format. The default codecs are used.

Definition in file muxing.c.


Define Documentation

#define STREAM_DURATION   200.0

Definition at line 43 of file muxing.c.

Referenced by main().

#define STREAM_FRAME_RATE   25

Definition at line 44 of file muxing.c.

Referenced by add_video_stream().

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

Definition at line 45 of file muxing.c.

Referenced by write_video_frame().

#define STREAM_PIX_FMT   PIX_FMT_YUV420P

Definition at line 46 of file muxing.c.

Referenced by add_video_stream().


Function Documentation

static AVStream* add_audio_stream ( AVFormatContext oc,
enum CodecID  codec_id 
) [static]

Definition at line 62 of file muxing.c.

Referenced by main().

static AVStream* add_video_stream ( AVFormatContext oc,
enum CodecID  codec_id 
) [static]

Definition at line 198 of file muxing.c.

Referenced by main().

static AVFrame* alloc_picture ( enum PixelFormat  pix_fmt,
int  width,
int  height 
) [static]

Definition at line 252 of file muxing.c.

Referenced by event_loop(), and open_video().

static void close_audio ( AVFormatContext oc,
AVStream st 
) [static]

Definition at line 182 of file muxing.c.

Referenced by main().

static void close_video ( AVFormatContext oc,
AVStream st 
) [static]

Definition at line 424 of file muxing.c.

Referenced by main().

static void fill_yuv_image ( AVFrame pict,
int  frame_index,
int  width,
int  height 
) [static]

Definition at line 325 of file muxing.c.

Referenced by write_video_frame().

static void get_audio_frame ( int16_t samples,
int  frame_size,
int  nb_channels 
) [static]

Definition at line 142 of file muxing.c.

Referenced by write_audio_frame().

int main ( int  argc,
char **  argv 
)

Definition at line 439 of file muxing.c.

static void open_audio ( AVFormatContext oc,
AVStream st 
) [static]

Definition at line 91 of file muxing.c.

Referenced by main().

static void open_video ( AVFormatContext oc,
AVStream st 
) [static]

Definition at line 272 of file muxing.c.

Referenced by main().

static void write_audio_frame ( AVFormatContext oc,
AVStream st 
) [static]

Definition at line 157 of file muxing.c.

Referenced by main().

static void write_video_frame ( AVFormatContext oc,
AVStream st 
) [static]

Definition at line 347 of file muxing.c.

Referenced by main().


Variable Documentation

int audio_input_frame_size [static]

Definition at line 57 of file muxing.c.

Referenced by open_audio(), and write_audio_frame().

uint8_t* audio_outbuf [static]

Definition at line 55 of file muxing.c.

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

int audio_outbuf_size [static]

Definition at line 56 of file muxing.c.

Referenced by open_audio(), and write_audio_frame().

int frame_count [static]

Definition at line 195 of file muxing.c.

Referenced by a64_write_packet(), rl2_read_header(), write_video_frame(), and yop_read_seek().

AVFrame* picture [static]

int16_t* samples [static]

int sws_flags = SWS_BICUBIC [static]

Definition at line 48 of file muxing.c.

Referenced by queue_picture(), and write_video_frame().

float t [static]

Definition at line 53 of file muxing.c.

Referenced by adpcm_compress_trellis(), alaw2linear(), altivec_packIntArrayToCharArray(), analyze_plane(), assert_avoptions(), audio_encode_example(), av_add_sf(), av_aes_init(), av_cmp_sf(), av_dict_copy(), av_normalize1_sf(), av_opt_set_dict(), av_parse_time(), av_size_mult(), av_timegm(), avformat_find_stream_info(), avi_write_header(), bessel(), block_cmp(), block_diffs_C(), bmp_decode_frame(), body(), butterflies_float_c(), checksum_plane(), config_props(), crazytime_to_iso8601(), dca_downmix(), decode_band(), decode_cce(), decode_end(), decode_frame(), decode_group3_1d_line(), decode_group3_2d_line(), decode_init(), decode_run_2bit(), decode_subband_slice_buffered(), deghost_plane(), dering_TMPL(), diff_to_drop_plane(), draw_mandelbrot(), dv_init_mux(), encode_block(), encode_frame(), encode_picture_ls(), end_frame(), ff_amf_tag_contents(), ff_amf_tag_size(), ff_id3v2_write(), ff_ivi_free_buffers(), ff_j2k_tag_tree_init(), ff_jpegls_decode_picture(), ff_mjpeg_find_marker(), ff_pca(), ff_rtmp_packet_read(), ff_vorbis_comment(), ff_vp3_idct_add_altivec(), ff_vp3_idct_put_altivec(), ff_vp6_filter_diag4_c(), ff_yuv2rgb_get_func_ptr(), filetime_to_iso8601(), filter(), filter_codec_opts(), gcd(), get_audio_frame(), get_date_tag(), get_dimension(), get_generic_seed(), get_scale_idx(), gxf_write_umf_material_description(), hpel_motion_search(), idct32(), idct_row(), idx_to_quant(), ir2_decode_plane(), ir2_decode_plane_inter(), match(), merge_date(), mid_pred(), mkv_write_attachments(), mkv_write_chapters(), mkv_write_tag(), mov_create_chapter_track(), mov_read_mac_string(), mov_write_3gp_udta_tag(), mov_write_chpl_tag(), mov_write_header(), mov_write_string_metadata(), mov_write_trkn_tag(), mpc7_decode_frame(), mpc8_decode_frame(), mpc8_parse_seektable(), mxf_write_header(), nsv_parse_NSVs_header(), ogm_dshow_header(), oledate_to_iso8601(), open_audio(), open_input_file(), parse_forced_key_frames(), parse_int(), postProcess_TMPL(), pow_m1_4(), print_report(), put_image(), qpel_motion_search(), quantize_and_encode_band_cost_template(), read_block_types(), read_colors(), read_dct_coeffs(), read_motion_values(), read_patterns(), read_runs(), read_thread(), read_time(), read_tree(), request_frame(), revert_channel_correlation(), rtmp_parse_result(), rv34_decode_cbp(), rv34_decode_mb_header(), rv40_adaptive_loop_filter(), rv40_weak_loop_filter(), sad_hpel_motion_search(), scalarproduct_int16_altivec(), search_for_quantizers_anmr(), search_for_quantizers_faac(), sha1_transform(), sipr_decode_lp(), smacker_decode_bigtree(), smacker_read_packet(), stream_component_open(), tm2_low_chroma(), toright(), tqi_decode_init(), truespeech_apply_twopoint_filter(), truespeech_place_pulses(), truespeech_synth(), ulaw2linear(), ulti_grad(), unix_to_file_time(), unpack_coeffs(), vb_decode_framedata(), vorbis_parse_setup_hdr_codebooks(), vp56_deblock_filter(), wavpack_decode_block(), write_chapter(), write_chunk_header(), write_globalinfo(), write_index(), write_tags(), ws_snd_decode_frame(), wv_get_value(), wv_unpack_mono(), wv_unpack_stereo(), x8_ac_compensation(), x8_get_ac_rlf(), x8_loop_filter(), and xa_decode().

float tincr [static]

Definition at line 53 of file muxing.c.

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

float tincr2 [static]

Definition at line 53 of file muxing.c.

Referenced by get_audio_frame(), and open_audio().

AVFrame * tmp_picture [static]

Definition at line 193 of file muxing.c.

uint8_t* video_outbuf [static]

Definition at line 194 of file muxing.c.

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

int video_outbuf_size [static]

Definition at line 195 of file muxing.c.

Referenced by open_video(), and write_video_frame().


Generated on Fri Oct 26 02:43:45 2012 for FFmpeg by  doxygen 1.5.8