60 {
"movflags",
"MOV muxer flags", offsetof(
MOVMuxContext,
flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
62 {
"moov_size",
"maximum moov size so it can be placed at the begin", offsetof(
MOVMuxContext, reserved_moov_size),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, 0 },
75 {
"delay_moov",
"Delay writing the initial moov until the first fragment is cut, or until the first fragment flush", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_MOV_FLAG_DELAY_MOOV}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
77 {
"write_colr",
"Write colr atom (Experimental, may be renamed or changed, do not use from scripts)", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_MOV_FLAG_WRITE_COLR}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
87 {
"min_frag_duration",
"Minimum fragment duration", offsetof(
MOVMuxContext, min_fragment_duration),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
88 {
"frag_size",
"Maximum fragment size", offsetof(
MOVMuxContext, max_fragment_size),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
89 {
"ism_lookahead",
"Number of lookahead entries for ISM files", offsetof(
MOVMuxContext, ism_lookahead),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
90 {
"video_track_timescale",
"set timescale of all video tracks", offsetof(
MOVMuxContext, video_track_timescale),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
93 {
"fragment_index",
"Fragment number of the next fragment", offsetof(
MOVMuxContext, fragments),
AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
94 {
"mov_gamma",
"gamma value for gama atom", offsetof(
MOVMuxContext, gamma),
AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, 0.0, 10, AV_OPT_FLAG_ENCODING_PARAM},
95 {
"frag_interleave",
"Interleave samples within fragments (max number of consecutive samples, lower is tighter interleaving, but with more overhead)", offsetof(
MOVMuxContext, frag_interleave),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
96 {
"encryption_scheme",
"Configures the encryption scheme, allowed values are none, cenc-aes-ctr", offsetof(
MOVMuxContext, encryption_scheme_str),
AV_OPT_TYPE_STRING, {.str =
NULL}, .flags = AV_OPT_FLAG_ENCODING_PARAM },
97 {
"encryption_key",
"The media encryption key (hex)", offsetof(
MOVMuxContext, encryption_key),
AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_ENCODING_PARAM },
98 {
"encryption_kid",
"The media encryption key identifier (hex)", offsetof(
MOVMuxContext, encryption_kid),
AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_ENCODING_PARAM },
99 {
"use_stream_ids_as_track_ids",
"use stream ids as track ids", offsetof(
MOVMuxContext, use_stream_ids_as_track_ids),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
100 {
"write_tmcd",
"force or disable writing tmcd", offsetof(
MOVMuxContext, write_tmcd),
AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM},
104 #define MOV_CLASS(flavor)\ 105 static const AVClass flavor ## _muxer_class = {\ 106 .class_name = #flavor " muxer",\ 107 .item_name = av_default_item_name,\ 109 .version = LIBAVUTIL_VERSION_INT,\ 165 for (i = 0; i < track->
entry; i++) {
180 int i, j, entries = 0, tst = -1, oldtst = -1;
187 for (i = 0; i < track->
entry; i++) {
189 if (oldtst != -1 && tst != oldtst)
194 if (equalChunks && track->
entry) {
196 sSize =
FFMAX(1, sSize);
202 for (i = 0; i < track->
entry; i++) {
215 int index = 0, oldval = -1, i;
216 int64_t entryPos, curpos;
224 for (i = 0; i < track->
entry; i++) {
244 int64_t curpos, entryPos;
252 for (i = 0; i < track->
entry; i++) {
269 uint8_t leading, dependent, reference, redundancy;
274 for (i = 0; i < track->
entry; i++) {
283 avio_w8(pb, (leading << 6) | (dependent << 4) |
284 (reference << 2) | redundancy);
308 int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
325 if ((acmod & 1) && acmod != 1)
379 #if CONFIG_AC3_PARSER 443 while (cumul_size != pkt->
size) {
599 avio_w8(pb, (size >> (7 * i)) | 0x80);
609 for (i = 0; i < track->
entry; i++)
618 int decoder_specific_info_len = track->
vos_len ? 5 + track->
vos_len : 0;
619 unsigned avg_bitrate;
626 put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1);
631 put_descr(pb, 0x04, 13 + decoder_specific_info_len);
755 uint32_t layout_tag, bitmap;
763 "lack of channel information\n");
828 int unescaped_size, seq_found = 0;
829 int level = 0, interlace = 0;
838 packet_seq = packet_entry = 1;
840 "moov atom written before any packets, unable to write correct " 841 "dvc1 atom. Set the delay_moov flag to fix this.\n");
848 for (next = start; next <
end; start = next) {
852 size = next - start - 4;
964 if (cluster_idx >= track->
entry)
967 if (cluster_idx + 1 == track->
entry)
970 next_dts = track->
cluster[cluster_idx + 1].
dts;
982 int i, first_duration;
994 for (i = 1; i < track->
entry; i++) {
998 return first_duration;
1005 uint32_t
tag = track->
tag;
1108 else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'a'))
1177 if (track->
tag ==
MKTAG(
'h',
'v',
'c',
'1'))
1190 int display_width = track->
par->
width;
1195 interlaced = (track->
vos_data[5] & 2);
1218 if (track->
tag ==
MKTAG(
'A',
'V',
'd',
'h')) {
1262 for (i = 0; i < 10; i++)
1288 else tag =
MKTAG(
'd',
'v',
'c',
' ');
1291 else tag =
MKTAG(
'd',
'v',
'p',
'p');
1294 else tag =
MKTAG(
'd',
'v',
'h',
'p');
1295 }
else if (track->
par->
height == 1080) {
1297 else tag =
MKTAG(
'd',
'v',
'h',
'6');
1310 #if FF_API_LAVF_AVCTX 1328 if (rational_framerate.
den != 0)
1329 rate =
av_q2d(rational_framerate);
1341 tag =
MKTAG(
'm',
'2',
'v',
'1');
1346 if (rate == 24) tag =
MKTAG(
'x',
'd',
'v',
'4');
1347 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'5');
1348 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'1');
1349 else if (rate == 50) tag =
MKTAG(
'x',
'd',
'v',
'a');
1350 else if (rate == 60) tag =
MKTAG(
'x',
'd',
'v',
'9');
1354 if (rate == 24) tag =
MKTAG(
'x',
'd',
'v',
'6');
1355 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'7');
1356 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'8');
1358 if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'3');
1359 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'2');
1363 if (rate == 24) tag =
MKTAG(
'x',
'd',
'v',
'd');
1364 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'e');
1365 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'f');
1367 if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'c');
1368 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'b');
1374 if (rate == 24) tag =
MKTAG(
'x',
'd',
'5',
'4');
1375 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'5',
'5');
1376 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'5',
'1');
1377 else if (rate == 50) tag =
MKTAG(
'x',
'd',
'5',
'a');
1378 else if (rate == 60) tag =
MKTAG(
'x',
'd',
'5',
'9');
1382 if (rate == 24) tag =
MKTAG(
'x',
'd',
'5',
'd');
1383 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'5',
'e');
1384 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'5',
'f');
1386 if (rate == 25) tag =
MKTAG(
'x',
'd',
'5',
'c');
1387 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'5',
'b');
1403 tag =
MKTAG(
'a',
'v',
'c',
'i');
1408 if (rate == 24) tag =
MKTAG(
'a',
'i',
'5',
'p');
1409 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'5',
'q');
1410 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'5',
'p');
1411 else if (rate == 50) tag =
MKTAG(
'a',
'i',
'5',
'q');
1412 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'5',
'p');
1416 if (rate == 24) tag =
MKTAG(
'a',
'i',
'5',
'3');
1417 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'5',
'2');
1418 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'5',
'3');
1420 if (rate == 50) tag =
MKTAG(
'a',
'i',
'5',
'5');
1421 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'5',
'6');
1427 if (rate == 24) tag =
MKTAG(
'a',
'i',
'1',
'p');
1428 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'1',
'q');
1429 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'1',
'p');
1430 else if (rate == 50) tag =
MKTAG(
'a',
'i',
'1',
'q');
1431 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'1',
'p');
1435 if (rate == 24) tag =
MKTAG(
'a',
'i',
'1',
'3');
1436 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'1',
'2');
1437 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'1',
'3');
1439 if (rate == 25) tag =
MKTAG(
'a',
'i',
'1',
'5');
1440 else if (rate == 50) tag =
MKTAG(
'a',
'i',
'1',
'5');
1441 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'1',
'6');
1446 tag =
MKTAG(
'a',
'i',
'v',
'x');
1453 static const struct {
1480 tag =
MKTAG(
'A',
'V',
'd',
'h');
1501 if (tag ==
MKTAG(
'r',
'a',
'w',
' ') &&
1505 av_log(s,
AV_LOG_ERROR,
"%s rawvideo cannot be written to mov, output file will be unreadable\n",
1538 "the file may be unplayable!\n");
1545 tag =
MKTAG(
'm',
's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
1547 "the file may be unplayable!\n");
1570 "Quicktime/Ipod might not play the file\n");
1599 0x0000, 0x0100, 0x0201, 0x0206, 0x0209, 0x020e
1604 unsigned mov_field_order = 0;
1606 mov_field_order =
fiel_data[field_order];
1636 if (stereo_3d->
flags != 0) {
1641 switch (stereo_3d->
type) {
1664 int64_t sv3d_pos, svhd_pos, proj_pos;
1758 gama = (uint32_t)
lrint((
double)(1<<16) * gamma);
1788 }
else if (track->
par->
width == 720 &&
1871 }
else if(track->
par->
width == 1440) {
1878 av_strlcatf(compressor_name, len,
"%d", rate * (interlaced + 1));
1885 char compressor_name[32] = { 0 };
1905 if (uncompressed_ycbcr) {
1934 avio_w8(pb, strlen(compressor_name));
1953 for (i = 0; i < pal_size; i++) {
1954 uint32_t rgb = track->
palette[i];
1955 uint16_t
r = (rgb >> 16) & 0xff;
1956 uint16_t
g = (rgb >> 8) & 0xff;
1957 uint16_t
b = rgb & 0xff;
1966 if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'v'))
1994 }
else if (track->
vos_len > 0)
2002 #if FF_API_LAVF_AVCTX 2004 if (field_order != track->
st->codec->field_order && track->
st->codec->field_order !=
AV_FIELD_UNKNOWN)
2005 field_order = track->
st->codec->field_order;
2032 if (spherical_mapping)
2040 if (uncompressed_ycbcr){
2078 uint64_t str_size =strlen(reel_name);
2081 if (str_size >= UINT16_MAX){
2104 #if FF_API_LAVF_AVCTX 2118 if (nb_frames > 255) {
2189 uint32_t entries = 0;
2196 ctts_entries[0].
count = 1;
2198 for (i = 1; i < track->
entry; i++) {
2200 ctts_entries[entries].
count++;
2204 ctts_entries[entries].
count = 1;
2208 atom_size = 16 + (entries * 8);
2217 for (i = 0; i < entries; i++) {
2229 uint32_t entries = -1;
2234 stts_entries =
av_malloc(
sizeof(*stts_entries));
2246 for (i = 0; i < track->
entry; i++) {
2248 if (i && duration == stts_entries[entries].duration) {
2249 stts_entries[entries].
count++;
2253 stts_entries[entries].
count = 1;
2258 atom_size = 16 + (entries * 8);
2263 for (i = 0; i < entries; i++) {
2290 int16_t roll_distance;
2291 int group_description_index;
2294 struct sgpd_entry *sgpd_entries =
NULL;
2314 for (i = 0; i < track->
entry; i++) {
2315 int roll_samples_remaining = roll_samples;
2317 for (j = i - 1; j >= 0; j--) {
2320 if (roll_samples_remaining <= 0)
2326 if (roll_samples_remaining > 0)
2330 av_assert0(distance == 0 || (distance >= 2 && distance <= 32));
2331 if (i && distance == sgpd_entries[entries].roll_distance) {
2332 sgpd_entries[entries].count++;
2335 sgpd_entries[entries].count = 1;
2336 sgpd_entries[entries].roll_distance =
distance;
2337 sgpd_entries[entries].group_description_index = distance ? ++group : 0;
2343 sgpd_entries[entries].roll_distance = 1;
2344 sgpd_entries[entries].group_description_index = ++group;
2360 for (i = 0; i < entries; i++) {
2361 if (sgpd_entries[i].group_description_index) {
2362 avio_wb16(pb, -sgpd_entries[i].roll_distance);
2372 for (i = 0; i < entries; i++) {
2374 avio_wb32(pb, sgpd_entries[i].group_description_index);
2436 const char *font =
"Lucida Grande";
2476 if (track->
tag !=
MKTAG(
'c',
'6',
'0',
'8')) {
2528 return track->
tag ==
MKTAG(
'c',
'7',
'0',
'8') ||
2529 track->
tag ==
MKTAG(
'c',
'6',
'0',
'8');
2534 const char *hdlr, *descr =
NULL, *hdlr_type =
NULL;
2539 descr =
"DataHandler";
2542 hdlr = (track->
mode ==
MODE_MOV) ?
"mhlr" :
"\0\0\0\0";
2545 descr =
"VideoHandler";
2548 descr =
"SoundHandler";
2552 descr =
"ClosedCaptionHandler";
2554 if (track->
tag ==
MKTAG(
't',
'x',
'3',
'g')) {
2556 }
else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
's')) {
2561 descr =
"SubtitleHandler";
2565 descr =
"HintHandler";
2568 descr =
"TimeCodeHandler";
2571 descr =
"GoPro MET";
2574 "Unknown hldr_type for %s, writing dummy values\n",
2636 }
else if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
2638 }
else if (track->
tag ==
MKTAG(
't',
'm',
'c',
'd')) {
2643 }
else if (track->
tag ==
MKTAG(
'g',
'p',
'm',
'd')) {
2675 (version == 1) ?
avio_wb64(pb, UINT64_C(0xffffffffffffffff)) :
avio_wb32(pb, 0xffffffff);
2676 else if (!track->
entry)
2685 "FATAL error, file duration too long for timebase, this file will not be\n" 2686 "playable with quicktime. Choose a different timebase or a different\n" 2687 "container format\n");
2713 int16_t d, int16_t tx, int16_t ty)
2731 int version = duration < INT32_MAX ? 0 : 1;
2736 uint32_t *display_matrix =
NULL;
2737 int display_matrix_size, i;
2746 &display_matrix_size);
2747 if (display_matrix && display_matrix_size < 9 *
sizeof(*display_matrix))
2748 display_matrix =
NULL;
2771 (version == 1) ?
avio_wb64(pb, UINT64_C(0xffffffffffffffff)) :
avio_wb32(pb, 0xffffffff);
2772 else if (!track->
entry)
2789 #if FF_API_OLD_ROTATE_API 2792 rotation = (rot && rot->
value) ? atoi(rot->
value) : 0;
2795 if (display_matrix) {
2796 for (i = 0; i < 9; i++)
2798 #if FF_API_OLD_ROTATE_API 2799 }
else if (rotation == 90) {
2801 }
else if (rotation == 180) {
2803 }
else if (rotation == 270) {
2812 int64_t track_width_1616;
2814 track_width_1616 = track->
par->
width * 0x10000ULL;
2819 if (!track_width_1616 ||
2821 track_width_1616 > UINT32_MAX)
2822 track_width_1616 = track->
par->
width * 0x10000ULL;
2824 if (track_width_1616 > UINT32_MAX) {
2826 track_width_1616 = 0;
2829 if (track->
height > 0xFFFF) {
2878 int version = duration < INT32_MAX ? 0 : 1;
2879 int entry_size, entry_count,
size;
2880 int64_t delay, start_ct = track->
start_cts;
2887 "EDTS using dts:%"PRId64
" cts:%d instead of dts:%"PRId64
" cts:%"PRId64
" tid:%d\n",
2889 start_dts, start_ct, track->
track_id);
2897 version |= delay < INT32_MAX ? 0 : 1;
2899 entry_size = (version == 1) ? 20 : 12;
2900 entry_count = 1 + (delay > 0);
2901 size = 24 + entry_count * entry_size;
2932 start_ct = -
FFMIN(start_dts, 0);
2990 char buf[1000] =
"";
3009 const char *
tag,
const char *str)
3053 int entry_backup = track->
entry;
3073 "Not writing any edit list even though one would have been required\n");
3083 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' '))
3097 track->
entry = entry_backup;
3104 int i, has_audio = 0, has_video = 0;
3114 if (audio_profile < 0)
3115 audio_profile = 0xFF - has_audio;
3116 if (video_profile < 0)
3117 video_profile = 0xFF - has_video;
3157 int max_track_id = 1, i;
3158 int64_t max_track_len = 0;
3167 if (max_track_len < max_track_len_temp)
3168 max_track_len = max_track_len_temp;
3169 if (max_track_id < mov->tracks[i].track_id)
3180 version = max_track_len < UINT32_MAX ? 0 : 1;
3181 avio_wb32(pb, version == 1 ? 120 : 108);
3234 int size = 16 + strlen(data);
3247 return strlen(data) + 4;
3252 const char *
value,
int lang,
int long_style)
3255 if (value && value[0]) {
3266 const char *
tag,
int *lang)
3277 len = strlen(t->
key);
3278 snprintf(tag2,
sizeof(tag2),
"%s-", tag);
3280 len2 = strlen(t2->
key);
3281 if (len2 == len + 4 && !strcmp(t->
value, t2->
value)
3291 const char *
name,
const char *
tag,
3305 int size = 0, tmpo = t ? atoi(t->
value) : 0;
3324 double latitude, longitude, altitude;
3325 int32_t latitude_fix, longitude_fix, altitude_fix;
3327 const char *ptr, *place =
"";
3329 static const char *astronomical_body =
"earth";
3334 longitude =
strtod(ptr, &end);
3340 latitude =
strtod(ptr, &end);
3346 altitude =
strtod(ptr, &end);
3351 latitude_fix = (
int32_t) ((1 << 16) * latitude);
3352 longitude_fix = (
int32_t) ((1 << 16) * longitude);
3353 altitude_fix = (
int32_t) ((1 << 16) * altitude);
3364 avio_write(pb, astronomical_body, strlen(astronomical_body) + 1);
3375 disc ?
"disc" :
"track",
3377 int size = 0, track = t ? atoi(t->
value) : 0;
3380 char *slash = strchr(t->
value,
'/');
3382 tracks = atoi(slash + 1);
3399 const char *
name,
const char *
tag,
3406 if (len != 1 && len != 4)
3411 num = atoi(t->
value);
3531 int64_t curpos, entry_pos;
3599 const char *
name,
const char *
key)
3607 len = strlen(t->
value);
3631 return (((str[0] - 0x60) & 0x1F) << 10) +
3632 (((str[1] - 0x60) & 0x1F) << 5) +
3633 (( str[2] - 0x60) & 0x1F);
3637 const char *
tag,
const char *str)
3646 if (!strcmp(tag,
"yrrc"))
3651 if (!strcmp(tag,
"albm") &&
3669 for (i = 0; i < nb_chapters; i++) {
3743 const char *str,
const char *lang,
int type)
3797 uint64_t chunkSize = chunk->
size;
3802 for (i = 1; i<trk->
entry; i++){
3810 chunkSize = chunk->
size;
3836 int next_generated_track_id = 0;
3838 if (s->
streams[i]->
id > next_generated_track_id)
3839 next_generated_track_id = s->
streams[i]->
id;
3889 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
3893 int * fallback,
size;
3897 if (fallback !=
NULL && size ==
sizeof(
int)) {
3898 if (*fallback >= 0 && *fallback < mov->
nb_streams) {
3940 avio_printf(pb,
"<param name=\"%s\" value=\"%d\" valuetype=\"data\"/>\n", name, value);
3945 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, value);
3951 len =
FFMIN(
sizeof(buf) / 2 - 1, len);
3953 buf[2 *
len] =
'\0';
3954 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, buf);
3961 int64_t manifest_bit_rate = 0;
3964 static const uint8_t uuid[] = {
3965 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
3966 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
3974 avio_printf(pb,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
3975 avio_printf(pb,
"<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
3978 avio_printf(pb,
"<meta name=\"creator\" content=\"%s\" />\n",
3990 char track_name_buf[32] = { 0 };
4013 avio_printf(pb,
"<%s systemBitrate=\"%"PRId64
"\">\n", type,
4021 av_strlcat(track_name_buf, type,
sizeof(track_name_buf));
4024 av_strlcatf(track_name_buf,
sizeof(track_name_buf),
4025 "_%s", lang->
value);
4029 av_strlcat(track_name_buf,
"_cc",
sizeof(track_name_buf));
4031 av_strlcat(track_name_buf,
"_ad",
sizeof(track_name_buf));
4107 MOVTrack *track, int64_t moof_offset)
4112 if (!track->
entry) {
4153 if (track->
entry > 1)
4174 for (i = first; i <
end; i++) {
4207 for (i = first; i <
end; i++) {
4212 if (flags & MOV_TRUN_SAMPLE_FLAGS)
4225 static const uint8_t uuid[] = {
4226 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
4227 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
4247 int size = 8 + 16 + 4 + 1 + 16*
n;
4248 static const uint8_t uuid[] = {
4249 0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
4250 0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
4263 for (i = 0; i <
n; i++) {
4264 int index = entry + 1 + i;
4268 if (n < mov->ism_lookahead) {
4299 if ((tracks >= 0 && i != tracks) || !track->
entry)
4322 if (info->
time < 0) {
4337 if ((tracks >= 0 && i != tracks) || !track->
entry)
4359 MOVTrack *track, int64_t moof_offset,
4370 for (i = 1; i < track->
entry; i++) {
4390 for (i = 0; i <
size; i++)
4399 int tracks,
int moof_size)
4411 if (tracks >= 0 && i != tracks)
4422 MOVTrack *track,
int ref_size,
int total_sidx_size)
4424 int64_t pos =
avio_tell(pb), offset_pos, end_pos;
4426 int starts_with_SAP, i, entries;
4437 if (presentation_time < 0) {
4438 duration += presentation_time;
4439 presentation_time = 0;
4460 for (i = 0; i < entries; i++) {
4461 if (!track->
entry) {
4467 starts_with_SAP = 1;
4469 avio_wb32(pb, (0 << 31) | (ref_size & 0x7fffffff));
4471 avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0);
4475 offset = pos + total_sidx_size - end_pos;
4483 int tracks,
int ref_size)
4488 for (round = 0; round < 2; round++) {
4501 if (tracks >= 0 && i != tracks)
4506 if (!track->
entry && ref_size > 0)
4611 int has_h264 = 0, has_video = 0;
4632 minor = has_h264 ? 0x100 : 0x200;
4635 minor = has_h264 ? 0x20000 : 0x10000;
4695 int audio_kbitrate = audio_par->
bit_rate / 1000;
4696 int video_kbitrate =
FFMIN(video_par->
bit_rate / 1000, 800 - audio_kbitrate);
4698 if (frame_rate < 0 || frame_rate > INT32_MAX) {
4699 av_log(s,
AV_LOG_ERROR,
"Frame rate %f outside supported range\n", frame_rate / (
double)0x10000);
4764 int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;
4777 if (video_streams_nb != 1 || audio_streams_nb != 1 || other_streams_nb) {
4789 int i, closed_gop = 0;
4791 for (i = 0; i < pkt->
size - 4; i++) {
4792 c = (c << 8) + pkt->
data[i];
4794 closed_gop = pkt->
data[i + 4] >> 6 & 0x01;
4795 }
else if (c == 0x100) {
4796 int temp_ref = (pkt->
data[i + 1] << 2) | (pkt->
data[i + 2] >> 6);
4797 if (!temp_ref || closed_gop)
4810 int seq = 0, entry = 0;
4813 for (next = start; next <
end; start = next) {
4837 for (i = 0; i < trk->
entry; i++)
4896 int i, first_track = -1;
4897 int64_t mdat_size = 0;
4899 int has_video = 0, starts_with_key = 0, first_video_track = 1;
4927 if (track->
entry <= 1)
4945 "Estimating the duration of the last packet in a " 4946 "fragment, consider setting the duration field in " 4947 "AVPacket instead.\n");
4955 int buf_size, moov_size;
5028 if (first_video_track) {
5031 first_video_track = 0;
5038 if (first_track < 0)
5051 int buf_size, write_moof = 1, moof_tracks = -1;
5064 write_moof = i == first_track;
5139 duration = pkt->
dts -
ref;
5140 if (pkt->
dts < ref || duration >= INT_MAX) {
5141 av_log(s,
AV_LOG_ERROR,
"Application provided duration: %"PRId64
" / timestamp: %"PRId64
" is out of range for mov/mp4 format\n",
5162 unsigned int samples_in_chunk = 0;
5196 static const uint16_t packed_size[16] =
5197 {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
5200 while (len < size && samples_in_chunk < 100) {
5201 len += packed_size[(pkt->
data[
len] >> 3) & 0x0F];
5204 if (samples_in_chunk > 1) {
5205 av_log(s,
AV_LOG_ERROR,
"fatal error, input is not a single packet, implement a AVParser for it\n");
5214 samples_in_chunk = 1;
5233 "use the audio bitstream filter 'aac_adtstoasc' to fix it " 5234 "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
5266 #if CONFIG_AC3_PARSER 5268 size = handle_eac3(mov, pkt, trk);
5278 int nal_size_length = (par->
extradata[4] & 0x3) + 1;
5372 "Track %d starts with a nonzero dts %"PRId64
", while the moov " 5373 "already has been written. Set the delay_moov flag to handle " 5384 if (pkt->
dts != pkt->
pts)
5422 reformatted_data, size);
5436 int64_t frag_duration = 0;
5467 memcpy(par->
extradata, side, side_size);
5597 if (ret < 0)
return ret;
5604 int reshuffle_ret, ret;
5607 int expected_stride = ((trk->
par->
width * bpc + 15) >> 4)*2;
5609 if (reshuffle_ret < 0)
5610 return reshuffle_ret;
5622 for (i = 0; i < pkt->
size; i++)
5625 if (reshuffle_ret) {
5650 track->
tag =
MKTAG(
't',
'e',
'x',
't');
5658 uint8_t chapter_properties[43] = { 0, 0, 0, 0, 0, 0, 0, 1, };
5661 memcpy(track->
par->
extradata, chapter_properties,
sizeof(chapter_properties));
5717 static const char encd[12] = {
5718 0x00, 0x00, 0x00, 0x0C,
5720 0x00, 0x00, 0x01, 0x00 };
5721 len = strlen(t->
value);
5722 pkt.
size = len + 2 + 12;
5728 memcpy(pkt.
data + len + 2, encd,
sizeof(encd));
5758 track->
tag =
MKTAG(
't',
'm',
'c',
'd');
5831 if (!enabled[i] && first[i] >= 0)
5872 r = (rgb >> 16) & 0xFF;
5873 g = (rgb >> 8) & 0xFF;
5876 y = av_clip_uint8(( 16000 + 257 * r + 504 * g + 98 * b)/1000);
5877 cb = av_clip_uint8((128000 - 148 * r - 291 * g + 439 * b)/1000);
5878 cr = av_clip_uint8((128000 + 439 * r - 368 * g - 71 * b)/1000);
5880 return (y << 16) | (cr << 8) | cb;
5887 int have_palette = 0, have_size = 0;
5888 uint32_t palette[16];
5891 while (cur && *cur) {
5892 if (strncmp(
"palette:", cur, 8) == 0) {
5894 count = sscanf(cur + 8,
5895 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", " 5896 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", " 5897 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", " 5898 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
"",
5899 &palette[ 0], &palette[ 1], &palette[ 2], &palette[ 3],
5900 &palette[ 4], &palette[ 5], &palette[ 6], &palette[ 7],
5901 &palette[ 8], &palette[ 9], &palette[10], &palette[11],
5902 &palette[12], &palette[13], &palette[14], &palette[15]);
5904 for (i = 0; i <
count; i++) {
5908 }
else if (!strncmp(
"size:", cur, 5)) {
5909 sscanf(cur + 5,
"%dx%d", &width, &
height);
5912 if (have_palette && have_size)
5914 cur += strcspn(cur,
"\n\r");
5915 cur += strspn(cur,
"\n\r");
5921 for (i = 0; i < 16; i++) {
5996 av_log(s,
AV_LOG_WARNING,
"No meaningful edit list will be written when using empty_moov without delay_moov\n");
6011 "Sample interleaving in fragments is mutually exclusive with " 6012 "omit_tfhd_offset and separate_moof\n");
6055 "so timecode metadata are now ignored\n");
6106 "codec not currently supported in container\n",
6118 if (track->
tag ==
MKTAG(
'm',
'x',
'3',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'3',
'n') ||
6119 track->
tag ==
MKTAG(
'm',
'x',
'4',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'4',
'n') ||
6120 track->
tag ==
MKTAG(
'm',
'x',
'5',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'5',
'n')) {
6125 track->
height = track->
tag >> 24 ==
'n' ? 486 : 576;
6140 "WARNING codec timebase is very high. If duration is too long,\n" 6141 "file may not be playable by quicktime. Specify a shorter timebase\n" 6142 "or choose different container.\n");
6145 track->
tag ==
MKTAG(
'r',
'a',
'w',
' ')) {
6197 av_log(s,
AV_LOG_ERROR,
"track %d: muxing mp3 at %dhz is not standard, to mux anyway set strict to -1\n",
6213 "%s in MP4 support is experimental, add " 6214 "'-strict %d' if you want to use it.\n",
6252 int i, ret, hint_track = 0, tmcd_track = 0, nb_tracks = s->
nb_streams;
6258 hint_track = nb_tracks;
6265 tmcd_track = nb_tracks;
6299 trackj->
tag != track->
tag 6332 mov->
time += 0x7C25B080;
6420 int i, moov_size, moov_size2;
6436 if (moov_size2 != moov_size)
6460 int ret = 0, moov_size;
6464 int read_buf_id = 0;
6479 read_buf[1] = buf + moov_size;
6488 "the second pass (faststart)\n", s->
url);
6501 #define READ_BLOCK do { \ 6502 read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], moov_size); \ 6511 n = read_size[read_buf_id];
6516 }
while (pos < pos_end);
6589 av_log(s,
AV_LOG_INFO,
"Starting second pass: moving the moov atom to the beginning of the file\n");
6602 av_log(s,
AV_LOG_ERROR,
"reserved_moov_size is too small, needed %"PRId64
" additional\n", 8-size);
6722 #if CONFIG_MOV_MUXER 6727 .extensions =
"mov",
6742 .priv_class = &mov_muxer_class,
6745 #if CONFIG_TGP_MUXER 6750 .extensions =
"3gp",
6762 .priv_class = &tgp_muxer_class,
6765 #if CONFIG_MP4_MUXER 6770 .mime_type =
"video/mp4",
6771 .extensions =
"mp4",
6784 .priv_class = &mp4_muxer_class,
6787 #if CONFIG_PSP_MUXER 6792 .extensions =
"mp4,psp",
6805 .priv_class = &psp_muxer_class,
6808 #if CONFIG_TG2_MUXER 6813 .extensions =
"3g2",
6825 .priv_class = &tg2_muxer_class,
6828 #if CONFIG_IPOD_MUXER 6833 .mime_type =
"video/mp4",
6834 .extensions =
"m4v,m4a,m4b",
6846 .priv_class = &ipod_muxer_class,
6849 #if CONFIG_ISMV_MUXER 6854 .mime_type =
"video/mp4",
6855 .extensions =
"ismv,isma",
6868 .priv_class = &ismv_muxer_class,
6871 #if CONFIG_F4V_MUXER 6876 .mime_type =
"application/f4v",
6877 .extensions =
"f4v",
6889 .priv_class = &f4v_muxer_class,
unsigned int nb_chapters
Number of chapters in AVChapter array.
int32_t pitch
Rotation around the right vector [-90, 90].
static int utf8len(const uint8_t *b)
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
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
int ff_mov_iso639_to_lang(const char lang[4], int mp4)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
#define FF_MOV_FLAG_DELAY_MOOV
int(* io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
A callback for opening new IO streams.
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 char const char void * val
enum AVFieldOrder field_order
Video only.
static int mov_write_moof_tag_internal(AVIOContext *pb, MOVMuxContext *mov, int tracks, int moof_size)
static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
enum AVColorTransferCharacteristic color_trc
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define FF_MOV_FLAG_FASTSTART
static int get_cluster_duration(MOVTrack *track, int cluster_idx)
static int mov_write_dinf_tag(AVIOContext *pb)
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
static int mov_flush_fragment(AVFormatContext *s, int force)
#define OPUS_SEEK_PREROLL_MS
static AVRational find_fps(AVFormatContext *s, AVStream *st)
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
static int mov_write_tfdt_tag(AVIOContext *pb, MOVTrack *track)
int ffio_close_null_buf(AVIOContext *s)
Close a null buffer.
static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags)
Write WAVEFORMAT header structure.
static void mov_write_psp_udta_tag(AVIOContext *pb, const char *str, const char *lang, int type)
#define MOV_TFHD_DEFAULT_DURATION
static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
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 AV_LOG_WARNING
Something somehow does not look correct.
#define FF_MOV_FLAG_FRAGMENT
static void find_compressor(char *compressor_name, int len, MOVTrack *track)
packed RGB 8:8:8, 24bpp, RGBRGB...
static int mov_write_subtitle_end_packet(AVFormatContext *s, int stream_index, int64_t dts)
static int mov_write_enda_tag_be(AVIOContext *pb)
struct AVAESCTR * aes_ctr
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static int mov_write_dref_tag(AVIOContext *pb)
static int mov_write_gpmd_tag(AVIOContext *pb, const MOVTrack *track)
int max_bitrate
Maximum bitrate of the stream, in bits per second.
static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int long_style)
static const AVCodecTag codec_f4v_tags[]
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
AVRational sample_aspect_ratio
Video only.
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
static int mov_pcm_be_gt16(enum AVCodecID codec_id)
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, int track_index, int sample, uint8_t *sample_data, int sample_size)
SMPTE ST 432-1 (2010) / P3 D65 / Display P3.
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection...
static int mov_check_timecode_track(AVFormatContext *s, AVTimecode *tc, int src_index, const char *tcstr)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
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)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
int index
stream index in AVFormatContext
int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out, int *size, int filter_ps, int *ps_count)
Writes Annex B formatted HEVC NAL units to a data buffer.
#define MOV_TRUN_SAMPLE_CTS
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_FLAG_READ
read-only
static int mov_write_dpxe_tag(AVIOContext *pb, MOVTrack *track)
void ff_mov_cenc_free(MOVMuxCencContext *ctx)
Free a CENC context.
This side data contains an integer value representing the stream index of a "fallback" track...
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
static int mov_write_trak_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st)
static int mov_write_sdtp_tag(AVIOContext *pb, MOVTrack *track)
Video represents a sphere mapped on a flat surface using equirectangular projection.
SMPTE ST 431-2 (2011) / DCI P3.
static int mov_write_mdta_keys_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
char * encryption_scheme_str
static int mov_write_tcmi_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_track_metadata(AVIOContext *pb, AVStream *st, const char *tag, const char *str)
static int mov_write_dfla_tag(AVIOContext *pb, MOVTrack *track)
Views are next to each other.
#define MOV_TFHD_DURATION_IS_EMPTY
static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_colr_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_source_reference_tag(AVIOContext *pb, MOVTrack *track, const char *reel_name)
static uint16_t language_code(const char *str)
#define FF_PROFILE_AAC_HE_V2
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track)
int strict_std_compliance
Allow non-standard and experimental extension.
This struct describes the properties of an encoded stream.
#define AV_PKT_FLAG_DISPOSABLE
Flag is used to indicate packets that contain frames that can be discarded by the decoder...
static int mov_write_fiel_tag(AVIOContext *pb, MOVTrack *track, int field_order)
struct MOVTrack::@228 vc1_info
static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int entry)
functionally identical to above
enum AVColorSpace color_space
#define MOV_TFHD_DEFAULT_BASE_IS_MOOF
int ff_mov_cenc_write_packet(MOVMuxCencContext *ctx, AVIOContext *pb, const uint8_t *buf_in, int size)
Write a fully encrypted packet.
int frame_size
Audio only.
int last_sample_is_subtitle_end
static int mov_write_glbl_tag(AVIOContext *pb, MOVTrack *track)
#define MOV_TKHD_FLAG_ENABLED
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
static int shift_data(AVFormatContext *s)
Trailer data, which doesn't contain actual content, but only for finalizing the output file...
static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s, int disc)
static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
static int mov_write_st3d_tag(AVIOContext *pb, AVStereo3D *stereo_3d)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int tracks, int size)
static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt)
double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
Determine a suitable 'gamma' value to match the supplied AVColorTransferCharacteristic.
int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
Parse timecode representation (hh:mm:ss[:;.
static double cb(void *priv, double x, double y)
static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define FF_MOV_FLAG_EMPTY_MOOV
#define FF_MOV_FLAG_WRITE_COLR
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void avio_wl32(AVIOContext *s, unsigned int val)
static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
static int mov_write_minf_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
unsigned frag_info_capacity
int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in, int size, int filter_ps, int *ps_count)
Writes Annex B formatted HEVC NAL units to the provided AVIOContext.
Opaque data information usually continuous.
int missing_duration_warned
static int mov_preroll_write_stbl_atoms(AVIOContext *pb, MOVTrack *track)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
unsigned int samples_in_chunk
#define MOV_CLASS(flavor)
8 bits with AV_PIX_FMT_RGB32 palette
static int mov_write_ctts_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
static int get_samples_per_packet(MOVTrack *track)
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
static int mov_get_mpeg2_xdcam_codec_tag(AVFormatContext *s, MOVTrack *track)
const AVCodecTag ff_codec_movvideo_tags[]
static int mov_pcm_le_gt16(enum AVCodecID codec_id)
static av_cold int end(AVCodecContext *avctx)
static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int id
Format-specific stream ID.
static const AVOption options[]
static int mov_write_ms_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
Mark the written bytestream as a specific type.
uint8_t * av_stream_get_side_data(const AVStream *stream, enum AVPacketSideDataType type, int *size)
Get side information from stream.
static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)
static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
AVStream ** streams
A list of all streams in the file.
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)
A point in the output bytestream where a demuxer can start parsing (for non self synchronizing bytest...
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
static int mov_write_sidx_tags(AVIOContext *pb, MOVMuxContext *mov, int tracks, int ref_size)
static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
double strtod(const char *, char **)
int ff_mov_cenc_init(MOVMuxCencContext *ctx, uint8_t *encryption_key, int use_subsamples, int bitexact)
Initialize a CENC context.
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int chapter_track
qt chapter track number
int flags
Flags modifying the (de)muxer behaviour.
int need_rewrite_extradata
#define FF_MOV_FLAG_OMIT_TFHD_OFFSET
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
Writes VP codec configuration to the provided AVIOContext.
int start
timecode frame start (first base frame number)
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
static void mov_free(AVFormatContext *s)
#define MOV_TRUN_SAMPLE_SIZE
static int mov_write_covr(AVIOContext *pb, AVFormatContext *s)
static int mov_write_itunes_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track)
bitstream reader API header.
#define AV_LOG_VERBOSE
Detailed information.
int max_fragment_duration
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_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks, int64_t mdat_size)
Video is not stereoscopic (and metadata has to be there).
int buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
void ff_mov_close_hinting(MOVTrack *track)
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)
static const uint16_t fiel_data[]
uint64_t channel_layout
Audio only.
#define MOV_TFHD_DEFAULT_SIZE
static int mov_write_nmhd_tag(AVIOContext *pb)
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
struct AVOutputFormat * oformat
The output container format.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
#define ROUNDED_DIV(a, b)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define FF_COMPLIANCE_UNOFFICIAL
Allow unofficial extensions.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
attribute_deprecated int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src)
Copy packet side data.
static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
const AVCodecTag codec_ism_tags[]
static int compute_sidx_size(AVFormatContext *s)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static int mov_write_eac3_tag(AVIOContext *pb, MOVTrack *track)
#define MOV_TIMECODE_FLAG_DROPFRAME
static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk)
static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
int flags
Additional information about the frame packing.
static int mov_write_mdta_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
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)
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int len)
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
int video_track_timescale
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. ...
enum AVColorPrimaries color_primaries
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
char * url
input or output URL.
static int mov_write_clap_tag(AVIOContext *pb, MOVTrack *track)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data, int size, int ps_array_completeness)
Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the provided AVIOContext...
int ff_mov_cenc_avc_parse_nal_units(MOVMuxCencContext *ctx, AVIOContext *pb, const uint8_t *buf_in, int size)
Parse AVC NAL units from annex B format, the nal size and type are written in the clear while the bod...
preferred ID for decoding MPEG audio layer 1, 2 or 3
#define av_fourcc2str(fourcc)
enum AVMediaType codec_type
General type of the encoded data.
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
static AVDictionaryEntry * get_metadata_lang(AVFormatContext *s, const char *tag, int *lang)
static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int moof_size, int first, int end)
#define FF_MOV_FLAG_WRITE_GAMA
static int mov_create_dvd_sub_decoder_specific_info(MOVTrack *track, AVStream *st)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static av_always_inline av_const double round(double x)
int height
active picture (w/o VBI) height for D-10/IMX
#define MOV_SAMPLE_DEPENDENCY_UNKNOWN
static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, AVStream *st)
#define FF_MOV_FLAG_SEPARATE_MOOF
static int mov_setup_track_ids(MOVMuxContext *mov, AVFormatContext *s)
Assign track ids.
static const uint8_t offset[127][2]
AVRational avg_frame_rate
Average framerate.
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
MOVEncryptionScheme encryption_scheme
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[]
static av_always_inline uint64_t ff_dnxhd_parse_header_prefix(const uint8_t *buf)
const AVCodecTag ff_codec_movsubtitle_tags[]
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int flags
A combination of AV_PKT_FLAG values.
int extradata_size
Size of the extradata content in bytes.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array through a pointer to a pointer.
static float distance(float x, float y, int band)
static int mov_flush_fragment_interleaving(AVFormatContext *s, MOVTrack *track)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
uint32_t bound_bottom
Distance from the bottom edge.
int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
static int mov_write_identification(AVIOContext *pb, AVFormatContext *s)
static int mov_write_gama_tag(AVIOContext *pb, MOVTrack *track, double gamma)
int block_align
Audio only.
#define FF_MOV_FLAG_FRAG_DISCONT
static int mov_write_mdia_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
#define MOV_DISPOSABLE_SAMPLE
#define MOV_FRAG_INFO_ALLOC_INCREMENT
#define MOV_TRACK_ENABLED
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.
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
static int mov_write_tfhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int64_t moof_offset)
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
void ffio_fill(AVIOContext *s, int b, int count)
#define AV_TIME_BASE
Internal time base represented as integer.
int nb_meta_tmcd
number of new created tmcd track based on metadata (aka not data copy)
const AVCodecTag ff_codec_bmp_tags[]
static int mov_write_mvex_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s)
#define MOV_TKHD_FLAG_IN_MOVIE
#define MOV_PARTIAL_SYNC_SAMPLE
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
#define FF_PROFILE_UNKNOWN
static int write_trailer(AVFormatContext *s1)
static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track)
static int is_clcp_track(MOVTrack *track)
ITU-R BT2020 non-constant luminance system.
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
void avio_wb24(AVIOContext *s, unsigned int val)
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
uint32_t bound_right
Distance from the right edge.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track)
int ff_mov_cenc_avc_write_nal_units(AVFormatContext *s, MOVMuxCencContext *ctx, int nal_length_size, AVIOContext *pb, const uint8_t *buf_in, int size)
Write AVC NAL units that are in MP4 format, the nal size and type are written in the clear while the ...
static int mov_write_string_tag(AVIOContext *pb, const char *name, const char *value, int lang, int long_style)
#define FLAC_STREAMINFO_SIZE
static int mov_write_smhd_tag(AVIOContext *pb)
static int mov_auto_flush_fragment(AVFormatContext *s, int force)
int avoid_negative_ts
Avoid negative timestamps during muxing.
int reserved_moov_size
0 for disabled, -1 for automatic, size otherwise
static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track)
static void param_write_string(AVIOContext *pb, const char *name, const char *value)
int32_t yaw
Rotation around the up vector [-180, 180].
#define MOV_TRUN_SAMPLE_DURATION
int use_stream_ids_as_track_ids
packed RGB 8:8:8, 24bpp, BGRBGR...
enum AVColorRange color_range
Video only.
static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
Usually treated as AVMEDIA_TYPE_DATA.
static int mov_write_edts_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_init(AVFormatContext *s)
enum AVPixelFormat pix_fmt
#define MOV_SAMPLE_DEPENDENCY_YES
static int mov_write_trex_tag(AVIOContext *pb, MOVTrack *track)
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 int mov_write_dops_tag(AVIOContext *pb, MOVTrack *track)
#define FF_MOV_FLAG_FRAG_EVERY_FRAME
static int mov_get_h264_codec_tag(AVFormatContext *s, MOVTrack *track)
preferred ID for MPEG-1/2 video decoding
static int mov_write_raw_metadata_tag(AVFormatContext *s, AVIOContext *pb, const char *name, const char *key)
#define AVERROR_EXPERIMENTAL
Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it...
#define FF_ARRAY_ELEMS(a)
offset must point to a pointer immediately followed by an int for the length
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
the normal 2^n-1 "JPEG" YUV ranges
static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov)
static const struct @226 mov_pix_fmt_tags[]
uint32_t padding
Number of pixels to pad from the edge of each cube face.
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
static int get_sidx_size(AVFormatContext *s)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
int64_t end
chapter start/end time in time_base units
This structure describes the bitrate properties of an encoded bitstream.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
enum AVStereo3DType type
How views are packed within the video.
enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)
#define AV_LOG_INFO
Standard information.
static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track)
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
#define MOV_INDEX_CLUSTER_SIZE
static int mov_write_d263_tag(AVIOContext *pb)
#define FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS
Views are on top of each other.
struct eac3_info::@227 substream[1]
static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, uint8_t *dst)
functionally identical to above
const AVCodecTag ff_codec_movaudio_tags[]
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
AVIOContext * pb
I/O context.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static void mov_prune_frag_info(MOVMuxContext *mov, int tracks, int max)
#define MOV_SAMPLE_DEPENDENCY_NO
#define FF_RTP_FLAG_OPTS(ctx, fieldname)
void avio_w8(AVIOContext *s, int b)
static uint32_t rgb_to_yuv(uint32_t rgb)
#define MOV_TRUN_FIRST_SAMPLE_FLAGS
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define FF_MOV_FLAG_FRAG_CUSTOM
int hint_track
the track that hints this track, -1 if no hint track is set
static int mov_write_hmhd_tag(AVIOContext *pb)
static int mov_parse_mpeg2_frame(AVPacket *pkt, uint32_t *flags)
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
#define FF_MOV_FLAG_GLOBAL_SIDX
static int mov_write_dvc1_tag(AVIOContext *pb, MOVTrack *track)
static void build_chunks(MOVTrack *trk)
Replacements for frequently missing libm functions.
static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static unsigned int get_bits1(GetBitContext *s)
int ff_mov_cenc_write_sinf_tag(MOVTrack *track, AVIOContext *pb, uint8_t *kid)
Write the sinf atom, contained inside stsd.
#define AV_PIX_FMT_YUV420P10
#define FF_MOV_FLAG_RTP_HINT
static void skip_bits(GetBitContext *s, int n)
#define FF_COMPLIANCE_NORMAL
static int mov_write_wfex_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
unsigned int chunkNum
Chunk number if the current entry is a chunk start otherwise 0.
int32_t roll
Rotation around the forward vector [-180, 180].
static int co64_required(const MOVTrack *track)
Rational number (pair of numerator and denominator).
#define FF_MOV_FLAG_SKIP_TRAILER
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.
int ffio_open_null_buf(AVIOContext **s)
Open a write-only fake memory stream.
static int mov_write_chan_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb)
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
#define MOV_TFHD_DEFAULT_FLAGS
MOVFragmentInfo * frag_info
This structure describes how to handle spherical videos, outlining information about projection...
#define MOV_TRUN_SAMPLE_FLAGS
uint32_t palette[AVPALETTE_COUNT]
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
static const AVCodecTag codec_3gp_tags[]
static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st)
static int mov_write_enda_tag(AVIOContext *pb)
static int mov_write_hdlr_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_gmhd_tag(AVIOContext *pb, MOVTrack *track)
void avio_wb16(AVIOContext *s, unsigned int val)
static void write_matrix(AVIOContext *pb, int16_t a, int16_t b, int16_t c, int16_t d, int16_t tx, int16_t ty)
#define AV_PIX_FMT_YUV422P10
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
AVFormatContext * rtp_ctx
the format context for the hinting rtp muxer
int bits_per_raw_sample
This is the number of valid bits in each output sample.
uint32_t bound_top
Distance from the top edge.
static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_trailer(AVFormatContext *s)
the normal 219*2^(n-8) "MPEG" YUV ranges
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int sample_rate
Audio only.
#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_sv3d_tag(AVFormatContext *s, AVIOContext *pb, AVSphericalMapping *spherical_mapping)
static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb...
static int defined_frame_rate(AVFormatContext *s, AVStream *st)
static int mov_write_tfrf_tags(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FF_DISABLE_DEPRECATION_WARNINGS
static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track)
common internal api header.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
#define MOV_TFHD_BASE_DATA_OFFSET
static int ref[MAX_W *MAX_W]
static int mov_create_timecode_track(AVFormatContext *s, int index, int src_index, AVTimecode tc)
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
enum AVSphericalProjection projection
Projection type.
static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track)
int profile
Codec-specific bitstream restrictions that the stream conforms to.
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
static int rtp_hinting_needed(const AVStream *st)
int disposition
AV_DISPOSITION_* bit field.
static int mov_write_sidx_tag(AVIOContext *pb, MOVTrack *track, int ref_size, int total_sidx_size)
int src_track
the track that this hint (or tmcd) track describes
static void init(int bf, int audio_preroll)
AVRational time_base
time base in which the start/end timestamps are specified
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
int64_t nb_frames
number of frames in this stream if known or 0
static int mov_write_wave_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int64_t moof_offset, int moof_size)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
int av_timecode_check_frame_rate(AVRational rate)
Check if the timecode feature is available for the given frame rate.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
ARIB STD-B67, known as "Hybrid log-gamma".
static int mov_write_tmpo_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_mdta_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
#define FF_MOV_FLAG_DISABLE_CHPL
static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
A point in the output bytestream where a decoder can start decoding (i.e.
static int mov_write_stss_tag(AVIOContext *pb, MOVTrack *track, uint32_t flag)
uint32_t default_sample_flags
#define FF_ENABLE_DEPRECATION_WARNINGS
#define FF_MOV_FLAG_DEFAULT_BASE_MOOF
static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov)
int avg_bitrate
Average bitrate of the stream, in bits per second.
static int mov_write_vpcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
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)
This side data corresponds to the AVCPBProperties struct.
static void write_header(FFV1Context *f)
uint32_t bound_left
Distance from the left edge.
int64_t reserved_header_pos
static int64_t update_size(AVIOContext *pb, int64_t pos)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define FF_PROFILE_AAC_HE
#define MOV_TRUN_DATA_OFFSET
static int mov_write_mdhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
int tref_id
trackID of the referenced track
static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
#define FF_MOV_FLAG_USE_MDTA
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
void avio_wb32(AVIOContext *s, unsigned int val)
static int check_pkt(AVFormatContext *s, AVPacket *pkt)
internal header for VPx codec configuration utilities.
const PixelFormatTag avpriv_pix_fmt_bps_mov[]
static const AVCodecTag codec_ipod_tags[]
static unsigned compute_avg_bitrate(MOVTrack *track)
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_tref_tag(AVIOContext *pb, MOVTrack *track)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
#define av_malloc_array(a, b)
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
unsigned cluster_capacity
int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
static int mov_get_lpcm_flags(enum AVCodecID codec_id)
Compute flags for 'lpcm' tag.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
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.
static double cr(void *priv, double x, double y)
void ff_mov_cenc_write_stbl_atoms(MOVMuxCencContext *ctx, AVIOContext *pb)
Write the cenc atoms that should reside inside stbl.
static int mov_write_stsd_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
#define CONFIG_LIBX264_ENCODER
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
static void enable_tracks(AVFormatContext *s)
uint32_t flags
flags such as drop frame, +24 hours support, ...
const AVCodecTag codec_mp4_tags[]
AVPixelFormat
Pixel format.
This structure stores compressed data.
int min_fragment_duration
static av_always_inline const uint8_t * find_next_marker(const uint8_t *src, const uint8_t *end)
Find VC-1 marker in buffer.
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)
Header data; this needs to be present for the stream to be decodeable.
#define AV_NOPTS_VALUE
Undefined timestamp value.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX
Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.
static int compute_moov_size(AVFormatContext *s)
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
static int get_moov_size(AVFormatContext *s)