24#include "config_components.h"
86 {
"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 },
92 {
"movflags",
"MOV muxer flags", offsetof(
MOVMuxContext,
flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, .unit =
"movflags" },
96 {
"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, .unit =
"movflags" },
106 {
"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, .unit = 0 },
115 {
"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, .unit =
"movflags" },
117 {
"hybrid_fragmented",
"For recoverability, write a fragmented file that is converted to non-fragmented at the end.", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_MOV_FLAG_HYBRID_FRAGMENTED}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, .unit =
"movflags" },
127 {
"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, .unit =
"prft"},
135 .class_name =
"mov/mp4/tgp/psp/tg2/ipod/ismv/f4v muxer",
214 for (
i = 0;
i < track->
entry;
i++) {
229 int i, j, entries = 0, tst = -1, oldtst = -1;
236 for (
i = 0;
i < track->
entry;
i++) {
238 if (oldtst != -1 && tst != oldtst)
243 if (equalChunks && track->
entry) {
245 sSize =
FFMAX(1, sSize);
251 for (
i = 0;
i < track->
entry;
i++) {
264 int index = 0, oldidx = -1, oldval = -1,
i;
273 for (
i = 0;
i < track->
entry;
i++) {
303 for (
i = 0;
i < track->
entry;
i++) {
320 uint8_t leading, dependent, reference, redundancy;
325 for (
i = 0;
i < track->
entry;
i++) {
334 avio_w8(pb, (leading << 6) | (dependent << 4) |
335 (reference << 2) | redundancy);
345 uint8_t *dyn_buf =
NULL;
428 "Cannot write moov atom before AC3 packets."
429 " Set the delay_moov flag to fix this.\n");
435 "RealAudio AC-3/DolbyNet with bsid %d is not defined by the "
436 "ISOBMFF specification in ETSI TS 102 366!\n",
443 "No valid AC3 bit rate code for data rate of %d!\n",
564 while (cumul_size !=
pkt->size) {
585 for (
int j = 0; j < 8; j++) {
620 if (sd && sd->
size >= 10) {
654 "Cannot write moov atom before EAC3 packets parsed.\n");
810 put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1);
815 put_descr(pb, 0x04, 13 + decoder_specific_info_len);
953 "Cannot write moov atom before TrueHD packets."
954 " Set the delay_moov flag to fix this.\n");
980 "Invalid extradata size %d for MPEGH-H stream.\n",
1015 int ambisonic_order, ambi_channels, non_diegetic_channels;
1036 if (ambisonic_order < 0)
1039 ambi_channels = (ambisonic_order + 1LL) * (ambisonic_order + 1LL);
1040 non_diegetic_channels = ch_layout.
nb_channels - ambi_channels;
1041 if (non_diegetic_channels &&
1042 (non_diegetic_channels != 2 ||
1053 avio_w8(pb, (!!non_diegetic_channels) << 7);
1058 for (
i = 0;
i < ambi_channels;
i++)
1070 uint32_t layout_tag, bitmap, *channel_desc;
1078 &bitmap, &channel_desc);
1083 "lack of channel information\n");
1097 channel_desc =
av_malloc(
sizeof(*channel_desc));
1116 for (
int i = 0;
i < num_desc;
i++) {
1177 int unescaped_size, seq_found = 0;
1178 int level = 0, interlace = 0;
1187 packet_seq = packet_entry = 1;
1189 "moov atom written before any packets, unable to write correct "
1190 "dvc1 atom. Set the delay_moov flag to fix this.\n");
1197 for (next = start; next < end; start = next) {
1201 size = next - start - 4;
1258 uint8_t buf[7] = { 0 };
1315 if (cluster_idx >= track->
entry)
1318 if (cluster_idx + 1 == track->
entry)
1321 next_dts = track->
cluster[cluster_idx + 1].
dts;
1333 int i, first_duration;
1343 for (
i = 1;
i < track->
entry;
i++) {
1347 return first_duration;
1374 uint8_t *speaker_pos =
NULL;
1378 if (ret || !config) {
1384 speaker_pos,
layout->nb_channels);
1386 char buf[128] = {0};
1453 uint32_t
tag = track->
tag;
1529 while (sample_rate > UINT16_MAX)
1534 if (track->
tag ==
MKTAG(
'i',
'a',
'm',
'f'))
1570 else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'a'))
1573 else if (track->
tag ==
MKTAG(
'i',
'a',
'm',
'f'))
1574 ret = mov_write_iacb_tag(mov->
fc, pb, track);
1718 if (track->
tag ==
MKTAG(
'h',
'v',
'c',
'1'))
1734 if (track->
tag ==
MKTAG(
'h',
'v',
'c',
'1'))
1756 if (track->
tag ==
MKTAG(
'e',
'v',
'c',
'1'))
1789 if (track->
tag ==
MKTAG(
'v',
'v',
'c',
'1'))
1819 int display_width = track->
par->
width;
1820 const uint8_t *extradata;
1851 if (track->
tag ==
MKTAG(
'A',
'V',
'd',
'h')) {
1852 int alp = extradata[0x07] & 1;
1853 int pma = (extradata[0x07] >> 2) & 1;
1854 int sbd = (extradata[0x21] >> 5) & 3;
1855 int ssc = (extradata[0x2C] >> 5) & 3;
1856 int clv = (extradata[0x2C] >> 1) & 3;
1857 int clf = extradata[0x2C] & 1;
1960 }
else if (track->
par->
height == 1080) {
1975 if (rational_framerate.
den != 0)
1976 rate =
av_q2d(rational_framerate);
1993 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'v',
'4');
1994 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'5');
1995 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'1');
1996 else if (rate == 50)
tag =
MKTAG(
'x',
'd',
'v',
'a');
1997 else if (rate == 60)
tag =
MKTAG(
'x',
'd',
'v',
'9');
2001 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'v',
'6');
2002 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'7');
2003 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'8');
2005 if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'3');
2006 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'2');
2010 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'v',
'd');
2011 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'e');
2012 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'f');
2014 if (rate == 25)
tag =
MKTAG(
'x',
'd',
'v',
'c');
2015 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'v',
'b');
2021 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'5',
'4');
2022 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'5',
'5');
2023 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'5',
'1');
2024 else if (rate == 50)
tag =
MKTAG(
'x',
'd',
'5',
'a');
2025 else if (rate == 60)
tag =
MKTAG(
'x',
'd',
'5',
'9');
2029 if (rate == 24)
tag =
MKTAG(
'x',
'd',
'5',
'd');
2030 else if (rate == 25)
tag =
MKTAG(
'x',
'd',
'5',
'e');
2031 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'5',
'f');
2033 if (rate == 25)
tag =
MKTAG(
'x',
'd',
'5',
'c');
2034 else if (rate == 30)
tag =
MKTAG(
'x',
'd',
'5',
'b');
2059 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'5',
'p');
2060 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'5',
'q');
2061 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'5',
'p');
2062 else if (rate == 50)
tag =
MKTAG(
'a',
'i',
'5',
'q');
2063 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'5',
'p');
2067 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'5',
'3');
2068 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'5',
'2');
2069 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'5',
'3');
2071 if (rate == 50)
tag =
MKTAG(
'a',
'i',
'5',
'5');
2072 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'5',
'6');
2078 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'1',
'p');
2079 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'1',
'q');
2080 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'1',
'p');
2081 else if (rate == 50)
tag =
MKTAG(
'a',
'i',
'1',
'q');
2082 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'1',
'p');
2086 if (rate == 24)
tag =
MKTAG(
'a',
'i',
'1',
'3');
2087 else if (rate == 25)
tag =
MKTAG(
'a',
'i',
'1',
'2');
2088 else if (rate == 30)
tag =
MKTAG(
'a',
'i',
'1',
'3');
2090 if (rate == 25)
tag =
MKTAG(
'a',
'i',
'1',
'5');
2091 else if (rate == 50)
tag =
MKTAG(
'a',
'i',
'1',
'5');
2092 else if (rate == 60)
tag =
MKTAG(
'a',
'i',
'1',
'6');
2125static const struct {
2176 if (
tag ==
MKTAG(
'r',
'a',
'w',
' ') &&
2180 av_log(
s,
AV_LOG_ERROR,
"%s rawvideo cannot be written to mov, output file will be unreadable\n",
2221 "the file may be unplayable!\n");
2228 tag =
MKTAG(
'm',
's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
2230 "the file may be unplayable!\n");
2255 for (
i = 0; tags && tags[
i];
i++) {
2260 return codec_tags->
tag;
2277 "Quicktime/Ipod might not play the file\n");
2303 0x0000, 0x0100, 0x0201, 0x0206, 0x0209, 0x020e
2308 unsigned mov_field_order = 0;
2310 mov_field_order =
fiel_data[field_order];
2348 "Unknown codec tag '%s' utilized for TTML stream with "
2349 "index %d (track id %d)!\n",
2368 if (stereo_3d->
flags != 0) {
2373 switch (stereo_3d->
type) {
2396 int64_t sv3d_pos, svhd_pos, proj_pos;
2508 switch (stereo3d->
view) {
2516 view |= (1 << 0) | (1 << 1);
2559 if (spherical_mapping &&
2566 spherical_mapping =
NULL;
2579 if (!spherical_mapping && !stereo3d)
2586 if (spherical_mapping)
2618 return 8 + sd->
size;
2622 uint32_t top, uint32_t bottom,
2623 uint32_t
left, uint32_t right)
2625 uint32_t cropped_width = track->
par->
width -
left - right;
2626 uint32_t cropped_height = track->
height - top - bottom;
2670 gama = (uint32_t)
lrint((
double)(1<<16) * gamma);
2701 return 12 + sd->
size;
2754 const int chroma_den = 50000;
2755 const int luma_den = 10000;
2785 const int illuminance_den = 10000;
2786 const int ambient_den = 50000;
2829 }
else if(track->
par->
width == 1440) {
2848 uint8_t ccstValue = (0 << 7) |
2865 avio_write(pb,
"urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44);
2874 char compressor_name[32] = { 0 };
2894 if (uncompressed_ycbcr) {
2920 avio_w8(pb, strlen(compressor_name));
2940 for (
i = 0;
i < pal_size;
i++) {
2942 uint16_t
r = (
rgb >> 16) & 0xff;
2943 uint16_t
g = (
rgb >> 8) & 0xff;
2944 uint16_t
b =
rgb & 0xff;
2953 if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'v'))
3050 else if (spherical_mapping)
3071 if (stereo3d || spherical_mapping)
3104 if (sd && sd->
size >=
sizeof(uint32_t) * 4) {
3111 (top + bottom) >= track->
height) {
3115 if (top || bottom ||
left || right)
3117 }
else if (uncompressed_ycbcr)
3164 uint64_t str_size =strlen(reel_name);
3167 if (str_size >= UINT16_MAX){
3197 if (nb_frames > 255) {
3281 uint32_t entries = 0;
3288 ctts_entries[0].
count = 1;
3290 for (
i = 1;
i < track->
entry;
i++) {
3292 ctts_entries[entries].
count++;
3296 ctts_entries[entries].
count = 1;
3300 atom_size = 16 + (entries * 8);
3309 for (
i = 0;
i < entries;
i++) {
3321 uint32_t entries = -1;
3326 stts_entries =
av_malloc(
sizeof(*stts_entries));
3338 for (
i = 0;
i < track->
entry;
i++) {
3345 stts_entries[entries].
count++;
3349 stts_entries[entries].
count = 1;
3354 atom_size = 16 + (entries * 8);
3359 for (
i = 0;
i < entries;
i++) {
3386 int16_t roll_distance;
3387 int group_description_index;
3390 struct sgpd_entry *sgpd_entries =
NULL;
3410 for (
i = 0;
i < track->
entry;
i++) {
3411 int roll_samples_remaining = roll_samples;
3413 for (j =
i - 1; j >= 0; j--) {
3416 if (roll_samples_remaining <= 0)
3422 if (roll_samples_remaining > 0)
3429 if (
i &&
distance == sgpd_entries[entries].roll_distance) {
3430 sgpd_entries[entries].count++;
3433 sgpd_entries[entries].count = 1;
3434 sgpd_entries[entries].roll_distance =
distance;
3435 sgpd_entries[entries].group_description_index =
distance ? ++group : 0;
3441 sgpd_entries[entries].roll_distance = 1;
3442 sgpd_entries[entries].group_description_index = ++group;
3458 for (
i = 0;
i < entries;
i++) {
3459 if (sgpd_entries[
i].group_description_index) {
3460 avio_wb16(pb, -sgpd_entries[
i].roll_distance);
3470 for (
i = 0;
i < entries;
i++) {
3472 avio_wb32(pb, sgpd_entries[
i].group_description_index);
3546 const char *font =
"Lucida Grande";
3586 if (track->
tag !=
MKTAG(
'c',
'6',
'0',
'8')) {
3645 for (
int i = 0;
i < 3;
i++)
3652 return track->
tag ==
MKTAG(
'c',
'7',
'0',
'8') ||
3653 track->
tag ==
MKTAG(
'c',
'6',
'0',
'8');
3659 const char *hdlr, *descr =
NULL, *hdlr_type =
NULL;
3665 descr =
"DataHandler";
3668 hdlr = (track->
mode ==
MODE_MOV) ?
"mhlr" :
"\0\0\0\0";
3671 hdlr_type = (track == &mov->
tracks[0]) ?
"pict" :
"auxv";
3672 descr =
"PictureHandler";
3675 descr =
"VideoHandler";
3679 descr =
"SoundHandler";
3683 descr =
"ClosedCaptionHandler";
3685 if (track->
tag ==
MKTAG(
't',
'x',
'3',
'g')) {
3687 }
else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
's')) {
3694 descr =
"SubtitleHandler";
3698 descr =
"HintHandler";
3701 descr =
"TimeCodeHandler";
3704 descr =
"GoPro MET";
3707 "Unknown hdlr_type for %s, writing dummy values\n",
3732 descr_len = strlen(descr);
3825 avio_wb32(pb,
s->streams[stream_index]->codecpar->width);
3826 avio_wb32(pb,
s->streams[stream_index]->codecpar->height);
3931 }
else if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
3933 }
else if (track->
tag ==
MKTAG(
't',
'm',
'c',
'd')) {
3938 }
else if (track->
tag ==
MKTAG(
'g',
'p',
'm',
'd')) {
4031 else if (!track->
entry)
4040 "FATAL error, file duration too long for timebase, this file will not be\n"
4041 "playable with QuickTime. Choose a different timebase with "
4042 "-video_track_timescale or a different container format\n");
4068 int16_t d, int16_t tx, int16_t ty)
4091 uint32_t *display_matrix =
NULL;
4110 if (sd && sd->
size == 9 *
sizeof(*display_matrix))
4111 display_matrix = (uint32_t *)sd->
data;
4134 else if (!track->
entry)
4151 if (display_matrix) {
4152 for (
i = 0;
i < 9;
i++)
4162 track_width_1616 = track->
par->
width * 0x10000ULL;
4167 if (!track_width_1616 ||
4169 track_width_1616 > UINT32_MAX)
4170 track_width_1616 = track->
par->
width * 0x10000ULL;
4172 if (track_width_1616 > UINT32_MAX) {
4174 track_width_1616 = 0;
4177 if (track->
height > 0xFFFF) {
4231 int entry_size, entry_count,
size;
4240 "EDTS using dts:%"PRId64
" cts:%d instead of dts:%"PRId64
" cts:%"PRId64
" tid:%d\n",
4242 start_dts, start_ct, track->
track_id);
4261 version |= delay < INT32_MAX ? 0 : 1;
4263 entry_size = (
version == 1) ? 20 : 12;
4264 entry_count = 1 + (delay > 0);
4265 size = 24 + entry_count * entry_size;
4296 start_ct = -
FFMIN(start_dts, 0);
4342 for (
int j = 0; j <
tag->nb_id; j++)
4370 char buf[1000] =
"";
4390 const char *
tag,
const char *str)
4415 avio_write(pb, (
const unsigned char *)scheme_uri,
4416 strlen(scheme_uri));
4436 for (
int j = 0;
map.value_maps[j].disposition; j++) {
4486 int entry_backup = track->
entry;
4506 "Not writing any edit list even though one would have been required\n");
4519 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' '))
4533 track->
entry = entry_backup;
4540 int i, has_audio = 0, has_video = 0;
4550 if (audio_profile < 0)
4551 audio_profile = 0xFF - has_audio;
4552 if (video_profile < 0)
4553 video_profile = 0xFF - has_video;
4593 int max_track_id = 1,
i;
4605 if (max_track_len < max_track_len_temp)
4606 max_track_len = max_track_len_temp;
4607 if (max_track_id < mov->tracks[
i].track_id)
4674 size_t data_len = strlen(
data);
4676 int size = 16 + data_len;
4689 return data_len + 4;
4694 const char *
value,
int lang,
int long_style)
4708 const char *
name,
const char *
data)
4713 static const char stub_flags[4] = {0, 0, 0, 0};
4719 size_t mean_len = strlen(
mean);
4722 avio_write(pb, &stub_flags[0],
sizeof(stub_flags));
4725 size_t name_len = strlen(
name);
4728 avio_write(pb, &stub_flags[0],
sizeof(stub_flags));
4737 const char *
tag,
int *lang)
4749 snprintf(tag2,
sizeof(tag2),
"%s-",
tag);
4751 len2 = strlen(t2->
key);
4762 const char *
name,
const char *
tag,
4773 const char *
mean,
const char *
name,
4786 int size = 0, tmpo = t ? atoi(t->
value) : 0;
4805 double latitude, longitude, altitude;
4806 int32_t latitude_fix, longitude_fix, altitude_fix;
4808 const char *ptr, *place =
"";
4810 static const char *astronomical_body =
"earth";
4815 latitude =
strtod(ptr, &end);
4821 longitude =
strtod(ptr, &end);
4827 altitude =
strtod(ptr, &end);
4832 latitude_fix = (
int32_t) ((1 << 16) * latitude);
4833 longitude_fix = (
int32_t) ((1 << 16) * longitude);
4834 altitude_fix = (
int32_t) ((1 << 16) * altitude);
4845 avio_write(pb, astronomical_body, strlen(astronomical_body) + 1);
4856 disc ?
"disc" :
"track",
4858 int size = 0, track = t ? atoi(t->
value) : 0;
4861 char *slash = strchr(t->
value,
'/');
4863 tracks = atoi(slash + 1);
4880 const char *
name,
const char *
tag,
4887 if (
len != 1 &&
len != 4)
4892 num = atoi(t->
value);
5004 size_t key_len = strlen(t->
key);
5072 const char *
name,
const char *
key)
5104 return (((str[0] - 0x60) & 0x1F) << 10) +
5105 (((str[1] - 0x60) & 0x1F) << 5) +
5106 (( str[2] - 0x60) & 0x1F);
5110 const char *
tag,
const char *str)
5119 if (!strcmp(
tag,
"yrrc"))
5124 if (!strcmp(
tag,
"albm") &&
5134 int i, nb_chapters =
FFMIN(
s->nb_chapters, 255);
5142 for (
i = 0;
i < nb_chapters;
i++) {
5216 const char *str,
const char *lang,
int type)
5279 if (!
copy->data_size && !
copy->num_key_ids)
5287 for (
int i = 0;
i <
copy->system_id_size;
i++)
5290 for (
int i = 0;
i <
copy->num_key_ids;
i++)
5291 for (
int j = 0; j <
copy->key_id_size; j++)
5307 uint64_t chunkSize = chunk->
size;
5321 chunkSize = chunk->
size;
5347 int next_generated_track_id = 0;
5350 if (st->
id > next_generated_track_id)
5351 next_generated_track_id = st->
id;
5361 int last_track_id = 0;
5369 :
FFMAX(
i, last_track_id)) + 1;
5380 for (
int i = 0;
i <
tag->nb_id;
i++) {
5381 if (
tag->id[
i] ==
id)
5462 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
5484 if (sd && sd->
size ==
sizeof(
int)) {
5485 int *fallback = (
int *)sd->
data;
5486 if (*fallback >= 0 && *fallback < mov->nb_tracks) {
5561 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n",
name, buf);
5569 static const AVUUID uuid = {
5570 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
5571 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
5579 avio_printf(pb,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
5580 avio_printf(pb,
"<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
5583 avio_printf(pb,
"<meta name=\"creator\" content=\"%s\" />\n",
5597 char track_name_buf[32] = { 0 };
5621 av_strlcatf(track_name_buf,
sizeof(track_name_buf),
5622 "_%s", lang->
value);
5626 av_strlcat(track_name_buf,
"_cc",
sizeof(track_name_buf));
5628 av_strlcat(track_name_buf,
"_ad",
sizeof(track_name_buf));
5709 if (!track->
entry) {
5756 if (track->
entry > 1)
5777 for (
i = first;
i < end;
i++) {
5810 for (
i = first;
i < end;
i++) {
5828 static const uint8_t uuid[] = {
5829 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
5830 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
5849 int size = 8 + 16 + 4 + 1 + 16*n;
5850 static const uint8_t uuid[] = {
5851 0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
5852 0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
5865 for (
i = 0;
i < n;
i++) {
5870 if (n < mov->ism_lookahead) {
5901 if ((tracks >= 0 &&
i != tracks) || !track->
entry)
5923 if (info->
time < 0) {
5938 if ((tracks >= 0 &&
i != tracks) || !track->
entry)
5971 for (
i = 1;
i < track->
entry;
i++) {
6002 int tracks,
int moof_size)
6014 if (tracks >= 0 &&
i != tracks)
6027 MOVTrack *track,
int ref_size,
int total_sidx_size)
6031 unsigned starts_with_SAP;
6042 if (presentation_time < 0) {
6044 presentation_time = 0;
6065 for (
i = 0;
i < entries;
i++) {
6066 if (!track->
entry) {
6072 starts_with_SAP = 1;
6074 avio_wb32(pb, (0 << 31) | (ref_size & 0x7fffffff));
6076 avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0);
6080 offset =
pos + total_sidx_size - end_pos;
6088 int tracks,
int ref_size)
6093 for (round = 0; round < 2; round++) {
6106 if (tracks >= 0 &&
i != tracks)
6111 if (!track->
entry && ref_size > 0)
6135 first_track = &(mov->
tracks[0]);
6137 if (!first_track->
entry) {
6283 int has_h264,
int has_video,
int write_minor)
6292 minor = has_h264 ? 0x100 : 0x200;
6298 minor = has_h264 ? 0x20000 : 0x10000;
6327 int has_h264 = 0, has_av1 = 0, has_video = 0, has_dolby = 0, has_id3 = 0;
6331 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
6377 const int depth = pix_fmt_desc->
comp[0].
depth;
6387 if (depth == 8 || depth == 10) {
6452 (
video_st->avg_frame_rate.num * 0x10000LL) /
video_st->avg_frame_rate.den :
6454 int audio_kbitrate = audio_par->
bit_rate / 1000;
6455 int video_kbitrate =
FFMIN(video_par->
bit_rate / 1000, 800 - audio_kbitrate);
6457 if (frame_rate < 0 || frame_rate > INT32_MAX) {
6458 av_log(
s,
AV_LOG_ERROR,
"Frame rate %f outside supported range\n", frame_rate / (
double)0x10000);
6523 int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;
6536 if (video_streams_nb != 1 || audio_streams_nb != 1 || other_streams_nb) {
6548 int i, closed_gop = 0;
6550 for (
i = 0;
i <
pkt->size - 4;
i++) {
6551 c = (
c << 8) +
pkt->data[
i];
6553 closed_gop =
pkt->data[
i + 4] >> 6 & 0x01;
6554 }
else if (
c == 0x100) {
6555 int temp_ref = (
pkt->data[
i + 1] << 2) | (
pkt->data[
i + 2] >> 6);
6556 if (!temp_ref || closed_gop)
6568 const uint8_t *start, *next, *end =
pkt->data +
pkt->size;
6569 int seq = 0,
entry = 0;
6572 for (next = start; next < end; start = next) {
6634 if (length < 8 || length >
pkt->size)
6686 if (!had_packets && squashed_packet->
duration == 0) {
6719 "Failed to write squashed packet for %s stream with "
6720 "index %d and track id %d. Error: %s\n",
6745 for (
i = 0;
i < track->
entry;
i++) {
6767 int i, first_track = -1;
6768 int64_t mdat_size = 0, mdat_start = 0;
6770 int has_video = 0, starts_with_key = 0, first_video_track = 1;
6809 if (track->
entry <= 1)
6827 "Estimating the duration of the last packet in a "
6828 "fragment, consider setting the duration field in "
6829 "AVPacket instead.\n");
6837 int buf_size, moov_size;
6905 if (first_video_track) {
6908 first_video_track = 0;
6915 if (first_track < 0)
6928 int buf_size, write_moof = 1, moof_tracks = -1;
6937 write_moof =
i == first_track;
7011 av_log(
s,
AV_LOG_WARNING,
"Packet duration: %"PRId64
" / dts: %"PRId64
" in stream %d is out of range\n",
7018 if (
pkt->duration < 0 ||
pkt->duration > INT_MAX) {
7019 av_log(
s,
AV_LOG_ERROR,
"Application provided duration: %"PRId64
" in stream %d is invalid\n",
pkt->duration,
pkt->stream_index);
7034 stream_index < 0 || stream_index >=
s->nb_streams ||
7038 st =
s->streams[stream_index];
7053 candidate_duration = dts - track->
start_dts;
7054 if (dts <= track->cluster[track->
entry - 1].dts ||
7055 candidate_duration < 0 || candidate_duration >= track->
track_duration)
7074 unsigned int samples_in_chunk = 0;
7078 uint8_t *reformatted_data =
NULL;
7080 if (
pkt->stream_index <
s->nb_streams)
7081 trk =
s->streams[
pkt->stream_index]->priv_data;
7122 static const uint16_t packed_size[16] =
7123 {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
7126 while (
len <
size && samples_in_chunk < 100) {
7127 len += packed_size[(
pkt->data[
len] >> 3) & 0x0F];
7130 if (samples_in_chunk > 1) {
7131 av_log(
s,
AV_LOG_ERROR,
"fatal error, input is not a single packet, implement a AVParser for it\n");
7140 samples_in_chunk = 1;
7142 if (samples_in_chunk < 1) {
7180 if (
pkt->size && sd && sd->
size > 0) {
7197 if (!extradata_size)
7216 "use the audio bitstream filter 'aac_adtstoasc' to fix it "
7217 "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
7246 int filter_ps = (trk->
tag ==
MKTAG(
'h',
'v',
'c',
'1'));
7320 for (
int i = 0;
i <
pkt->size;
i += 3) {
7321 if (
pkt->data[
i] == 0xFC) {
7327 for (
int i = 0;
i <
pkt->size;
i += 3) {
7328 if (
pkt->data[
i] == 0xFC) {
7344 int nal_size_length = (extradata[4] & 0x3) + 1;
7347 int nal_size_length = (extradata[21] & 0x3) + 1;
7440 "Track %d starts with a nonzero dts %"PRId64
", while the moov "
7441 "already has been written. Set the delay_moov flag to handle "
7443 pkt->stream_index,
pkt->dts);
7466 if (
pkt->dts !=
pkt->pts)
7515 reformatted_data ? reformatted_data +
offset
7521 if (
pkt->data != reformatted_data)
7529 MOVTrack *trk =
s->streams[
pkt->stream_index]->priv_data;
7562 memcpy(newextra, side, side_size);
7583 s->streams[
pkt->stream_index]->time_base,
7622 uint8_t
data[2] = {0};
7651 s->streams[
pkt->stream_index]->id,
pkt);
7665 "stream #%d\n",
pkt->stream_index);
7689 const char *scheme_id_uri =
"https://aomedia.org/emsg/ID3";
7690 const char *
value =
"";
7707 avio_write(pb, scheme_id_uri, strlen(scheme_id_uri) + 1);
7729 trk =
s->streams[
pkt->stream_index]->priv_data;
7733 int ret = mov_build_iamf_packet(
s, trk,
pkt);
7738 "for stream #%d\n", trk->
st->
index);
7750 " ignoring.\n",
pkt->stream_index);
7791 if (ret < 0)
return ret;
7808 "Packets without a valid presentation timestamp are "
7809 "not supported with packet squashing!\n");
7826 int reshuffle_ret, ret;
7829 int expected_stride = ((trk->
par->
width * bpc + 15) >> 4)*2;
7831 if (reshuffle_ret < 0)
7832 return reshuffle_ret;
7847 for (
i = 0;
i <
pkt->size;
i++)
7850 if (reshuffle_ret) {
7867 static const uint8_t stub_header[] = {
7869 0x00, 0x00, 0x00, 0x01,
7871 0x00, 0x00, 0x00, 0x00,
7873 0x00, 0x00, 0x00, 0x00,
7874 0x00, 0x00, 0x00, 0x00,
7876 0x00, 0x00, 0x00, 0x00,
7879 0x00, 0x00, 0x00, 0x00,
7881 0x00, 0x00, 0x00, 0x0D,
7895 track->
tag =
MKTAG(
't',
'e',
'x',
't');
7904 memcpy(track->
par->
extradata, stub_header,
sizeof(stub_header));
7919 pkt->stream_index = tracknum;
7922 for (
i = 0;
i <
s->nb_chapters;
i++) {
7928 pkt->duration = end -
pkt->dts;
7931 static const char encd[12] = {
7932 0x00, 0x00, 0x00, 0x0C,
7934 0x00, 0x00, 0x01, 0x00 };
7936 pkt->size =
len + 2 + 12;
7944 memcpy(
pkt->data +
len + 2, encd,
sizeof(encd));
7977 track->
tag =
MKTAG(
't',
'm',
'c',
'd');
8061 if (!enabled[
i] && first[
i] >= 0)
8072 for (
int i = 0;
i <
s->nb_streams;
i++)
8073 s->streams[
i]->priv_data =
NULL;
8085 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' '))
8132 r = (
rgb >> 16) & 0xFF;
8133 g = (
rgb >> 8) & 0xFF;
8140 return (y << 16) | (
cr << 8) |
cb;
8147 int have_palette = 0, have_size = 0;
8148 uint32_t palette[16];
8151 while (cur && *cur) {
8152 if (strncmp(
"palette:", cur, 8) == 0) {
8154 count = sscanf(cur + 8,
8155 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
8156 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
8157 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
8158 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
"",
8159 &palette[ 0], &palette[ 1], &palette[ 2], &palette[ 3],
8160 &palette[ 4], &palette[ 5], &palette[ 6], &palette[ 7],
8161 &palette[ 8], &palette[ 9], &palette[10], &palette[11],
8162 &palette[12], &palette[13], &palette[14], &palette[15]);
8164 for (
i = 0;
i < count;
i++) {
8168 }
else if (!strncmp(
"size:", cur, 5)) {
8172 if (have_palette && have_size)
8174 cur += strcspn(cur,
"\n\r");
8175 cur += strspn(cur,
"\n\r");
8181 for (
i = 0;
i < 16;
i++) {
8199 int first_iamf_idx = INT_MAX, last_iamf_idx = 0;
8200 int nb_audio_elements = 0, nb_mix_presentations = 0;
8203 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
8207 nb_audio_elements++;
8209 nb_mix_presentations++;
8212 if (!nb_audio_elements && !nb_mix_presentations)
8215 if (nb_audio_elements < 1 || nb_audio_elements > 2 || nb_mix_presentations < 1) {
8217 "one IAMF_MIX_PRESENTATION stream groups to write a IMAF track\n");
8226 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
8250 track = &mov->
tracks[first_iamf_idx];
8254 track->
tag =
MKTAG(
'i',
'a',
'm',
'f');
8256 for (
int i = 0;
i <
s->nb_stream_groups;
i++) {
8284#define IS_MODE(muxer, config) (CONFIG_ ## config ## _MUXER && !strcmp(#muxer, s->oformat->name))
8312 av_log(
s,
AV_LOG_ERROR,
"Setting both hybrid_fragmented and faststart is not supported.\n");
8358 av_log(
s,
AV_LOG_WARNING,
"No meaningful edit list will be written when using empty_moov without delay_moov\n");
8377 "Sample interleaving in fragments is mutually exclusive with "
8378 "omit_tfhd_offset and separate_moof\n");
8394 if (
s->nb_streams > 2) {
8403 if (
s->nb_streams > 1) {
8407 av_log(
s,
AV_LOG_ERROR,
"Second stream for AVIF (alpha) output must have exactly one plane\n");
8414 for (
i = 0;
i <
s->nb_stream_groups;
i++) {
8419 av_log(
s,
AV_LOG_ERROR,
"Exactly two Streams are supported for Stream Groups of type LCEVC\n");
8441 "IAMF Audio Element\n", j);
8453 for (
i = 0;
i <
s->nb_streams;
i++) {
8473 for (
i = 0;
i <
s->nb_streams;
i++)
8488 for (
i = 0;
i <
s->nb_streams;
i++) {
8502 for (
i = 0;
i <
s->nb_streams;
i++) {
8506 "so timecode metadata are now ignored\n");
8554 ret = mov_init_iamf_track(
s);
8559 for (
int j = 0,
i = 0; j <
s->nb_streams; j++) {
8571 for (
i = 0;
i <
s->nb_streams;
i++) {
8585 if (!movie_timescale.
den)
8591 for (
i = 0;
i <
s->nb_streams;
i++) {
8607 "codec not currently supported in container\n",
8619 if (track->
tag ==
MKTAG(
'm',
'x',
'3',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'3',
'n') ||
8620 track->
tag ==
MKTAG(
'm',
'x',
'4',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'4',
'n') ||
8621 track->
tag ==
MKTAG(
'm',
'x',
'5',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'5',
'n')) {
8626 track->
height = track->
tag >> 24 ==
'n' ? 486 : 576;
8631 av_log(
s,
AV_LOG_WARNING,
"Warning: some tools, like mp4split, assume a timescale of 10000000 for ISMV.\n");
8643 "WARNING codec timebase is very high. If duration is too long,\n"
8644 "file may not be playable by quicktime. Specify a shorter timebase\n"
8645 "or choose different container.\n");
8648 track->
tag ==
MKTAG(
'r',
'a',
'w',
' ')) {
8708 av_log(
s,
AV_LOG_ERROR,
"track %d: muxing mp3 at %dhz is not standard, to mux anyway set strict to -1\n",
8726 "%s in MP4 support is experimental, add "
8727 "'-strict %d' if you want to use it.\n",
8749 "ISMV style TTML support with the 'dfxp' tag in "
8750 "non-ISMV formats is not officially supported. Add "
8751 "'-strict unofficial' if you want to use it.\n");
8757 if (track->
tag ==
MKTAG(
't',
'm',
'c',
'd') &&
8786 for (
i = 0;
i <
s->nb_stream_groups;
i++) {
8789 switch (stg->
type) {
8795 for (
int j = 0; j < mov->
nb_tracks; j++) {
8827 for (
int k = 0; k < mov->
nb_tracks; k++) {
8853 for (
i = 0;
i <
s->nb_streams;
i++) {
8875 int ret, hint_track = 0, tmcd_track = 0, nb_tracks = mov->
nb_streams;
8881 hint_track = nb_tracks;
8889 tmcd_track = nb_tracks;
8942 trackj->
tag != track->
tag
8995 mov->
time += 0x7C25B080;
9013 "timecode",
NULL, 0);
9084 int i, moov_size, moov_size2;
9100 if (moov_size2 != moov_size)
9242 av_log(
s,
AV_LOG_INFO,
"Starting second pass: moving the moov atom to the beginning of the file\n");
9308 if (
pkt->size > 2 && (
AV_RB16(
pkt->data) & 0xfff0) == 0xfff0)
9317#if CONFIG_AVIF_MUXER
9322 int64_t pos_backup, extent_offsets[2];
9324 int buf_size, moov_size;
9367 if (extent_offsets[
i] != (uint32_t)extent_offsets[
i]) {
9380#if CONFIG_TGP_MUXER || CONFIG_TG2_MUXER
9391static const AVCodecTag *
const codec_3gp_tags_list[] = { codec_3gp_tags,
NULL };
9457#if CONFIG_MP4_MUXER || CONFIG_PSP_MUXER
9487#if CONFIG_AVIF_MUXER
9489static const AVOption avif_options[] = {
9491 {
"loop",
"Number of times to loop animated AVIF: 0 - infinite loop", offsetof(
MOVMuxContext, avif_loop_count),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, .unit = 0 },
9498static const AVCodecTag *
const codec_avif_tags_list[] = { codec_avif_tags,
NULL };
9500static const AVClass mov_avif_muxer_class = {
9501 .class_name =
"avif muxer",
9503 .option = avif_options,
9512 .p.extensions =
"mov",
9515 .p.video_codec = CONFIG_LIBX264_ENCODER ?
9535 .p.extensions =
"3gp",
9545 .p.codec_tag = codec_3gp_tags_list,
9555 .p.mime_type =
"video/mp4",
9556 .p.extensions =
"mp4",
9559 .p.video_codec = CONFIG_LIBX264_ENCODER ?
9567 .
p.codec_tag = mp4_codec_tags_list,
9577 .p.extensions =
"mp4,psp",
9580 .p.video_codec = CONFIG_LIBX264_ENCODER ?
9588 .
p.codec_tag = mp4_codec_tags_list,
9598 .p.extensions =
"3g2",
9608 .p.codec_tag = codec_3gp_tags_list,
9614#if CONFIG_IPOD_MUXER
9618 .p.mime_type =
"video/mp4",
9619 .p.extensions =
"m4v,m4a,m4b",
9635#if CONFIG_ISMV_MUXER
9639 .p.mime_type =
"video/mp4",
9640 .p.extensions =
"ismv,isma",
9661 .p.mime_type =
"application/f4v",
9662 .p.extensions =
"f4v",
9678#if CONFIG_AVIF_MUXER
9682 .p.mime_type =
"image/avif",
9683 .p.extensions =
"avif",
9689 .write_trailer = avif_write_trailer,
9692 .p.codec_tag = codec_avif_tags_list,
9693 .p.priv_class = &mov_avif_muxer_class,
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
@ EAC3_FRAME_TYPE_DEPENDENT
@ EAC3_FRAME_TYPE_INDEPENDENT
@ EAC3_FRAME_TYPE_AC3_CONVERT
static double val(void *priv, double ch)
static AVStream * video_st
static AVFormatContext * ctx
static const uint8_t channel_map[8][8]
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, int write_seq_header)
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_assert1(cond)
assert() equivalent, that does not 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)
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)
@ 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_reset_dyn_buf(AVIOContext *s)
Reset a dynamic buffer.
void ffio_write_leb(AVIOContext *s, unsigned val)
int ffio_open_null_buf(AVIOContext **s)
Open a write-only fake memory stream.
void ffio_fill(AVIOContext *s, int b, int64_t count)
int ffio_close_null_buf(AVIOContext *s)
Close a null buffer.
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
static int FUNC metadata(CodedBitstreamContext *ctx, RWContext *rw, APVRawMetadata *current)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
static void deinit(AVFormatContext *s)
AVCodecParameters * avcodec_parameters_alloc(void)
void avcodec_parameters_free(AVCodecParameters **ppar)
#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)
Colorspace value utility functions for libavutil.
#define FF_COMPLIANCE_UNOFFICIAL
Allow unofficial extensions.
#define AV_PROFILE_AAC_HE
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
#define AV_PROFILE_UNKNOWN
#define FF_COMPLIANCE_NORMAL
#define AV_PROFILE_AAC_HE_V2
#define AV_PROFILE_H264_INTRA
#define AV_PROFILE_AAC_USAC
static enum AVPixelFormat pix_fmt
static av_always_inline uint64_t ff_dnxhd_parse_header_prefix(const uint8_t *buf)
void ff_isom_put_dvcc_dvvc(void *logctx, uint8_t out[ISOM_DVCC_DVVC_SIZE], const AVDOVIDecoderConfigurationRecord *dovi)
#define ISOM_DVCC_DVVC_SIZE
int(* init)(AVBSFContext *ctx)
AVEncryptionInitInfo * av_encryption_init_info_get_side_data(const uint8_t *side_data, size_t side_data_size)
Creates a copy of the AVEncryptionInitInfo that is contained in the given side data.
void av_encryption_init_info_free(AVEncryptionInitInfo *info)
Frees the given encryption init info object.
int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data, int size, int ps_array_completeness)
Writes EVC sample metadata to the provided AVIOContext.
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
static unsigned int nb_streams
static void write_header(FFV1Context *f)
FLAC (Free Lossless Audio Codec) common stuff.
@ 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 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.
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_BINARY
Underlying C type is a uint8_t* that is either NULL or points to an array allocated with the av_mallo...
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AV_CH_LAYOUT_STEREO
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
AVCodecID
Identify the syntax and semantics of the bitstream.
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
@ 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.
const AVPacketSideData * av_packet_side_data_get(const AVPacketSideData *sd, int nb_sd, enum AVPacketSideDataType type)
Get side information from a side data array.
@ AV_PKT_DATA_HEVC_CONF
Dolby Vision enhancement-layer HEVC decoder configuration.
@ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
@ AV_PKT_DATA_SKIP_SAMPLES
Recommends skipping the specified number of samples.
@ 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_ENCRYPTION_INIT_INFO
This side data is encryption initialization data.
@ 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_FRAME_CROPPING
The number of pixels to discard from the top/bottom/left/right border of the decoded frame to obtain ...
@ 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....
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
#define AV_PKT_FLAG_DISCARD
Flag is used to discard packets which are required to maintain valid decoder state but are not requir...
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a 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.
int av_packet_make_writable(AVPacket *pkt)
Create a writable reference for the data described by a given packet, avoiding data copy if possible.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
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.
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.
int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str)
Initialize a channel layout from a given string description.
int av_channel_layout_ambisonic_order(const AVChannelLayout *channel_layout)
Return the order if the layout is n-th order standard-order ambisonic.
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
#define AV_CHANNEL_LAYOUT_MONO
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout, uint64_t mask)
Find out what channels from a given set are present in a channel layout, without regard for their pos...
@ AV_CHAN_AMBISONIC_BASE
Range of channels between AV_CHAN_AMBISONIC_BASE and AV_CHAN_AMBISONIC_END represent Ambisonic compon...
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
#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_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#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.
const char * av_default_item_name(void *ptr)
Return the context name.
double av_csp_approximate_eotf_gamma(enum AVColorTransferCharacteristic trc)
Determine a suitable EOTF 'gamma' value to match the supplied AVColorTransferCharacteristic.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
AVRational av_gcd_q(AVRational a, AVRational b, int max_den, AVRational def)
Return the best rational so that a and b are multiple of it.
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.
AVRational av_sub_q(AVRational b, AVRational c)
Subtract one rational from another.
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_realloc_array(void *ptr, size_t nmemb, size_t size)
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate an array through a pointer to a pointer.
#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.
#define LIBAVUTIL_VERSION_INT
@ AV_SPHERICAL_RECTILINEAR
Video frame displays on a flat, rectangular 2D surface.
@ 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.
@ AV_SPHERICAL_HALF_EQUIRECTANGULAR
Video frame displays as a 180 degree equirectangular projection.
@ AV_SPHERICAL_FISHEYE
Fisheye projection (Apple).
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
@ 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.
@ AV_PRIMARY_EYE_NONE
Neither eye.
@ AV_STEREO3D_VIEW_RIGHT
Frame contains only the right view.
@ AV_STEREO3D_VIEW_PACKED
Frame contains two packed views.
@ AV_STEREO3D_VIEW_LEFT
Frame contains only the left view.
@ AV_STEREO3D_VIEW_UNSPEC
Content is unspecified.
int ff_isom_write_lhvc(AVIOContext *pb, const uint8_t *data, int size, int ps_array_completeness, void *logctx)
Writes L-HEVC extradata (parameter sets with nuh_layer_id > 0, as a LHEVCDecoderConfigurationRecord) ...
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, void *logctx)
Writes HEVC extradata (parameter sets and declarative SEI NAL units with nuh_layer_id == 0,...
const VDPAUPixFmtMap * map
int ff_iamf_write_descriptors(const IAMFContext *iamf, AVIOContext *pb, void *log_ctx)
int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb, unsigned audio_substream_id, const AVPacket *pkt)
int ff_iamf_add_mix_presentation(IAMFContext *iamf, const AVStreamGroup *stg, void *log_ctx)
int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void *log_ctx)
int ff_iamf_write_parameter_blocks(const IAMFContext *iamf, AVIOContext *pb, const AVPacket *pkt, void *log_ctx)
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 struct MP4TrackKindMapping ff_mov_track_kind_table[]
const AVCodecTag ff_codec_movsubtitle_tags[]
#define MOV_TRUN_SAMPLE_DURATION
#define MOV_GRAPHICS_MODE_COPY
#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_ISMV_TTML_TAG
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO
#define MOV_TRUN_FIRST_SAMPLE_FLAGS
#define MOV_GRAPHICS_MODE_PREMUL_BLACK_ALPHA
#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_GRAPHICS_MODE_STRAIGHT_ALPHA
#define MOV_TFHD_DEFAULT_DURATION
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
int ff_isom_write_lvcc(AVIOContext *pb, const uint8_t *data, int len, void *logctx)
common internal api header.
unsigned int ff_toupper4(unsigned int x)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKTAG(a, b, c, d)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
int ff_mov_get_channel_positions_from_layout(const AVChannelLayout *layout, uint8_t *position, int position_num)
Get ISO/IEC 23001-8 OutputChannelPosition from AVChannelLayout.
int ff_mov_get_channel_layout_tag(const AVCodecParameters *par, uint32_t *layout, uint32_t *bitmap, uint32_t **pchannel_desc)
Get the channel layout tag for the specified codec id and channel layout.
int ff_mov_get_channel_config_from_layout(const AVChannelLayout *layout, int *config)
Get ISO/IEC 23001-8 ChannelConfiguration from AVChannelLayout.
#define MOV_CH_LAYOUT_UNKNOWN
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_av3c(AVIOContext *pb, const uint8_t *data, int len)
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 MovTag * mov_add_tref_tag(MOVMuxContext *mov, MOVTrack *trk, uint32_t name)
static int utf8len(const uint8_t *b)
static AVDictionaryEntry * get_metadata_lang(AVFormatContext *s, const char *tag, int *lang)
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_hvcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_stsz_tag(AVIOContext *pb, MOVTrack *track)
int ff_mov_set_fragment_end_hint(AVFormatContext *s, int stream_index, const AVPacket *pkt, AVRational src_time_base)
static int mov_write_iref_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static uint16_t mov_graphics_mode(MOVTrack *track)
static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov)
static int mov_write_evcc_tag(AVIOContext *pb, MOVTrack *track)
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_write_emsg_tag(AVIOContext *pb, AVStream *st, AVPacket *pkt)
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_iinf_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
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_mdhd_mvhd_tkhd_version(MOVMuxContext *mov, MOVTrack *track, int64_t duration)
static int mov_add_tfra_entries(AVIOContext *pb, MOVMuxContext *mov, int tracks, int size)
static int mov_write_mhac_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int shift_data(AVFormatContext *s)
static int mov_write_av3c_tag(AVIOContext *pb, MOVTrack *track)
static int64_t update_size_and_version(AVIOContext *pb, int64_t pos, int version)
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 int mov_write_amve_tag(AVIOContext *pb, MOVTrack *track)
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_sthd_tag(AVIOContext *pb)
static int mov_write_aux_tag(AVIOContext *pb, const char *aux_type)
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 int mov_write_sidx_tags(AVIOContext *pb, MOVMuxContext *mov, int tracks, int ref_size)
static int mov_write_vexu_tag(AVFormatContext *s, AVIOContext *pb, const AVStereo3D *stereo3d, const AVSphericalMapping *spherical_mapping)
static MovTag * mov_find_tref_tag(MOVMuxContext *mov, const MOVTrack *trk, uint32_t name)
static const AVClass mov_isobmff_muxer_class
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_vvcc_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_iprp_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
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 int mov_write_ipco_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static void mov_write_mdat_size(AVFormatContext *s)
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_srat_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_smhd_tag(AVIOContext *pb)
static int mov_write_clap_tag(AVIOContext *pb, MOVTrack *track, uint32_t top, uint32_t bottom, uint32_t left, uint32_t right)
static int mov_finish_fragment(MOVMuxContext *mov, MOVTrack *track, int64_t ref_pos)
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 int mov_write_lhvc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
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)
static int mov_write_tmpo_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_iloc_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int len)
static int mov_check_timecode_track(AVFormatContext *s, AVTimecode *tc, AVStream *src_st, const char *tcstr)
static int mov_write_ms_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static uint16_t language_code(const char *str)
static int mov_write_custom_metadata(AVFormatContext *s, AVIOContext *pb, const char *mean, const char *name, const char *tag)
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_esds_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_ispe_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s, int stream_index)
static int64_t update_size(AVIOContext *pb, int64_t pos)
static int mov_write_ipma_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int64_t calc_elst_duration(MOVMuxContext *mov, MOVTrack *track)
static int mov_add_tref_id(MOVMuxContext *mov, MovTag *tag, uint32_t id)
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_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_find_tref_id(MOVMuxContext *mov, const MovTag *tag, uint32_t id)
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_write_pssh_tag(AVIOContext *pb, AVStream *st)
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_get_evc_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_mdta_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s)
static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
static int mov_write_track_kind(AVIOContext *pb, const char *scheme_uri, const char *value)
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_apvc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_lvcc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_dops_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_tcmi_tag(AVIOContext *pb, MOVTrack *track)
static int64_t rescale_rational(AVRational q, int b)
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_chnl_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
static int mov_write_vmhd_tag(AVIOContext *pb, MOVTrack *track)
static int mov_write_pcmc_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
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 check_pkt(AVFormatContext *s, MOVTrack *trk, AVPacket *pkt)
static int mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
static int mov_write_pitm_tag(AVIOContext *pb, int item_id)
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_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_track_kinds(AVIOContext *pb, AVStream *st)
static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
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_write_pixi_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s, int stream_index)
static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_squashed_packet(AVFormatContext *s, MOVTrack *track)
static int mov_write_ccst_tag(AVIOContext *pb)
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 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 const struct @225371303101201053203360341351022255162073206032 mov_pix_fmt_tags[]
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 int mov_write_squashed_packets(AVFormatContext *s)
static int mov_write_eyes_tag(AVFormatContext *s, AVIOContext *pb, const AVStereo3D *stereo3d)
static unsigned int validate_codec_tag(const AVCodecTag *const *tags, unsigned int tag, int codec_id)
static void build_chunks(MOVTrack *trk)
static void get_pts_range(MOVMuxContext *mov, MOVTrack *track, int64_t *start, int64_t *end, int elst, int mdhd)
static int mov_write_mvex_tag(AVIOContext *pb, MOVMuxContext *mov)
static void mov_write_vexu_proj_tag(AVFormatContext *s, AVIOContext *pb, const AVSphericalMapping *spherical_mapping)
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_check_bitstream(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
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_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 void mov_write_hfov_tag(AVFormatContext *s, AVIOContext *pb, const AVStereo3D *stereo3d)
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_freeform_tag(AVIOContext *pb, const char *mean, const char *name, const char *data)
static int mov_write_SA3D_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
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_get_apv_codec_tag(AVFormatContext *s, MOVTrack *track)
static int mov_write_subtitle_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
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_hvce_tag(AVIOContext *pb, const AVPacketSideData *sd)
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_HYBRID_FRAGMENTED
#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_generate_squashed_ttml_packet(AVFormatContext *s, MOVTrack *track, AVPacket *pkt)
void ff_mov_cenc_flush(MOVMuxCencContext *ctx)
Clear subsample data.
int ff_mov_cenc_av1_write_obus(AVFormatContext *s, MOVMuxCencContext *ctx, AVIOContext *pb, const AVPacket *pkt)
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_init(MOVMuxCencContext *ctx, uint8_t *encryption_key, int use_subsamples, enum AVCodecID codec_id, int bitexact)
Initialize a CENC context.
void ff_mov_cenc_write_stbl_atoms(MOVMuxCencContext *ctx, AVIOContext *pb, int64_t moof_offset)
Write the cenc atoms that should reside inside stbl.
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_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.
mpeg audio layer common tables.
const uint64_t ff_mpa_cicp_channel_layout_masks[20]
#define FF_OFMT_FLAG_ALLOW_FLUSH
This flag indicates that the muxer stores data internally and supports flushing it.
int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size)
Make shift_size amount of space at read_start by shifting data in the output at read_start until the ...
int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds)
Parse creation_time in AVFormatContext metadata if exists and warn if the parsing fails.
int ff_nal_parse_units(AVIOContext *pb, const uint8_t *buf_in, int size)
int ff_nal_parse_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
static float distance(float x, float y, int band)
#define OPUS_SEEK_PREROLL_MS
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.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_YUV420P10
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_JPEG
Full range content.
@ AVALPHA_MODE_STRAIGHT
Alpha channel is independent of color values.
@ AVALPHA_MODE_PREMULTIPLIED
Alpha channel is multiplied into color values.
#define AV_PIX_FMT_YUV422P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_UYVA
packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
@ AV_PIX_FMT_GRAY16BE
Y , 16bpp, big-endian.
@ AV_PIX_FMT_V30XLE
packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-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_VYU444
packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
@ 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 flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static int put_bytes_output(const PutBitContext *s)
static av_unused void put_bits32(PutBitContext *s, uint32_t value)
Write exactly 32 bits into a bitstream.
enum AVPixelFormat avpriv_pix_fmt_find(enum PixelFormatTagLists list, unsigned fourcc)
int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette)
Retrieves the palette from a packet, either from side data, or appended to the video data in the pack...
int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecParameters *par, int expected_stride)
Reshuffles the lines to use the user specified stride.
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)
#define FF_ARRAY_ELEMS(a)
double strtod(const char *, char **)
Ambient viewing environment metadata as defined by H.274.
AVRational ambient_illuminance
Environmental illuminance of the ambient viewing environment in lux.
AVRational ambient_light_x
Normalized x chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
AVRational ambient_light_y
Normalized y chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
This structure describes the bitrate properties of an encoded bitstream.
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
An AVChannelLayout holds information about the channel layout of audio data.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
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 frame size, if known.
enum AVFieldOrder field_order
The order of the fields in interlaced video.
int height
The height of the video frame in pixels.
int nb_coded_side_data
Amount of entries in coded_side_data.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
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
The number of bytes per coded audio frame, required by some formats.
int bits_per_raw_sample
The number of valid bits in each output sample.
AVRational sample_aspect_ratio
The aspect ratio (width/height) which a single pixel should have when displayed.
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
The number of audio samples per second.
enum AVColorTransferCharacteristic color_trc
enum AVAlphaMode alpha_mode
Video with alpha channel only.
AVPacketSideData * coded_side_data
Additional data associated with the entire stream.
enum AVColorRange color_range
Additional colorspace characteristics.
int depth
Number of bits in the component.
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).
This describes info used to initialize an encryption key system.
int flags
Flags modifying the (de)muxer behaviour.
int strict_std_compliance
Allow non-standard and experimental extension.
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
This structure stores compressed data.
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.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
uint8_t nb_components
The number of components each pixel has, (1-4)
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.
uint32_t baseline
The distance between the centres of the lenses of the camera system, in micrometers.
AVRational horizontal_disparity_adjustment
Relative shift of the left and right images, which changes the zero parallax plane.
enum AVStereo3DPrimaryEye primary_eye
Which eye is the primary eye when rendering in 2D.
int flags
Additional information about the frame packing.
AVRational horizontal_field_of_view
Horizontal field of view, in degrees.
enum AVStereo3DView view
Determines which views are packed.
AVStreamGroupLayeredVideo is meant to define the relation between a base layer video stream and a sep...
int height
Height of the final image for presentation.
unsigned int el_index
Index of the enhancement layer stream in AVStreamGroup.
int width
Width of the final stream for presentation.
AVStreamGroupTREF is meant to define the relation between video, audio, or subtitle streams,...
unsigned int metadata_index
Index of the metadata stream in the AVStreamGroup.
union AVStreamGroup::@166361102046003066253145020066347265153020354020 params
Group type-specific parameters.
enum AVStreamGroupParamsType type
Group type.
unsigned int nb_streams
Number of elements in AVStreamGroup.streams.
struct AVStreamGroupTREF * tref
AVStream ** streams
A list of streams in the group.
struct AVStreamGroupLayeredVideo * layered_video
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 id
Format-specific stream ID.
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.
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
unsigned fps
frame per second; must be consistent with the rate field
uint32_t flags
flags such as drop frame, +24 hours support, ...
AVRational rate
frame rate in rational form
int start
timecode frame start (first base frame number)
AVPacket * pkt
Used to hold temporary packets for the generic demuxing code.
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
char * encryption_scheme_str
int avif_extent_length[2]
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
int64_t avif_extent_pos[2]
int * src_track
the tracks that this hint (or tmcd) track describes
struct MOVTrack::@041066134315003153207320140045232207171303033040 vc1_info
PacketList squashed_packet_queue
unsigned frag_info_capacity
uint32_t palette[AVPALETTE_COUNT]
struct IAMFContext * iamf
MOVIentry * cluster_written
unsigned int squash_fragment_samples_to_one
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 APVDecoderConfigurationRecord * apv
AVFormatContext * rtp_ctx
the format context for the hinting rtp muxer
unsigned cluster_capacity
int height
active picture (w/o VBI) height for D-10/IMX
uint32_t * id
trackID of the referenced track
uint8_t complexity_index_type_a
struct eac3_info::@032224065145233261074362213314253377146303165010 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]
int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
Parse timecode representation (hh:mm:ss[:;.
@ AV_TIMECODE_FLAG_DROPFRAME
timecode is drop frame
UUID parsing and serialization utilities.
uint8_t AVUUID[AV_UUID_LEN]
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 float mean(const float *input, int size)
static const Range full_range
static void copy(const float *p1, float *p2, const int length)
int ff_isom_write_vpcc(void *logctx, AVIOContext *pb, const uint8_t *data, int len, const AVCodecParameters *par)
Writes VP codec configuration to the provided AVIOContext.
internal header for VPx codec configuration utilities.
int ff_vvc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out, int *size, int filter_ps, int *ps_count)
Writes Annex B formatted H.266/VVC NAL units to a data buffer.
int ff_isom_write_vvcc(AVIOContext *pb, const uint8_t *data, int size, int ps_array_completeness)
Writes H.266/VVC extradata (parameter sets, declarative SEI NAL units) to the provided AVIOContext.
int ff_vvc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in, int size, int filter_ps, int *ps_count)
Writes Annex B formatted H.266/VVC NAL units to the provided AVIOContext.