47 {
"movflags",
"MOV muxer flags", offsetof(
MOVMuxContext,
flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
65 #define MOV_CLASS(flavor)\
66 static const AVClass flavor ## _muxer_class = {\
67 .class_name = #flavor " muxer",\
68 .item_name = av_default_item_name,\
70 .version = LIBAVUTIL_VERSION_INT,\
91 if (pos > UINT32_MAX) {
98 for (i=0; i<track->
entry; i++) {
111 int i, j, entries = 0, tst = -1, oldtst = -1;
118 for (i=0; i<track->
entry; i++) {
120 if(oldtst != -1 && tst != oldtst) {
126 if (equalChunks && track->
entry) {
128 sSize =
FFMAX(1, sSize);
135 for (i=0; i<track->
entry; i++) {
148 int index = 0, oldval = -1, i;
149 int64_t entryPos, curpos;
157 for (i=0; i<track->
entry; i++) {
178 int64_t curpos, entryPos;
186 for (i=0; i<track->
entry; i++) {
218 int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
235 if ((acmod & 1) && acmod != 1)
272 avio_w8(pb, (size>>(7*i)) | 0x80);
279 int decoder_specific_info_len = track->
vos_len ? 5 + track->
vos_len : 0;
286 put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1);
291 put_descr(pb, 0x04, 13 + decoder_specific_info_len);
350 uint32_t layout_tag, bitmap;
358 "lack of channel information\n");
411 int unescaped_size, seq_found = 0;
412 int level = 0, interlace = 0;
422 packet_seq = packet_entry = 1;
429 for (next = start; next < end; start = next) {
433 size = next - start - 4;
540 if (cluster_idx >= track->
entry)
543 if (cluster_idx + 1 == track->
entry)
546 next_dts = track->
cluster[cluster_idx + 1].
dts;
548 return next_dts - track->
cluster[cluster_idx].
dts;
553 int i, first_duration;
563 for (i = 1; i < track->
entry; i++) {
567 return first_duration;
574 uint32_t
tag = track->
tag;
627 else if(track->
tag ==
MKTAG(
'm',
'p',
'4',
'a'))
721 for (i = 0; i < 10; i++)
764 (tag ==
MKTAG(
't',
'x',
'3',
'g') ||
765 tag ==
MKTAG(
't',
'e',
'x',
't'))))
770 "Quicktime/Ipod might not play the file\n");
782 else tag =
MKTAG(
'd',
'v',
'c',
' ');
785 else tag =
MKTAG(
'd',
'v',
'p',
'p');
788 else tag =
MKTAG(
'd',
'v',
'h',
'p');
791 else tag =
MKTAG(
'd',
'v',
'h',
'6');
800 static const struct {
856 "the file may be unplayable!\n");
863 tag =
MKTAG(
'm',
's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
865 "the file may be unplayable!\n");
895 tag =
MKTAG(
'w',
'm',
'a',
' ');
923 0x0000, 0x0100, 0x0201, 0x0206, 0x0209, 0x020e
928 unsigned mov_field_order = 0;
970 char compressor_name[32] = { 0 };
1004 avio_w8(pb, strlen(compressor_name));
1012 if(track->
tag ==
MKTAG(
'm',
'p',
'4',
'v'))
1080 uint32_t entries = 0;
1084 ctts_entries =
av_malloc((track->
entry + 1) *
sizeof(*ctts_entries));
1085 ctts_entries[0].
count = 1;
1087 for (i=1; i<track->
entry; i++) {
1089 ctts_entries[entries].
count++;
1093 ctts_entries[entries].
count = 1;
1097 atom_size = 16 + (entries * 8);
1102 for (i=0; i<entries; i++) {
1114 uint32_t entries = -1;
1119 stts_entries =
av_malloc(
sizeof(*stts_entries));
1124 stts_entries = track->
entry ?
1127 for (i=0; i<track->
entry; i++) {
1129 if (i && duration == stts_entries[entries].duration) {
1130 stts_entries[entries].
count++;
1134 stts_entries[entries].
count = 1;
1139 atom_size = 16 + (entries * 8);
1144 for (i=0; i<entries; i++) {
1242 const char *hdlr, *descr =
NULL, *hdlr_type =
NULL;
1248 descr =
"DataHandler";
1250 hdlr = (track->
mode ==
MODE_MOV) ?
"mhlr" :
"\0\0\0\0";
1253 descr =
"VideoHandler";
1256 descr =
"SoundHandler";
1258 if (track->
tag ==
MKTAG(
't',
'x',
'3',
'g')) hdlr_type =
"sbtl";
1259 else hdlr_type =
"text";
1260 descr =
"SubtitleHandler";
1263 descr =
"HintHandler";
1310 }
else if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
1340 (version == 1) ?
avio_wb64(pb, UINT64_C(0xffffffffffffffff)) :
avio_wb32(pb, 0xffffffff);
1348 "FATAL error, file duration too long for timebase, this file will not be\n"
1349 "playable with quicktime. Choose a different timebase or a different\n"
1350 "container format\n");
1371 int version = duration < INT32_MAX ? 0 : 1;
1390 (version == 1) ?
avio_wb64(pb, UINT64_C(0xffffffffffffffff)) :
avio_wb32(pb, 0xffffffff);
1425 sample_aspect_ratio = 1;
1467 int version = duration < INT32_MAX ? 0 : 1;
1468 int entry_size, entry_count,
size;
1469 int64_t delay, start_ct = track->
cluster[0].
cts;
1472 version |= delay < INT32_MAX ? 0 : 1;
1474 entry_size = (version == 1) ? 20 : 12;
1475 entry_count = 1 + (delay > 0);
1476 size = 24 + entry_count * entry_size;
1543 char buf[1000] =
"";
1578 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' '))
1582 if (0.0 != sample_aspect_ratio && 1.0 != sample_aspect_ratio)
1590 int i, has_audio = 0, has_video = 0;
1600 if (audio_profile < 0)
1601 audio_profile = 0xFF - has_audio;
1602 if (video_profile < 0)
1603 video_profile = 0xFF - has_video;
1643 int max_track_id = 1, i;
1644 int64_t max_track_len_temp, max_track_len = 0;
1653 if (max_track_len < max_track_len_temp)
1654 max_track_len = max_track_len_temp;
1655 if (max_track_id < mov->tracks[i].track_id)
1660 version = max_track_len < UINT32_MAX ? 0 : 1;
1721 int size = 16 + strlen(data);
1734 return strlen(data) + 4;
1740 if (value && value[0]) {
1751 const char *
name,
const char *
tag,
1754 int l, lang = 0,
len, len2;
1762 snprintf(tag2,
sizeof(tag2),
"%s-", tag);
1764 len2 = strlen(t2->
key);
1779 int size = 0, track = t ? atoi(t->
value) : 0;
1864 return (((str[0]-0x60) & 0x1F) << 10) + (((str[1]-0x60) & 0x1F) << 5) + ((str[2]-0x60) & 0x1F);
1868 const char *
tag,
const char *str)
1877 if (!strcmp(tag,
"yrrc"))
1882 if (!strcmp(tag,
"albm") &&
1900 for (i = 0; i < nb_chapters; i++) {
1969 const char *str,
const char *lang,
int type)
2068 avio_printf(pb,
"<param name=\"%s\" value=\"%d\" valuetype=\"data\"/>\n", name, value);
2073 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, value);
2079 len =
FFMIN(
sizeof(buf)/2 - 1, len);
2082 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, buf);
2090 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
2091 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
2099 avio_printf(pb,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
2100 avio_printf(pb,
"<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
2102 avio_printf(pb,
"<meta name=\"creator\" content=\"%s\" />\n",
2112 int track_id = i + 1;
2121 avio_printf(pb,
"<%s systemBitrate=\"%d\">\n", type,
2181 int64_t moof_offset)
2186 if (!track->
entry) {
2239 for (i = 0; i < track->
entry; i++) {
2263 for (i = 0; i < track->
entry; i++) {
2268 if (flags & MOV_TRUN_SAMPLE_FLAGS)
2281 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
2282 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
2301 int size = 8 + 16 + 4 + 1 + 16*n;
2303 0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
2304 0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
2317 for (i = 0; i < n; i++) {
2318 int index = entry + 1 + i;
2322 if (n < mov->ism_lookahead) {
2326 for (i = 0; i < free_size - 8; i++)
2348 MOVTrack *track, int64_t moof_offset)
2365 for (i = 0; i <
size; i++)
2384 if (tracks >= 0 && i != tracks)
2392 moof_size = end - pos;
2395 if (tracks >= 0 && i != tracks)
2473 int has_h264 = 0, has_video = 0;
2490 minor = has_h264 ? 0x100 : 0x200;
2493 minor = has_h264 ? 0x20000 : 0x10000;
2536 int audio_kbitrate = audio_codec->
bit_rate / 1000;
2537 int video_kbitrate =
FFMIN(video_codec->
bit_rate / 1000, 800 - audio_kbitrate);
2594 int i, closed_gop = 0;
2596 for (i = 0; i < pkt->
size - 4; i++) {
2597 c = (c<<8) + pkt->
data[i];
2599 closed_gop = pkt->
data[i+4]>>6 & 0x01;
2600 }
else if (c == 0x100) {
2601 int temp_ref = (pkt->
data[i+1]<<2) | (pkt->
data[i+2]>>6);
2602 if (!temp_ref || closed_gop)
2615 int seq = 0, entry = 0;
2618 for (next = start; next < end; start = next) {
2632 if (!trk->
entry && !fragment) {
2639 for (i = 0; i < trk->
entry; i++)
2672 int i, first_track = -1;
2673 int64_t mdat_size = 0;
2689 if (i < mov->nb_streams)
2731 if (first_track < 0)
2740 int buf_size, write_moof = 1, moof_tracks = -1;
2753 write_moof = i == first_track;
2801 unsigned int samples_in_chunk = 0;
2824 static uint16_t packed_size[16] =
2825 {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
2828 while (len < size && samples_in_chunk < 100) {
2829 len += packed_size[(pkt->
data[
len] >> 3) & 0x0F];
2832 if (samples_in_chunk > 1) {
2833 av_log(s,
AV_LOG_ERROR,
"fatal error, input is not a single packet, implement a AVParser for it\n");
2839 samples_in_chunk = 1;
2898 if (pkt->
dts != pkt->
pts)
2924 reformatted_data, size);
2938 int64_t frag_duration = 0;
2941 if (!pkt->
size)
return 0;
2971 track->
tag =
MKTAG(
't',
'e',
'x',
't');
2982 pkt.duration = end - pkt.dts;
2985 len = strlen(
t->value);
2989 memcpy(pkt.data+2,
t->value,
len);
3001 int i, hint_track = 0;
3075 "codec not currently supported in container\n", i);
3083 if (track->
tag ==
MKTAG(
'm',
'x',
'3',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'3',
'n') ||
3084 track->
tag ==
MKTAG(
'm',
'x',
'4',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'4',
'n') ||
3085 track->
tag ==
MKTAG(
'm',
'x',
'5',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'5',
'n')) {
3090 track->
height = track->
tag>>24 ==
'n' ? 486 : 576;
3095 "WARNING codec timebase is very high. If duration is too long,\n"
3096 "file may not be playable by quicktime. Specify a shorter timebase\n"
3097 "or choose different container.\n");
3155 mov->
time += 0x7C25B080;
3248 #if CONFIG_MOV_MUXER
3253 .extensions =
"mov",
3265 .priv_class = &mov_muxer_class,
3268 #if CONFIG_TGP_MUXER
3273 .extensions =
"3gp",
3282 .priv_class = &tgp_muxer_class,
3285 #if CONFIG_MP4_MUXER
3290 .mime_type =
"application/mp4",
3291 .extensions =
"mp4",
3301 .priv_class = &mp4_muxer_class,
3304 #if CONFIG_PSP_MUXER
3309 .extensions =
"mp4,psp",
3319 .priv_class = &psp_muxer_class,
3322 #if CONFIG_TG2_MUXER
3327 .extensions =
"3g2",
3336 .priv_class = &tg2_muxer_class,
3339 #if CONFIG_IPOD_MUXER
3344 .mime_type =
"application/mp4",
3345 .extensions =
"m4v,m4a",
3354 .priv_class = &ipod_muxer_class,
3357 #if CONFIG_ISMV_MUXER
3362 .mime_type =
"application/mp4",
3363 .extensions =
"ismv,isma",
3372 .priv_class = &ismv_muxer_class,
static int utf8len(const uint8_t *b)
static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
This function writes extradata "as is".
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
AVFormatContext * rtp_ctx
the format context for the hinting rtp muxer
int ff_mov_iso639_to_lang(const char lang[4], int mp4)
void avio_wb64(AVIOContext *s, uint64_t val)
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
Write exactly 32 bits into a bitstream.
const struct AVCodec * codec
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
static int get_cluster_duration(MOVTrack *track, int cluster_idx)
static int mov_write_dinf_tag(AVIOContext *pb)
#define CODEC_FLAG_BITEXACT
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
static void mov_write_psp_udta_tag(AVIOContext *pb, const char *str, const char *lang, int type)
#define MOV_TFHD_DEFAULT_DURATION
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void param_write_int(AVIOContext *pb, const char *name, int value)
#define FF_MOV_FLAG_FRAGMENT
packed RGB 8:8:8, 24bpp, RGBRGB...
static void skip_bits_long(GetBitContext *s, int n)
static int mov_write_dref_tag(AVIOContext *pb)
static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int long_style)
int src_track
the track that this hint track describes
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, int track_index, int sample, uint8_t *sample_data, int sample_size)
static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
#define MOV_TRUN_SAMPLE_CTS
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks)
static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
#define MOV_TFHD_DURATION_IS_EMPTY
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static uint16_t language_code(const char *str)
static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track)
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int entry)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int mov_write_glbl_tag(AVIOContext *pb, MOVTrack *track)
struct MOVIndex::@95 vc1_info
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
#define LIBAVFORMAT_IDENT
static int mov_write_fiel_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
#define FF_MOV_FLAG_EMPTY_MOOV
void avio_wl32(AVIOContext *s, unsigned int val)
static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
unsigned int samples_in_chunk
#define MOV_CLASS(flavor)
static int get_samples_per_packet(MOVTrack *track)
const AVCodecTag ff_codec_movvideo_tags[]
static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
static const AVOption options[]
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_vmhd_tag(AVIOContext *pb)
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
static int mov_write_amr_tag(AVIOContext *pb, MOVTrack *track)
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
#define AVFMT_ALLOW_FLUSH
static double av_q2d(AVRational a)
Convert rational to double.
int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size)
int chapter_track
qt chapter track number
static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)
#define MOV_TRUN_SAMPLE_SIZE
static int mov_write_itunes_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track)
bitstream reader API header.
int max_fragment_duration
#define MKTAG(a, b, c, d)
int av_match_ext(const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
static int mov_write_wave_tag(AVIOContext *pb, MOVTrack *track)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void ff_mov_close_hinting(MOVTrack *track)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define AVFMT_GLOBALHEADER
static int mov_write_uuid_tag_ipod(AVIOContext *pb)
Write uuid atom.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static const uint16_t fiel_data[]
#define MOV_TFHD_DEFAULT_SIZE
static int mov_write_nmhd_tag(AVIOContext *pb)
struct AVOutputFormat * oformat
static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int height
active picture (w/o VBI) height for D-10/IMX
struct MOVMuxContext MOVMuxContext
static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
AVCodecID
Identify the syntax and semantics of the bitstream.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static int mov_write_meta_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO
static int mov_write_mdat_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
static void put_descr(AVIOContext *pb, int tag, unsigned int size)
static int mov_flush_fragment(AVFormatContext *s)
static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk, int fragment)
static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
preferred ID for decoding MPEG audio layer 1, 2 or 3
static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
int rc_max_rate
maximum bitrate
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
int hint_track
the track that hints this track, -1 if no hint track is set
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
#define FF_MOV_FLAG_SEPARATE_MOOF
const AVCodecTag ff_codec_wav_tags[]
int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
const AVCodecTag ff_mp4_obj_type[]
const AVCodecTag ff_codec_movsubtitle_tags[]
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static int mov_write_mdhd_tag(AVIOContext *pb, MOVTrack *track)
int flags
A combination of AV_PKT_FLAG values.
uint32_t default_sample_flags
uint64_t channel_layout
Audio channel layout.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVCodecContext * codec
Codec context associated with this stream.
int rc_buffer_size
decoder bitstream buffer size
static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int64_t moof_offset)
unsigned int nb_streams
A list of all streams in the file.
int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
int void avio_flush(AVIOContext *s)
char filename[1024]
input or output filename
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
const AVCodecTag ff_codec_bmp_tags[]
static int mov_write_mvex_tag(AVIOContext *pb, MOVMuxContext *mov)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s)
#define MOV_PARTIAL_SYNC_SAMPLE
int width
picture width / height.
MOVFragmentInfo * frag_info
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st)
void avio_wb24(AVIOContext *s, unsigned int val)
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
int tref_id
trackID of the referenced track
static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_string_tag(AVIOContext *pb, const char *name, const char *value, int lang, int long_style)
static int mov_write_smhd_tag(AVIOContext *pb)
static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track)
static void mov_create_chapter_track(AVFormatContext *s, int tracknum)
static void param_write_string(AVIOContext *pb, const char *name, const char *value)
#define MOV_TRUN_SAMPLE_DURATION
packed RGB 8:8:8, 24bpp, BGRBGR...
enum AVPixelFormat pix_fmt
static int mov_write_trex_tag(AVIOContext *pb, MOVTrack *track)
preferred ID for MPEG-1/2 video decoding
#define AV_OPT_FLAG_ENCODING_PARAM
static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov)
int64_t end
chapter start/end time in time_base units
static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track)
#define MOV_INDEX_CLUSTER_SIZE
static int mov_write_d263_tag(AVIOContext *pb)
enum AVMediaType codec_type
#define CONFIG_LIBX264_ENCODER
const AVCodecTag ff_codec_movaudio_tags[]
static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
int sample_rate
samples per second
AVIOContext * pb
I/O context.
#define FF_RTP_FLAG_OPTS(ctx, fieldname)
void avio_w8(AVIOContext *s, int b)
main external API structure.
#define MOV_TRUN_FIRST_SAMPLE_FLAGS
#define FF_MOV_FLAG_FRAG_CUSTOM
#define GET_UTF8(val, GET_BYTE, ERROR)
static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_hmhd_tag(AVIOContext *pb)
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int mov_parse_mpeg2_frame(AVPacket *pkt, uint32_t *flags)
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
static int mov_write_dvc1_tag(AVIOContext *pb, MOVTrack *track)
#define AV_DICT_IGNORE_SUFFIX
static unsigned int get_bits1(GetBitContext *s)
static const struct @94 mov_pix_fmt_tags[]
static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
#define FF_MOV_FLAG_RTP_HINT
static void skip_bits(GetBitContext *s, int n)
#define FF_ARRAY_ELEMS(a)
rational number numerator/denominator
static void param_write_hex(AVIOContext *pb, const char *name, const uint8_t *value, int len)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define FF_INPUT_BUFFER_PADDING_SIZE
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
#define MOV_TFHD_DEFAULT_FLAGS
#define FF_COMPLIANCE_NORMAL
#define MOV_TRUN_SAMPLE_FLAGS
static const AVCodecTag codec_3gp_tags[]
void avio_wb16(AVIOContext *s, unsigned int val)
static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track)
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 ...
static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_trailer(AVFormatContext *s)
#define FF_MOV_FLAG_FRAG_KEYFRAME
static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s, const char *tag, const char *str)
static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_tfrf_tags(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
#define MOV_TFHD_BASE_DATA_OFFSET
static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track)
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
static int mov_write_gmhd_tag(AVIOContext *pb)
AVRational time_base
time base in which the start/end timestamps are specified
static int mov_write_mdia_tag(AVIOContext *pb, MOVTrack *track)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track, int64_t moof_offset)
static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_stss_tag(AVIOContext *pb, MOVTrack *track, uint32_t flag)
static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov)
int channels
number of audio channels
static int mov_write_string_data_tag(AVIOContext *pb, const char *data, int lang, int long_style)
void * priv_data
Format private data.
static int mov_write_header(AVFormatContext *s)
static void write_header(FFV1Context *f)
static int64_t update_size(AVIOContext *pb, int64_t pos)
#define MOV_TRUN_DATA_OFFSET
static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, uint8_t *dst)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
void avio_wb32(AVIOContext *s, unsigned int val)
static const AVCodecTag codec_ipod_tags[]
enum AVFieldOrder field_order
Field order.
static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_tref_tag(AVIOContext *pb, MOVTrack *track)
int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
static int mov_get_lpcm_flags(enum AVCodecID codec_id)
Compute flags for 'lpcm' tag.
static int mov_write_stbl_tag(AVIOContext *pb, MOVTrack *track)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id, uint64_t channel_layout, uint32_t *bitmap)
Get the channel layout tag for the specified codec id and channel layout.
int rc_min_rate
minimum bitrate
static int ipod_get_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_stsd_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_svq3_tag(AVIOContext *pb)
AVPixelFormat
Pixel format.
This structure stores compressed data.
int min_fragment_duration
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int strict_std_compliance
strictly follow the standard (MPEG4, ...).
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
static av_always_inline const uint8_t * find_next_marker(const uint8_t *src, const uint8_t *end)
Find VC-1 marker in buffer.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC
if(!(ptr_align%ac->ptr_align)&&samples_align >=aligned_len)