46 #define BUFFER_DURATION 0
48 #define MAX_HEADER_SIZE (7 + 4 + 12)
50 #define MAX_PACKET_SIZE (UINT16_MAX - MAX_HEADER_SIZE)
70 int data_size,
int index_pos)
75 const char *
desc, *mimetype;
76 int nb_packets, packet_total_size, packet_max_size,
size, packet_avg_size,
i;
91 packet_total_size = 0;
111 packet_avg_size = packet_total_size / nb_packets;
149 desc =
"The Audio Stream";
150 mimetype =
"audio/x-pn-realaudio";
151 codec_data_size = 73;
153 desc =
"The Video Stream";
154 mimetype =
"video/x-pn-realvideo";
155 codec_data_size = 34;
159 size = 10 + 9 * 4 + strlen(
desc) + strlen(mimetype) + codec_data_size;
219 if (coded_frame_size == 557)
278 if (
avio_seek(
s, data_offset, SEEK_SET) >= 0) {
294 int length,
int key_frame)
320 if (
s->nb_streams > 2) {
325 for(n=0;n<
s->nb_streams;n++) {
329 s->streams[n]->id = n;
330 par =
s->streams[n]->codecpar;
377 for (
i = 0;
i <
size;
i += 2) {
440 int data_size, index_pos,
i;
446 data_size = index_pos - rm->
data_pos;
455 for(
i=0;
i<
s->nb_streams;
i++)
471 .mime_type =
"application/vnd.rn-realmedia",
472 .extensions =
"rm,ra",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
void avio_wl32(AVIOContext *s, unsigned int val)
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
void avio_wb16(AVIOContext *s, unsigned int val)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
#define flags(name, subs,...)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
static void write_header(FFV1Context *f)
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
@ AV_ROUND_ZERO
Round toward zero.
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, enum AVRounding rnd)
Rescale a 64-bit integer by 2 rational numbers with specified rounding.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const char *const ff_rm_metadata[4]
const AVCodecTag ff_rm_codec_tags[]
static void put_str8(AVIOContext *s, const char *tag)
static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int flags)
static int rm_write_header(AVFormatContext *s)
static void put_str(AVIOContext *s, const char *tag)
static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int flags)
static int rv10_write_header(AVFormatContext *ctx, int data_size, int index_pos)
AVOutputFormat ff_rm_muxer
static int rm_write_trailer(AVFormatContext *s)
static void write_packet_header(AVFormatContext *ctx, StreamInfo *stream, int length, int key_frame)
#define FF_ARRAY_ELEMS(a)
This struct describes the properties of an encoded stream.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
AVIOContext * pb
I/O context.
AVDictionary * metadata
Metadata that applies to the whole file.
void * priv_data
Format private data.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
Rational number (pair of numerator and denominator).
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
StreamInfo * video_stream
StreamInfo * audio_stream
static int write_trailer(AVFormatContext *s1)