62 {
"movflags",
"MOV muxer flags", offsetof(
MOVMuxContext,
flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
64 {
"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 },
78 {
"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" },
81 {
"write_colr",
"Write colr atom even if the color info is unspecified (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" },
100 {
"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 },
106 {
"write_prft",
"Write producer reference time box with specified time source", offsetof(
MOVMuxContext, write_prft),
AV_OPT_TYPE_INT, {.i64 =
MOV_PRFT_NONE}, 0,
MOV_PRFT_NB-1,
AV_OPT_FLAG_ENCODING_PARAM,
"prft"},
113 #define MOV_CLASS(flavor)\
114 static const AVClass flavor ## _muxer_class = {\
115 .class_name = #flavor " muxer",\
116 .item_name = av_default_item_name,\
118 .version = LIBAVUTIL_VERSION_INT,\
181 for (
i = 0;
i < track->
entry;
i++) {
196 int i, j, entries = 0, tst = -1, oldtst = -1;
203 for (
i = 0;
i < track->
entry;
i++) {
205 if (oldtst != -1 && tst != oldtst)
210 if (equalChunks && track->
entry) {
212 sSize =
FFMAX(1, sSize);
218 for (
i = 0;
i < track->
entry;
i++) {
231 int index = 0, oldval = -1,
i;
232 int64_t entryPos, curpos;
240 for (
i = 0;
i < track->
entry;
i++) {
260 int64_t curpos, entryPos;
268 for (
i = 0;
i < track->
entry;
i++) {
285 uint8_t leading, dependent, reference, redundancy;
290 for (
i = 0;
i < track->
entry;
i++) {
299 avio_w8(pb, (leading << 6) | (dependent << 4) |
300 (reference << 2) | redundancy);
324 int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
328 "Cannot write moov atom before AC3 packets."
329 " Set the delay_moov flag to fix this.\n");
345 if ((acmod & 1) && acmod != 1)
399 #if CONFIG_AC3_PARSER
472 while (cumul_size !=
pkt->
size) {
551 "Cannot write moov atom before EAC3 packets parsed.\n");
691 int decoder_specific_info_len = track->
vos_len ? 5 + track->
vos_len : 0;
698 put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1);
703 put_descr(pb, 0x04, 13 + decoder_specific_info_len);
840 "Cannot write moov atom before TrueHD packets."
841 " Set the delay_moov flag to fix this.\n");
846 if (length < 20 || length > track->
vos_len)
862 uint32_t layout_tag, bitmap;
870 "lack of channel information\n");
935 int unescaped_size, seq_found = 0;
936 int level = 0, interlace = 0;
945 packet_seq = packet_entry = 1;
947 "moov atom written before any packets, unable to write correct "
948 "dvc1 atom. Set the delay_moov flag to fix this.\n");
955 for (next = start; next < end; start = next) {
959 size = next - start - 4;
1071 if (cluster_idx >= track->
entry)
1074 if (cluster_idx + 1 == track->
entry)
1077 next_dts = track->
cluster[cluster_idx + 1].
dts;
1089 int i, first_duration;
1101 for (
i = 1;
i < track->
entry;
i++) {
1105 return first_duration;
1131 uint32_t
tag = track->
tag;
1241 else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'a'))
1333 if (track->
tag ==
MKTAG(
'h',
'v',
'c',
'1'))
1346 int display_width = track->
par->
width;
1374 if (track->
tag ==
MKTAG(
'A',
'V',
'd',
'h')) {
1418 for (
i = 0;
i < 10;
i++)
1451 }
else if (track->
par->
height == 1080) {
1466 #if FF_API_LAVF_AVCTX
1484 if (rational_framerate.
den != 0)
1485 rate =
av_q2d(rational_framerate);
1502 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'v',
'4');
1503 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'5');
1504 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'1');
1505 else if (rate == 50)
tag =
MKTAG(
'x',
'd',
'v',
'a');
1506 else if (rate == 60)
tag =
MKTAG(
'x',
'd',
'v',
'9');
1510 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'v',
'6');
1511 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'7');
1512 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'8');
1514 if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'3');
1515 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'2');
1519 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'v',
'd');
1520 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'e');
1521 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'f');
1523 if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'c');
1524 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'b');
1530 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'5',
'4');
1531 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'5',
'5');
1532 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'5',
'1');
1533 else if (rate == 50)
tag =
MKTAG(
'x',
'd',
'5',
'a');
1534 else if (rate == 60)
tag =
MKTAG(
'x',
'd',
'5',
'9');
1538 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'5',
'd');
1539 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'5',
'e');
1540 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'5',
'f');
1542 if (rate == 25)
tag =
MKTAG(
'x',
'd',
'5',
'c');
1543 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'5',
'b');
1564 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'5',
'p');
1565 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'5',
'q');
1566 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'5',
'p');
1567 else if (rate == 50)
tag =
MKTAG(
'a',
'i',
'5',
'q');
1568 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'5',
'p');
1572 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'5',
'3');
1573 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'5',
'2');
1574 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'5',
'3');
1576 if (rate == 50)
tag =
MKTAG(
'a',
'i',
'5',
'5');
1577 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'5',
'6');
1583 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'1',
'p');
1584 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'1',
'q');
1585 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'1',
'p');
1586 else if (rate == 50)
tag =
MKTAG(
'a',
'i',
'1',
'q');
1587 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'1',
'p');
1591 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'1',
'3');
1592 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'1',
'2');
1593 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'1',
'3');
1595 if (rate == 25)
tag =
MKTAG(
'a',
'i',
'1',
'5');
1596 else if (rate == 50)
tag =
MKTAG(
'a',
'i',
'1',
'5');
1597 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'1',
'6');
1609 static const struct {
1657 if (
tag ==
MKTAG(
'r',
'a',
'w',
' ') &&
1661 av_log(
s,
AV_LOG_ERROR,
"%s rawvideo cannot be written to mov, output file will be unreadable\n",
1698 "the file may be unplayable!\n");
1705 tag =
MKTAG(
'm',
's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
1707 "the file may be unplayable!\n");
1732 for (
i = 0; tags && tags[
i];
i++) {
1737 return codec_tags->
tag;
1754 "Quicktime/Ipod might not play the file\n");
1780 0x0000, 0x0100, 0x0201, 0x0206, 0x0209, 0x020e
1785 unsigned mov_field_order = 0;
1787 mov_field_order =
fiel_data[field_order];
1822 if (stereo_3d->
flags != 0) {
1827 switch (stereo_3d->
type) {
1850 int64_t sv3d_pos, svhd_pos, proj_pos;
1925 "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n",
1973 gama = (uint32_t)
lrint((
double)(1<<16) * gamma);
2004 avio_write(pb, icc_profile, icc_profile_size);
2005 return 12 + icc_profile_size;
2060 const int chroma_den = 50000;
2061 const int luma_den = 10000;
2103 }
else if(track->
par->
width == 1440) {
2118 char compressor_name[32] = { 0 };
2138 if (uncompressed_ycbcr) {
2167 avio_w8(pb, strlen(compressor_name));
2188 for (
i = 0;
i < pal_size;
i++) {
2190 uint16_t
r = (
rgb >> 16) & 0xff;
2191 uint16_t
g = (
rgb >> 8) & 0xff;
2192 uint16_t
b =
rgb & 0xff;
2201 if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'v'))
2231 }
else if (track->
vos_len > 0)
2239 #if FF_API_LAVF_AVCTX
2281 if (spherical_mapping)
2291 if (uncompressed_ycbcr){
2333 uint64_t str_size =strlen(reel_name);
2336 if (str_size >= UINT16_MAX){
2359 #if FF_API_LAVF_AVCTX
2373 if (nb_frames > 255) {
2449 uint32_t entries = 0;
2456 ctts_entries[0].
count = 1;
2458 for (
i = 1;
i < track->
entry;
i++) {
2460 ctts_entries[entries].
count++;
2464 ctts_entries[entries].
count = 1;
2468 atom_size = 16 + (entries * 8);
2477 for (
i = 0;
i < entries;
i++) {
2489 uint32_t entries = -1;
2494 stts_entries =
av_malloc(
sizeof(*stts_entries));
2506 for (
i = 0;
i < track->
entry;
i++) {
2509 stts_entries[entries].
count++;
2513 stts_entries[entries].
count = 1;
2518 atom_size = 16 + (entries * 8);
2523 for (
i = 0;
i < entries;
i++) {
2550 int16_t roll_distance;
2551 int group_description_index;
2554 struct sgpd_entry *sgpd_entries =
NULL;
2574 for (
i = 0;
i < track->
entry;
i++) {
2575 int roll_samples_remaining = roll_samples;
2577 for (j =
i - 1; j >= 0; j--) {
2580 if (roll_samples_remaining <= 0)
2586 if (roll_samples_remaining > 0)
2591 if (
i &&
distance == sgpd_entries[entries].roll_distance) {
2592 sgpd_entries[entries].count++;
2595 sgpd_entries[entries].count = 1;
2596 sgpd_entries[entries].roll_distance =
distance;
2597 sgpd_entries[entries].group_description_index =
distance ? ++group : 0;
2603 sgpd_entries[entries].roll_distance = 1;
2604 sgpd_entries[entries].group_description_index = ++group;
2620 for (
i = 0;
i < entries;
i++) {
2621 if (sgpd_entries[
i].group_description_index) {
2622 avio_wb16(pb, -sgpd_entries[
i].roll_distance);
2632 for (
i = 0;
i < entries;
i++) {
2634 avio_wb32(pb, sgpd_entries[
i].group_description_index);
2699 const char *font =
"Lucida Grande";
2739 if (track->
tag !=
MKTAG(
'c',
'6',
'0',
'8')) {
2791 return track->
tag ==
MKTAG(
'c',
'7',
'0',
'8') ||
2792 track->
tag ==
MKTAG(
'c',
'6',
'0',
'8');
2798 const char *hdlr, *descr =
NULL, *hdlr_type =
NULL;
2803 descr =
"DataHandler";
2806 hdlr = (track->
mode ==
MODE_MOV) ?
"mhlr" :
"\0\0\0\0";
2809 descr =
"VideoHandler";
2812 descr =
"SoundHandler";
2816 descr =
"ClosedCaptionHandler";
2818 if (track->
tag ==
MKTAG(
't',
'x',
'3',
'g')) {
2820 }
else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
's')) {
2825 descr =
"SubtitleHandler";
2829 descr =
"HintHandler";
2832 descr =
"TimeCodeHandler";
2835 descr =
"GoPro MET";
2838 "Unknown hldr_type for %s, writing dummy values\n",
2903 }
else if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
2905 }
else if (track->
tag ==
MKTAG(
't',
'm',
'c',
'd')) {
2910 }
else if (track->
tag ==
MKTAG(
'g',
'p',
'm',
'd')) {
2922 int64_t *start, int64_t *end)
2990 else if (!track->
entry)
2999 "FATAL error, file duration too long for timebase, this file will not be\n"
3000 "playable with QuickTime. Choose a different timebase with "
3001 "-video_track_timescale or a different container format\n");
3027 int16_t d, int16_t tx, int16_t ty)
3051 uint32_t *display_matrix =
NULL;
3062 &display_matrix_size);
3063 if (display_matrix && display_matrix_size < 9 *
sizeof(*display_matrix))
3064 display_matrix =
NULL;
3088 else if (!track->
entry)
3105 #if FF_API_OLD_ROTATE_API
3108 rotation = (rot && rot->
value) ? atoi(rot->
value) : 0;
3111 if (display_matrix) {
3112 for (
i = 0;
i < 9;
i++)
3114 #if FF_API_OLD_ROTATE_API
3115 }
else if (rotation == 90) {
3117 }
else if (rotation == 180) {
3119 }
else if (rotation == 270) {
3128 int64_t track_width_1616;
3130 track_width_1616 = track->
par->
width * 0x10000ULL;
3135 if (!track_width_1616 ||
3137 track_width_1616 > UINT32_MAX)
3138 track_width_1616 = track->
par->
width * 0x10000ULL;
3140 if (track_width_1616 > UINT32_MAX) {
3142 track_width_1616 = 0;
3145 if (track->
height > 0xFFFF) {
3196 int entry_size, entry_count,
size;
3197 int64_t delay, start_ct = track->
start_cts;
3204 "EDTS using dts:%"PRId64
" cts:%d instead of dts:%"PRId64
" cts:%"PRId64
" tid:%d\n",
3206 start_dts, start_ct, track->
track_id);
3214 version |= delay < INT32_MAX ? 0 : 1;
3216 entry_size = (
version == 1) ? 20 : 12;
3217 entry_count = 1 + (delay > 0);
3218 size = 24 + entry_count * entry_size;
3249 start_ct = -
FFMIN(start_dts, 0);
3307 char buf[1000] =
"";
3326 const char *
tag,
const char *
str)
3370 int entry_backup = track->
entry;
3390 "Not writing any edit list even though one would have been required\n");
3400 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' '))
3414 track->
entry = entry_backup;
3421 int i, has_audio = 0, has_video = 0;
3431 if (audio_profile < 0)
3432 audio_profile = 0xFF - has_audio;
3433 if (video_profile < 0)
3434 video_profile = 0xFF - has_video;
3474 int max_track_id = 1,
i;
3475 int64_t max_track_len = 0;
3485 if (max_track_len < max_track_len_temp)
3486 max_track_len = max_track_len_temp;
3487 if (max_track_id < mov->tracks[
i].track_id)
3498 version = max_track_len < UINT32_MAX ? 0 : 1;
3565 return strlen(
data) + 4;
3570 const char *
value,
int lang,
int long_style)
3584 const char *
tag,
int *lang)
3598 len2 = strlen(
t2->key);
3599 if (len2 ==
len + 4 && !strcmp(t->
value,
t2->value)
3609 const char *
name,
const char *
tag,
3623 int size = 0, tmpo = t ? atoi(t->
value) : 0;
3642 double latitude, longitude, altitude;
3643 int32_t latitude_fix, longitude_fix, altitude_fix;
3645 const char *ptr, *place =
"";
3647 static const char *astronomical_body =
"earth";
3652 longitude =
strtod(ptr, &end);
3658 latitude =
strtod(ptr, &end);
3664 altitude =
strtod(ptr, &end);
3669 latitude_fix = (
int32_t) ((1 << 16) * latitude);
3670 longitude_fix = (
int32_t) ((1 << 16) * longitude);
3671 altitude_fix = (
int32_t) ((1 << 16) * altitude);
3682 avio_write(pb, astronomical_body, strlen(astronomical_body) + 1);
3693 disc ?
"disc" :
"track",
3695 int size = 0, track = t ? atoi(t->
value) : 0;
3698 char *slash = strchr(t->
value,
'/');
3700 tracks = atoi(slash + 1);
3717 const char *
name,
const char *
tag,
3724 if (
len != 1 &&
len != 4)
3729 num = atoi(t->
value);
3749 for (
i = 0;
i <
s->nb_streams;
i++) {
3831 int64_t curpos, entry_pos;
3899 const char *
name,
const char *
key)
3931 return (((
str[0] - 0x60) & 0x1F) << 10) +
3932 (((
str[1] - 0x60) & 0x1F) << 5) +
3933 ((
str[2] - 0x60) & 0x1F);
3937 const char *
tag,
const char *
str)
3946 if (!strcmp(
tag,
"yrrc"))
3951 if (!strcmp(
tag,
"albm") &&
3961 int i, nb_chapters =
FFMIN(
s->nb_chapters, 255);
3969 for (
i = 0;
i < nb_chapters;
i++) {
4043 const char *
str,
const char *lang,
int type)
4097 uint64_t chunkSize = chunk->
size;
4110 chunkSize = chunk->
size;
4136 int next_generated_track_id = 0;
4137 for (
i = 0;
i <
s->nb_streams;
i++) {
4138 if (
s->streams[
i]->id > next_generated_track_id)
4139 next_generated_track_id =
s->streams[
i]->id;
4146 mov->
tracks[
i].
track_id =
i >=
s->nb_streams ? ++next_generated_track_id :
s->streams[
i]->id;
4183 for (
i = 0;
i <
s->nb_streams;
i++) {
4189 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
4198 if (fallback !=
NULL &&
size ==
sizeof(
int)) {
4199 if (*fallback >= 0 && *fallback < mov->
nb_streams) {
4254 buf[2 *
len] =
'\0';
4255 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n",
name, buf);
4263 static const uint8_t uuid[] = {
4264 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
4265 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
4273 avio_printf(pb,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
4274 avio_printf(pb,
"<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
4277 avio_printf(pb,
"<meta name=\"creator\" content=\"%s\" />\n",
4291 char track_name_buf[32] = { 0 };
4315 av_strlcatf(track_name_buf,
sizeof(track_name_buf),
4316 "_%s", lang->
value);
4320 av_strlcat(track_name_buf,
"_cc",
sizeof(track_name_buf));
4322 av_strlcat(track_name_buf,
"_ad",
sizeof(track_name_buf));
4398 MOVTrack *track, int64_t moof_offset)
4403 if (!track->
entry) {
4450 if (track->
entry > 1)
4471 for (
i = first;
i < end;
i++) {
4504 for (
i = first;
i < end;
i++) {
4522 static const uint8_t uuid[] = {
4523 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
4524 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
4544 int size = 8 + 16 + 4 + 1 + 16*n;
4545 static const uint8_t uuid[] = {
4546 0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
4547 0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
4560 for (
i = 0;
i < n;
i++) {
4561 int index = entry + 1 +
i;
4565 if (n < mov->ism_lookahead) {
4596 if ((tracks >= 0 &&
i != tracks) || !track->
entry)
4619 if (info->
time < 0) {
4634 if ((tracks >= 0 &&
i != tracks) || !track->
entry)
4656 MOVTrack *track, int64_t moof_offset,
4667 for (
i = 1;
i < track->
entry;
i++) {
4696 int tracks,
int moof_size)
4708 if (tracks >= 0 &&
i != tracks)
4719 MOVTrack *track,
int ref_size,
int total_sidx_size)
4723 unsigned starts_with_SAP;
4735 if (presentation_time < 0) {
4737 presentation_time = 0;
4758 for (
i = 0;
i < entries;
i++) {
4759 if (!track->
entry) {
4765 starts_with_SAP = 1;
4767 avio_wb32(pb, (0 << 31) | (ref_size & 0x7fffffff));
4769 avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0);
4773 offset =
pos + total_sidx_size - end_pos;
4781 int tracks,
int ref_size)
4799 if (tracks >= 0 &&
i != tracks)
4804 if (!track->
entry && ref_size > 0)
4825 first_track = &(mov->
tracks[0]);
4827 if (!first_track->
entry) {
4971 int has_h264,
int has_video,
int write_minor)
4980 minor = has_h264 ? 0x100 : 0x200;
4983 minor = has_h264 ? 0x20000 : 0x10000;
5012 int has_h264 = 0, has_av1 = 0, has_video = 0;
5015 for (
i = 0;
i <
s->nb_streams;
i++) {
5087 int audio_kbitrate = audio_par->
bit_rate / 1000;
5088 int video_kbitrate =
FFMIN(video_par->
bit_rate / 1000, 800 - audio_kbitrate);
5090 if (frame_rate < 0 || frame_rate > INT32_MAX) {
5091 av_log(
s,
AV_LOG_ERROR,
"Frame rate %f outside supported range\n", frame_rate / (
double)0x10000);
5156 int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;
5157 for (
i = 0;
i <
s->nb_streams;
i++) {
5169 if (video_streams_nb != 1 || audio_streams_nb != 1 || other_streams_nb) {
5181 int i, closed_gop = 0;
5186 closed_gop =
pkt->
data[
i + 4] >> 6 & 0x01;
5187 }
else if (
c == 0x100) {
5189 if (!temp_ref || closed_gop)
5202 int seq = 0, entry = 0;
5205 for (next = start; next < end; start = next) {
5267 if (length < 8 || length >
pkt->
size)
5306 int i, first_track = -1;
5307 int64_t mdat_size = 0;
5309 int has_video = 0, starts_with_key = 0, first_video_track = 1;
5319 for (
i = 0;
i <
s->nb_streams;
i++) {
5341 if (track->
entry <= 1)
5359 "Estimating the duration of the last packet in a "
5360 "fragment, consider setting the duration field in "
5361 "AVPacket instead.\n");
5369 int buf_size, moov_size;
5440 if (first_video_track) {
5443 first_video_track = 0;
5450 if (first_track < 0)
5463 int buf_size, write_moof = 1, moof_tracks = -1;
5476 write_moof =
i == first_track;
5553 av_log(
s,
AV_LOG_ERROR,
"Application provided duration: %"PRId64
" / timestamp: %"PRId64
" is out of range for mov/mp4 format\n",
5575 unsigned int samples_in_chunk = 0;
5610 static const uint16_t packed_size[16] =
5611 {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
5614 while (
len <
size && samples_in_chunk < 100) {
5618 if (samples_in_chunk > 1) {
5619 av_log(
s,
AV_LOG_ERROR,
"fatal error, input is not a single packet, implement a AVParser for it\n");
5628 samples_in_chunk = 1;
5630 if (samples_in_chunk < 1) {
5670 "use the audio bitstream filter 'aac_adtstoasc' to fix it "
5671 "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
5718 #if CONFIG_AC3_PARSER
5720 size = handle_eac3(mov,
pkt, trk);
5746 int nal_size_length = (par->
extradata[4] & 0x3) + 1;
5831 "Track %d starts with a nonzero dts %"PRId64
", while the moov "
5832 "already has been written. Set the delay_moov flag to handle "
5890 reformatted_data ? reformatted_data +
offset
5896 if (
pkt->
data != reformatted_data)
5906 int64_t frag_duration = 0;
5915 for (
i = 0;
i <
s->nb_streams;
i++)
5938 memcpy(par->
extradata, side, side_size);
6066 if (ret < 0)
return ret;
6073 int reshuffle_ret, ret;
6076 int expected_stride = ((trk->
par->
width * bpc + 15) >> 4)*2;
6078 if (reshuffle_ret < 0)
6079 return reshuffle_ret;
6094 if (reshuffle_ret) {
6119 track->
tag =
MKTAG(
't',
'e',
'x',
't');
6127 uint8_t chapter_properties[43] = { 0, 0, 0, 0, 0, 0, 0, 1, };
6130 memcpy(track->
par->
extradata, chapter_properties,
sizeof(chapter_properties));
6180 for (
i = 0;
i <
s->nb_chapters;
i++) {
6189 static const char encd[12] = {
6190 0x00, 0x00, 0x00, 0x0C,
6192 0x00, 0x00, 0x01, 0x00 };
6202 memcpy(
pkt->
data +
len + 2, encd,
sizeof(encd));
6227 AVStream *src_st =
s->streams[src_index];
6235 track->
tag =
MKTAG(
't',
'm',
'c',
'd');
6286 for (
i = 0;
i <
s->nb_streams;
i++) {
6309 if (!enabled[
i] && first[
i] >= 0)
6360 r = (
rgb >> 16) & 0xFF;
6361 g = (
rgb >> 8) & 0xFF;
6368 return (y << 16) | (
cr << 8) |
cb;
6375 int have_palette = 0, have_size = 0;
6376 uint32_t palette[16];
6379 while (cur && *cur) {
6380 if (strncmp(
"palette:", cur, 8) == 0) {
6382 count = sscanf(cur + 8,
6383 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
6384 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
6385 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
6386 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
"",
6387 &palette[ 0], &palette[ 1], &palette[ 2], &palette[ 3],
6388 &palette[ 4], &palette[ 5], &palette[ 6], &palette[ 7],
6389 &palette[ 8], &palette[ 9], &palette[10], &palette[11],
6390 &palette[12], &palette[13], &palette[14], &palette[15]);
6392 for (
i = 0;
i < count;
i++) {
6396 }
else if (!strncmp(
"size:", cur, 5)) {
6400 if (have_palette && have_size)
6402 cur += strcspn(cur,
"\n\r");
6403 cur += strspn(cur,
"\n\r");
6409 for (
i = 0;
i < 16;
i++) {
6431 #define IS_MODE(muxer, config) (CONFIG_ ## config ## _MUXER && !strcmp(#muxer, s->oformat->name))
6496 av_log(
s,
AV_LOG_WARNING,
"No meaningful edit list will be written when using empty_moov without delay_moov\n");
6516 "Sample interleaving in fragments is mutually exclusive with "
6517 "omit_tfhd_offset and separate_moof\n");
6534 for (
i = 0;
i <
s->nb_streams;
i++)
6545 for (
i = 0;
i <
s->nb_streams;
i++) {
6559 for (
i = 0;
i <
s->nb_streams;
i++) {
6563 "so timecode metadata are now ignored\n");
6604 for (
i = 0;
i <
s->nb_streams;
i++) {
6618 "codec not currently supported in container\n",
6630 if (track->
tag ==
MKTAG(
'm',
'x',
'3',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'3',
'n') ||
6631 track->
tag ==
MKTAG(
'm',
'x',
'4',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'4',
'n') ||
6632 track->
tag ==
MKTAG(
'm',
'x',
'5',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'5',
'n')) {
6637 track->
height = track->
tag >> 24 ==
'n' ? 486 : 576;
6642 av_log(
s,
AV_LOG_WARNING,
"Warning: some tools, like mp4split, assume a timescale of 10000000 for ISMV.\n");
6654 "WARNING codec timebase is very high. If duration is too long,\n"
6655 "file may not be playable by quicktime. Specify a shorter timebase\n"
6656 "or choose different container.\n");
6659 track->
tag ==
MKTAG(
'r',
'a',
'w',
' ')) {
6713 av_log(
s,
AV_LOG_ERROR,
"track %d: muxing mp3 at %dhz is not standard, to mux anyway set strict to -1\n",
6731 "%s in MP4 support is experimental, add "
6732 "'-strict %d' if you want to use it.\n",
6773 int i, ret, hint_track = 0, tmcd_track = 0, nb_tracks =
s->nb_streams;
6779 hint_track = nb_tracks;
6780 for (
i = 0;
i <
s->nb_streams;
i++)
6786 tmcd_track = nb_tracks;
6788 for (
i = 0;
i <
s->nb_streams;
i++) {
6812 for (j = 0; j <
s->nb_streams; j++) {
6821 trackj->
tag != track->
tag
6854 mov->
time += 0x7C25B080;
6861 for (
i = 0;
i <
s->nb_streams;
i++) {
6872 "timecode",
NULL, 0);
6874 for (
i = 0;
i <
s->nb_streams;
i++) {
6943 int i, moov_size, moov_size2;
6959 if (moov_size2 != moov_size)
6983 int ret = 0, moov_size;
6985 int64_t
pos, pos_end;
6987 int read_buf_id = 0;
7002 read_buf[1] = buf + moov_size;
7011 "the second pass (faststart)\n",
s->url);
7024 #define READ_BLOCK do { \
7025 read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], moov_size); \
7034 n = read_size[read_buf_id];
7039 }
while (
pos < pos_end);
7056 for (
i = 0;
i <
s->nb_streams;
i++) {
7114 av_log(
s,
AV_LOG_INFO,
"Starting second pass: moving the moov atom to the beginning of the file\n");
7180 #if CONFIG_TGP_MUXER || CONFIG_TG2_MUXER
7191 static const AVCodecTag *
const codec_3gp_tags_list[] = { codec_3gp_tags,
NULL };
7230 #if CONFIG_MP4_MUXER || CONFIG_PSP_MUXER
7259 #if CONFIG_MOV_MUXER
7264 .extensions =
"mov",
7279 .priv_class = &mov_muxer_class,
7282 #if CONFIG_TGP_MUXER
7287 .extensions =
"3gp",
7297 .codec_tag = codec_3gp_tags_list,
7299 .priv_class = &tgp_muxer_class,
7302 #if CONFIG_MP4_MUXER
7307 .mime_type =
"video/mp4",
7308 .extensions =
"mp4",
7319 .codec_tag = mp4_codec_tags_list,
7321 .priv_class = &mp4_muxer_class,
7324 #if CONFIG_PSP_MUXER
7329 .extensions =
"mp4,psp",
7340 .codec_tag = mp4_codec_tags_list,
7342 .priv_class = &psp_muxer_class,
7345 #if CONFIG_TG2_MUXER
7350 .extensions =
"3g2",
7360 .codec_tag = codec_3gp_tags_list,
7362 .priv_class = &tg2_muxer_class,
7365 #if CONFIG_IPOD_MUXER
7370 .mime_type =
"video/mp4",
7371 .extensions =
"m4v,m4a,m4b",
7383 .priv_class = &ipod_muxer_class,
7386 #if CONFIG_ISMV_MUXER
7391 .mime_type =
"video/mp4",
7392 .extensions =
"ismv,isma",
7405 .priv_class = &ismv_muxer_class,
7408 #if CONFIG_F4V_MUXER
7413 .mime_type =
"application/f4v",
7414 .extensions =
"f4v",
7426 .priv_class = &f4v_muxer_class,
@ EAC3_FRAME_TYPE_DEPENDENT
@ EAC3_FRAME_TYPE_INDEPENDENT
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
static double val(void *priv, double ch)
int ff_av1_filter_obus_buf(const uint8_t *in, uint8_t **out, int *size, int *offset)
Filter out AV1 OBUs not meant to be present in ISOBMFF sample data and return the result in a data bu...
int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size)
Writes AV1 extradata (Sequence Header and Metadata OBUs) to the provided AVIOContext.
int ff_av1_filter_obus(AVIOContext *pb, const uint8_t *buf, int size)
Filter out AV1 OBUs not meant to be present in ISOBMFF sample data and write the resulting bitstream ...
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size)
int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size)
int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
#define FF_COMPLIANCE_UNOFFICIAL
Allow unofficial extensions.
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
#define FF_PROFILE_UNKNOWN
#define FF_PROFILE_AAC_HE
#define FF_PROFILE_AAC_HE_V2
#define FF_COMPLIANCE_NORMAL
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
Mark the written bytestream as a specific type.
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)
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
void avio_w8(AVIOContext *s, int b)
void avio_wb32(AVIOContext *s, unsigned int val)
void avio_wb16(AVIOContext *s, unsigned int val)
#define AVIO_FLAG_READ
read-only
@ AVIO_DATA_MARKER_BOUNDARY_POINT
A point in the output bytestream where a demuxer can start parsing (for non self synchronizing bytest...
@ AVIO_DATA_MARKER_TRAILER
Trailer data, which doesn't contain actual content, but only for finalizing the output file.
@ AVIO_DATA_MARKER_HEADER
Header data; this needs to be present for the stream to be decodeable.
@ AVIO_DATA_MARKER_FLUSH_POINT
A point in the output bytestream where the underlying AVIOContext might flush the buffer depending on...
@ AVIO_DATA_MARKER_SYNC_POINT
A point in the output bytestream where a decoder can start decoding (i.e.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
Writes a formatted string to the context.
void avio_wb24(AVIOContext *s, unsigned int val)
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
void avio_wb64(AVIOContext *s, uint64_t val)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
void ffio_fill(AVIOContext *s, int b, int count)
int ffio_open_null_buf(AVIOContext **s)
Open a write-only fake memory stream.
int ffio_close_null_buf(AVIOContext *s)
Close a null buffer.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t *size)
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
#define flags(name, subs,...)
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
void avcodec_parameters_free(AVCodecParameters **ppar)
Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied p...
double avpriv_get_gamma_from_trc(enum AVColorTransferCharacteristic trc)
Determine a suitable 'gamma' value to match the supplied AVColorTransferCharacteristic.
#define MKTAG(a, b, c, d)
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
#define ROUNDED_DIV(a, b)
#define CONFIG_LIBX264_ENCODER
static av_always_inline uint64_t ff_dnxhd_parse_header_prefix(const uint8_t *buf)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
static void write_header(FFV1Context *f)
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
@ FLAC_METADATA_TYPE_STREAMINFO
#define FLAC_STREAMINFO_SIZE
bitstream reader API header.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
@ AV_OPT_TYPE_BINARY
offset must point to a pointer immediately followed by an int for the length
#define AV_CH_LAYOUT_MONO
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_DVD_SUBTITLE
@ AV_CODEC_ID_MPEGH_3D_AUDIO
@ AV_CODEC_ID_ADPCM_IMA_QT
@ AV_CODEC_ID_ADPCM_IMA_WAV
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_PKT_FLAG_DISPOSABLE
Flag is used to indicate packets that contain frames that can be discarded by the decoder.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
@ AV_PKT_DATA_PRFT
Producer Reference Time data corresponding to the AVProducerReferenceTime struct, usually exported by...
@ AV_PKT_DATA_ICC_PROFILE
ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1.
@ AV_PKT_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata (based on SMPTE-2086:2014).
@ AV_PKT_DATA_SPHERICAL
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
@ AV_PKT_DATA_CPB_PROPERTIES
This side data corresponds to the AVCPBProperties struct.
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
@ AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
@ AV_PKT_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
@ AV_PKT_DATA_FALLBACK_TRACK
This side data contains an integer value representing the stream index of a "fallback" track.
@ AV_PKT_DATA_DOVI_CONF
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2....
uint8_t * av_stream_get_side_data(const AVStream *stream, enum AVPacketSideDataType type, size_t *size)
Get side information from stream.
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.
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AVERROR_EXPERIMENTAL
Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
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.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AV_ROUND_DOWN
Round toward -infinity.
@ AV_ROUND_UP
Round toward +infinity.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array.
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array through a pointer to a pointer.
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define av_fourcc2str(fourcc)
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
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,...
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.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_TIME_BASE
Internal time base represented as integer.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
@ AV_SPHERICAL_EQUIRECTANGULAR
Video represents a sphere mapped on a flat surface using equirectangular projection.
@ AV_SPHERICAL_EQUIRECTANGULAR_TILE
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.
@ AV_SPHERICAL_CUBEMAP
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
@ AV_STEREO3D_2D
Video is not stereoscopic (and metadata has to be there).
@ AV_STEREO3D_TOPBOTTOM
Views are on top of each other.
@ AV_STEREO3D_SIDEBYSIDE
Views are next to each other.
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.
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.
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.
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
const AVCodecTag ff_mp4_obj_type[]
int ff_mov_iso639_to_lang(const char lang[4], int mp4)
const AVCodecTag ff_codec_movsubtitle_tags[]
#define MOV_TRUN_SAMPLE_DURATION
#define MOV_TRUN_SAMPLE_CTS
#define MOV_TKHD_FLAG_ENABLED
#define MOV_TFHD_DEFAULT_BASE_IS_MOOF
const AVCodecTag ff_codec_movaudio_tags[]
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES
const AVCodecTag ff_codec_movvideo_tags[]
#define MOV_TFHD_DEFAULT_SIZE
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO
#define MOV_TRUN_FIRST_SAMPLE_FLAGS
#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC
#define MOV_SAMPLE_DEPENDENCY_UNKNOWN
#define MOV_TRUN_SAMPLE_FLAGS
#define MOV_TFHD_DEFAULT_FLAGS
#define MOV_SAMPLE_DEPENDENCY_YES
#define MOV_TRUN_DATA_OFFSET
#define MOV_TFHD_BASE_DATA_OFFSET
#define MOV_TFHD_DURATION_IS_EMPTY
#define MOV_TKHD_FLAG_IN_MOVIE
#define MOV_TRUN_SAMPLE_SIZE
#define MOV_SAMPLE_DEPENDENCY_NO
#define MOV_TFHD_DEFAULT_DURATION
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
common internal api header.
unsigned int avpriv_toupper4(unsigned int x)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define FF_DISABLE_DEPRECATION_WARNINGS
#define FF_ENABLE_DEPRECATION_WARNINGS
Replacements for frequently missing libm functions.
static av_always_inline av_const double round(double x)
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 int mov_write_stsd_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_stco_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_vmhd_tag(AVIOContext *pb)
static int mov_write_trex_tag(AVIOContext *pb, MOVTrack *track)
static int get_moov_size(AVFormatContext *s)
static unsigned compute_avg_bitrate(MOVTrack *track)
static int mov_write_sidx_tag(AVIOContext *pb, MOVTrack *track, int ref_size, int total_sidx_size)
static const AVCodecTag codec_cover_image_tags[]
static int mov_write_header(AVFormatContext *s)
static int mov_write_sdtp_tag(AVIOContext *pb, MOVTrack *track)
static const AVCodecTag codec_ism_tags[]
static int64_t rescale_mdcv(AVRational q, int b)
static int utf8len(const uint8_t *b)
static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_ac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
static int mov_write_raw_metadata_tag(AVFormatContext *s, AVIOContext *pb, const char *name, const char *key)
static int mov_write_dfla_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_dinf_tag(AVIOContext *pb)
static int mov_write_dpxe_tag(AVIOContext *pb, MOVTrack *track)
#define IS_MODE(muxer, config)
static void write_matrix(AVIOContext *pb, int16_t a, int16_t b, int16_t c, int16_t d, int16_t tx, int16_t ty)
static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int64_t moof_offset, int moof_size)
static int mov_flush_fragment_interleaving(AVFormatContext *s, MOVTrack *track)
static int mov_get_mpeg2_xdcam_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_mdhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int tracks, int size)
static int shift_data(AVFormatContext *s)
static int mov_write_wfex_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_chan_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_gama_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track, double gamma)
static const AVCodecTag codec_ipod_tags[]
static int mov_write_eac3_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int co64_required(const MOVTrack *track)
static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
static int compute_moov_size(AVFormatContext *s)
static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb)
static int mov_write_tfra_tag(AVIOContext *pb, MOVTrack *track)
static int ascii_to_wc(AVIOContext *pb, const uint8_t *b)
static const AVOption options[]
static int mov_write_sidx_tags(AVIOContext *pb, MOVMuxContext *mov, int tracks, int ref_size)
static int mov_preroll_write_stbl_atoms(AVIOContext *pb, MOVTrack *track)
static void mov_write_ftyp_tag_internal(AVIOContext *pb, AVFormatContext *s, int has_h264, int has_video, int write_minor)
static int mov_write_dmlp_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
static int mov_create_timecode_track(AVFormatContext *s, int index, int src_index, AVTimecode tc)
static int mov_create_dvd_sub_decoder_specific_info(MOVTrack *track, AVStream *st)
static int mov_write_prft_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks)
static int mov_write_glbl_tag(AVIOContext *pb, MOVTrack *track)
static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
static void enable_tracks(AVFormatContext *s)
static int mov_write_minf_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_pcm_le_gt16(enum AVCodecID codec_id)
static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int entry)
static int mov_write_avcc_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
This function writes extradata "as is".
static int mov_write_covr(AVIOContext *pb, AVFormatContext *s)
static int mov_write_smhd_tag(AVIOContext *pb)
static int mov_write_mdta_keys_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static void find_compressor(char *compressor_name, int len, MOVTrack *track)
static void mov_parse_truehd_frame(AVPacket *pkt, MOVTrack *trk)
static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st)
static int mov_write_amr_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_sv3d_tag(AVFormatContext *s, AVIOContext *pb, AVSphericalMapping *spherical_mapping)
static int mov_get_h264_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track)
static uint32_t rgb_to_yuv(uint32_t rgb)
static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track)
static int mov_auto_flush_fragment(AVFormatContext *s, int force)
static int mov_write_moof_tag(AVIOContext *pb, MOVMuxContext *mov, int tracks, int64_t mdat_size)
static int mov_write_moof_tag_internal(AVIOContext *pb, MOVMuxContext *mov, int tracks, int moof_size)
static int mov_write_edts_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_enda_tag_be(AVIOContext *pb)
static int mov_write_track_metadata(AVIOContext *pb, AVStream *st, const char *tag, const char *str)
static void param_write_hex(AVIOContext *pb, const char *name, const uint8_t *value, int len)
static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static void mov_prune_frag_info(MOVMuxContext *mov, int tracks, int max)
static int mov_write_d263_tag(AVIOContext *pb)
#define MOV_CLASS(flavor)
static int mov_write_tmpo_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int len)
static const struct @267 mov_pix_fmt_tags[]
static int mov_write_ms_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static AVDictionaryEntry * get_metadata_lang(AVFormatContext *s, const char *tag, int *lang)
static uint16_t language_code(const char *str)
static int mov_write_tref_tag(AVIOContext *pb, MOVTrack *track)
static void param_write_string(AVIOContext *pb, const char *name, const char *value)
static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
enum AVPixelFormat pix_fmt
static int64_t update_size(AVIOContext *pb, int64_t pos)
static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int64_t calc_pts_duration(MOVMuxContext *mov, MOVTrack *track)
static int mov_write_dvc1_tag(AVIOContext *pb, MOVTrack *track)
static int mov_check_timecode_track(AVFormatContext *s, AVTimecode *tc, int src_index, const char *tcstr)
static int mov_write_tfrf_tags(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, 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_rtp_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_dref_tag(AVIOContext *pb)
static int mov_write_hdlr_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s, const char *tag, const char *str)
static int mov_write_subtitle_end_packet(AVFormatContext *s, int stream_index, int64_t dts)
static int mov_write_gmhd_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_dvcc_dvvc_tag(AVFormatContext *s, AVIOContext *pb, AVDOVIDecoderConfigurationRecord *dovi)
static int mov_init(AVFormatContext *s)
static void param_write_int(AVIOContext *pb, const char *name, int value)
static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int long_style)
static int mov_write_mdta_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
static void mov_write_psp_udta_tag(AVIOContext *pb, const char *str, const char *lang, int type)
static unsigned int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
static const uint16_t fiel_data[]
static int mov_write_dops_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_tcmi_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_tfhd_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int64_t moof_offset)
static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_clli_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_mdat_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_vpcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static int mov_write_gpmd_tag(AVIOContext *pb, const MOVTrack *track)
static int mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_identification(AVIOContext *pb, AVFormatContext *s)
static int mov_write_ctts_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s, int disc)
static int mov_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
static int mov_write_wave_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track)
static int mov_write_mdia_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track)
static const AVCodecTag codec_f4v_tags[]
static int is_clcp_track(MOVTrack *track)
static int mov_write_trak_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, AVStream *st)
static int compute_sidx_size(AVFormatContext *s)
static int mov_write_itunes_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_dvc1_structs(MOVTrack *track, uint8_t *buf)
static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
static int get_sidx_size(AVFormatContext *s)
static int mov_write_stsc_tag(AVIOContext *pb, MOVTrack *track)
static int get_samples_per_packet(MOVTrack *track)
static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_pcm_be_gt16(enum AVCodecID codec_id)
static int mov_write_trailer(AVFormatContext *s)
static int mov_write_btrt_tag(AVIOContext *pb, MOVTrack *track)
static int rtp_hinting_needed(const AVStream *st)
static int mov_write_nmhd_tag(AVIOContext *pb)
static int mov_get_lpcm_flags(enum AVCodecID codec_id)
Compute flags for 'lpcm' tag.
static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)
static int defined_frame_rate(AVFormatContext *s, AVStream *st)
static void mov_free(AVFormatContext *s)
static int mov_write_uuid_tag_ipod(AVIOContext *pb)
Write uuid atom.
static int check_pkt(AVFormatContext *s, AVPacket *pkt)
static void put_descr(AVIOContext *pb, int tag, unsigned int size)
int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
static int mov_write_tfdt_tag(AVIOContext *pb, MOVTrack *track)
static int mov_setup_track_ids(MOVMuxContext *mov, AVFormatContext *s)
Assign track ids.
static int mov_write_string_data_tag(AVIOContext *pb, const char *data, int lang, int long_style)
static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk)
static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track)
static int mov_flush_fragment(AVFormatContext *s, int force)
static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt)
static unsigned int validate_codec_tag(const AVCodecTag *const *tags, unsigned int tag, int codec_id)
static void build_chunks(MOVTrack *trk)
static AVRational find_fps(AVFormatContext *s, AVStream *st)
static int mov_write_mvex_tag(AVIOContext *pb, MOVMuxContext *mov)
static void get_pts_range(MOVMuxContext *mov, MOVTrack *track, int64_t *start, int64_t *end)
static int mov_write_st3d_tag(AVFormatContext *s, AVIOContext *pb, AVStereo3D *stereo_3d)
static unsigned int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_av1c_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_source_reference_tag(AVIOContext *pb, MOVTrack *track, const char *reel_name)
static int get_cluster_duration(MOVTrack *track, int cluster_idx)
static int mov_write_clap_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_enda_tag(AVIOContext *pb)
static int64_t calc_samples_pts_duration(MOVMuxContext *mov, MOVTrack *track)
static int mov_write_fiel_tag(AVIOContext *pb, MOVTrack *track, int field_order)
static int mov_write_colr_tag(AVIOContext *pb, MOVTrack *track, int prefer_icc)
static int mov_write_mdta_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, AVStream *st)
static int mov_parse_mpeg2_frame(AVPacket *pkt, uint32_t *flags)
static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
static int mov_write_meta_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_mdcv_tag(AVIOContext *pb, MOVTrack *track)
static const AVCodecTag codec_mp4_tags[]
static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track)
static int is_cover_image(const AVStream *st)
static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int moof_size, int first, int end)
static int mov_write_stss_tag(AVIOContext *pb, MOVTrack *track, uint32_t flag)
static int mov_write_hmhd_tag(AVIOContext *pb)
#define FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS
#define FF_MOV_FLAG_GLOBAL_SIDX
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, int track_index, int sample, uint8_t *sample_data, int sample_size)
#define FF_MOV_FLAG_FRAG_EVERY_FRAME
#define FF_MOV_FLAG_DEFAULT_BASE_MOOF
#define FF_MOV_FLAG_WRITE_GAMA
#define FF_MOV_FLAG_WRITE_COLR
#define FF_MOV_FLAG_DISABLE_CHPL
#define FF_MOV_FLAG_FRAG_DISCONT
#define MOV_FRAG_INFO_ALLOC_INCREMENT
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
#define MOV_DISPOSABLE_SAMPLE
#define FF_MOV_FLAG_FASTSTART
#define FF_MOV_FLAG_EMPTY_MOOV
#define FF_MOV_FLAG_SKIP_TRAILER
#define FF_MOV_FLAG_RTP_HINT
#define FF_MOV_FLAG_PREFER_ICC
void ff_mov_close_hinting(MOVTrack *track)
#define FF_MOV_FLAG_FRAG_KEYFRAME
#define FF_MOV_FLAG_FRAG_CUSTOM
#define FF_MOV_FLAG_USE_MDTA
#define FF_MOV_FLAG_SKIP_SIDX
#define FF_MOV_FLAG_DELAY_MOOV
#define FF_MOV_FLAG_OMIT_TFHD_OFFSET
#define FF_MOV_FLAG_FRAGMENT
#define FF_MOV_FLAG_SEPARATE_MOOF
#define MOV_PARTIAL_SYNC_SAMPLE
#define MOV_INDEX_CLUSTER_SIZE
#define MOV_TIMECODE_FLAG_DROPFRAME
#define MOV_TRACK_ENABLED
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...
int ff_mov_cenc_write_sinf_tag(MOVTrack *track, AVIOContext *pb, uint8_t *kid)
Write the sinf atom, contained inside stsd.
void ff_mov_cenc_write_stbl_atoms(MOVMuxCencContext *ctx, AVIOContext *pb)
Write the cenc atoms that should reside inside stbl.
int ff_mov_cenc_init(MOVMuxCencContext *ctx, uint8_t *encryption_key, int use_subsamples, int bitexact)
Initialize a CENC context.
void ff_mov_cenc_free(MOVMuxCencContext *ctx)
Free a CENC context.
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 ...
int ff_mov_cenc_write_packet(MOVMuxCencContext *ctx, AVIOContext *pb, const uint8_t *buf_in, int size)
Write a fully encrypted packet.
static int check_bitstream(AVFormatContext *s, AVStream *st, AVPacket *pkt)
static float distance(float x, float y, int band)
#define OPUS_SEEK_PREROLL_MS
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
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.
#define AV_PIX_FMT_YUV420P10
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_JPEG
Full range content.
#define AV_PIX_FMT_YUV422P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_RGB555BE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian , X=unused/undefined
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_UYVY422
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
@ AV_PIX_FMT_RGB48BE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big...
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_RGB565LE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
@ AV_PIX_FMT_RGB565BE
packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
Write exactly 32 bits into a bitstream.
static int put_bits_count(PutBitContext *s)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
const PixelFormatTag avpriv_pix_fmt_bps_mov[]
enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)
const AVCodecTag ff_codec_bmp_tags[]
const AVCodecTag ff_codec_wav_tags[]
internal header for RIFF based (de)muxers do NOT include this in end user applications
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX
Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags)
Write WAVEFORMAT header structure.
#define FF_RTP_FLAG_OPTS(ctx, fieldname)
static const SheerTable rgb[2]
#define FF_ARRAY_ELEMS(a)
double strtod(const char *, char **)
This structure describes the bitrate properties of an encoded bitstream.
int avg_bitrate
Average bitrate of the stream, in bits per second.
int buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
int max_bitrate
Maximum bitrate of the stream, in bits per second.
enum AVFieldOrder field_order
Field order.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
This struct describes the properties of an encoded stream.
enum AVColorSpace color_space
int extradata_size
Size of the extradata content in bytes.
int frame_size
Audio only.
enum AVFieldOrder field_order
Video only.
uint64_t channel_layout
Audio only.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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.
int profile
Codec-specific bitstream restrictions that the stream conforms to.
int block_align
Audio only.
int bits_per_raw_sample
This is the number of valid bits in each output sample.
AVRational sample_aspect_ratio
Video only.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
enum AVColorPrimaries color_primaries
int sample_rate
Audio only.
enum AVColorTransferCharacteristic color_trc
enum AVColorRange color_range
Video only.
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
unsigned MaxFALL
Max average light level per frame (cd/m^2).
unsigned MaxCLL
Max content light level (cd/m^2).
uint8_t dv_bl_signal_compatibility_id
int flags
Flags modifying the (de)muxer behaviour.
int strict_std_compliance
Allow non-standard and experimental extension.
AVStream ** streams
A list of all streams in the file.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
This structure supplies correlation between a packet timestamp and a wall clock production time.
int64_t wallclock
A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()).
Rational number (pair of numerator and denominator).
This structure describes how to handle spherical videos, outlining information about projection,...
uint32_t bound_left
Distance from the left edge.
enum AVSphericalProjection projection
Projection type.
uint32_t bound_top
Distance from the top edge.
uint32_t bound_bottom
Distance from the bottom edge.
uint32_t bound_right
Distance from the right edge.
int32_t pitch
Rotation around the right vector [-90, 90].
int32_t roll
Rotation around the forward vector [-180, 180].
int32_t yaw
Rotation around the up vector [-180, 180].
uint32_t padding
Number of pixels to pad from the edge of each cube face.
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
enum AVStereo3DType type
How views are packed within the video.
int flags
Additional information about the frame packing.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int64_t nb_frames
number of frames in this stream if known or 0
int index
stream index in AVFormatContext
AVRational avg_frame_rate
Average framerate.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
attribute_deprecated AVCodecContext * codec
int disposition
AV_DISPOSITION_* bit field.
unsigned int chunkNum
Chunk number if the current entry is a chunk start otherwise 0.
unsigned int samples_in_chunk
AVProducerReferenceTime prft
struct AVAESCTR * aes_ctr
int reserved_moov_size
0 for disabled, -1 for automatic, size otherwise
int chapter_track
qt chapter track number
int need_rewrite_extradata
char * encryption_scheme_str
int missing_duration_warned
int min_fragment_duration
int64_t reserved_header_pos
int max_fragment_duration
int video_track_timescale
int nb_meta_tmcd
number of new created tmcd track based on metadata (aka not data copy)
int use_stream_ids_as_track_ids
MOVEncryptionScheme encryption_scheme
int src_track
the track that this hint (or tmcd) track describes
unsigned frag_info_capacity
uint32_t palette[AVPALETTE_COUNT]
int last_sample_is_subtitle_end
MOVFragmentInfo * frag_info
uint32_t default_sample_flags
int hint_track
the track that hints this track, -1 if no hint track is set
struct MOVTrack::@269 vc1_info
AVFormatContext * rtp_ctx
the format context for the hinting rtp muxer
unsigned cluster_capacity
int tref_id
trackID of the referenced track
int height
active picture (w/o VBI) height for D-10/IMX
struct eac3_info::@268 substream[1]
uint32_t avg_bit_rate
Average rate in bits/second over the entire presentation.
uint32_t max_bit_rate
Maximum rate in bits/second over any window of one second.
uint32_t buffer_size
Size of the decoding buffer for the elementary stream in bytes.
#define av_malloc_array(a, b)
#define avpriv_request_sample(...)
static int ref[MAX_W *MAX_W]
static void init(int bf, int audio_preroll)
int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
Parse timecode representation (hh:mm:ss[:;.
int av_timecode_check_frame_rate(AVRational rate)
Check if the timecode feature is available for the given frame rate.
@ AV_TIMECODE_FLAG_DROPFRAME
timecode is drop frame
static int write_trailer(AVFormatContext *s1)
static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, uint8_t *dst)
static av_always_inline const uint8_t * find_next_marker(const uint8_t *src, const uint8_t *end)
Find VC-1 marker in buffer.
static double cr(void *priv, double x, double y)
static double cb(void *priv, double x, double y)
static const uint8_t offset[127][2]
int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
Writes VP codec configuration to the provided AVIOContext.
internal header for VPx codec configuration utilities.