FFmpeg
Data Structures | Macros | Functions
mux.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <libavutil/avassert.h>
#include <libavutil/channel_layout.h>
#include <libavutil/opt.h>
#include <libavutil/mathematics.h>
#include <libavutil/timestamp.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>

Go to the source code of this file.

Data Structures

struct   OutputStream
 

Macros

#define  STREAM_DURATION   10.0
 
#define  STREAM_FRAME_RATE   25 /* 25 images/s */
 
#define  STREAM_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */
 
#define  SCALE_FLAGS   SWS_BICUBIC
 

Functions

static void  log_packet (const AVFormatContext *fmt_ctx, const AVPacket *pkt)
 
 
static void  add_stream (OutputStream *ost, AVFormatContext *oc, const AVCodec **codec, enum AVCodecID codec_id)
 
static AVFramealloc_audio_frame (enum AVSampleFormat sample_fmt, const AVChannelLayout *channel_layout, int sample_rate, int nb_samples)
 
static void  open_audio (AVFormatContext *oc, const AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg)
 
 
 
static AVFramealloc_frame (enum AVPixelFormat pix_fmt, int width, int height)
 
static void  open_video (AVFormatContext *oc, const AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg)
 
static void  fill_yuv_image (AVFrame *pict, int frame_index, int width, int height)
 
 
 
 
int  main (int argc, char **argv)
 

Macro Definition Documentation

STREAM_DURATION

#define STREAM_DURATION   10.0
Examples
mux.c.

Definition at line 46 of file mux.c.

STREAM_FRAME_RATE

#define STREAM_FRAME_RATE   25 /* 25 images/s */
Examples
mux.c.

Definition at line 47 of file mux.c.

STREAM_PIX_FMT

#define STREAM_PIX_FMT   AV_PIX_FMT_YUV420P /* default pix_fmt */
Examples
mux.c.

Definition at line 48 of file mux.c.

SCALE_FLAGS

#define SCALE_FLAGS   SWS_BICUBIC
Examples
mux.c.

Definition at line 50 of file mux.c.

Function Documentation

log_packet()

static void log_packet ( const AVFormatContextfmt_ctx,
const AVPacketpkt 
)
static
Examples
mux.c.

Definition at line 72 of file mux.c.

Referenced by write_frame().

write_frame()

static int write_frame ( AVFormatContextfmt_ctx,
AVStreamst,
AVFrameframe,
AVPacketpkt 
)
static
Examples
mux.c.

Definition at line 83 of file mux.c.

Referenced by write_audio_frame(), and write_video_frame().

add_stream()

static void add_stream ( OutputStreamost,
AVFormatContextoc,
const AVCodec **  codec,
enum AVCodecID  codec_id 
)
static
Examples
mux.c.

Definition at line 125 of file mux.c.

Referenced by main().

alloc_audio_frame()

static AVFrame* alloc_audio_frame ( enum AVSampleFormat  sample_fmt,
const AVChannelLayoutchannel_layout,
int  sample_rate,
int  nb_samples 
)
static
Examples
mux.c.

Definition at line 216 of file mux.c.

Referenced by open_audio().

open_audio()

static void open_audio ( AVFormatContextoc,
const AVCodeccodec,
OutputStreamost,
AVDictionaryopt_arg 
)
static
Examples
mux.c.

Definition at line 241 of file mux.c.

Referenced by main().

get_audio_frame()

static AVFrame* get_audio_frame ( OutputStreamost )
static
Examples
mux.c.

Definition at line 307 of file mux.c.

Referenced by write_audio_frame().

write_audio_frame()

static int write_audio_frame ( AVFormatContextoc,
OutputStreamost 
)
static
Examples
mux.c.

Definition at line 336 of file mux.c.

Referenced by main().

alloc_frame()

static AVFrame* alloc_frame ( enum AVPixelFormat  pix_fmt,
int  width,
int  height 
)
static
Examples
mux.c.

Definition at line 381 of file mux.c.

Referenced by open_video().

open_video()

static void open_video ( AVFormatContextoc,
const AVCodeccodec,
OutputStreamost,
AVDictionaryopt_arg 
)
static
Examples
mux.c.

Definition at line 404 of file mux.c.

Referenced by main().

fill_yuv_image()

static void fill_yuv_image ( AVFramepict,
int  frame_index,
int  width,
int  height 
)
static
Examples
mux.c.

Definition at line 449 of file mux.c.

Referenced by get_video_frame().

get_video_frame()

static AVFrame* get_video_frame ( OutputStreamost )
static
Examples
mux.c.

Definition at line 470 of file mux.c.

Referenced by write_video_frame().

write_video_frame()

static int write_video_frame ( AVFormatContextoc,
OutputStreamost 
)
static
Examples
mux.c.

Definition at line 516 of file mux.c.

Referenced by main().

close_stream()

static void close_stream ( AVFormatContextoc,
OutputStreamost 
)
static
Examples
mux.c.

Definition at line 521 of file mux.c.

Referenced by main().

main()

int main ( int  argc,
char **  argv 
)
Examples
mux.c.

Definition at line 534 of file mux.c.


Generated on Wed Nov 19 2025 19:23:36 for FFmpeg by   doxygen 1.8.17

AltStyle によって変換されたページ (->オリジナル) /