54 {
"movflags",
"MOV muxer flags", offsetof(
MOVMuxContext,
flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
56 {
"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 },
68 {
"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" },
69 {
"write_colr",
"Write colr atom (Experimental, may be renamed or changed, do not use from scripts)", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_MOV_FLAG_WRITE_COLR}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM,
"movflags" },
87 #define MOV_CLASS(flavor)\
88 static const AVClass flavor ## _muxer_class = {\
89 .class_name = #flavor " muxer",\
90 .item_name = av_default_item_name,\
92 .version = LIBAVUTIL_VERSION_INT,\
139 for (i = 0; i < track->
entry; i++) {
154 int i, j, entries = 0, tst = -1, oldtst = -1;
161 for (i = 0; i < track->
entry; i++) {
163 if (oldtst != -1 && tst != oldtst)
168 if (equalChunks && track->
entry) {
170 sSize =
FFMAX(1, sSize);
176 for (i = 0; i < track->
entry; i++) {
189 int index = 0, oldval = -1, i;
190 int64_t entryPos, curpos;
198 for (i = 0; i < track->
entry; i++) {
218 int64_t curpos, entryPos;
226 for (i = 0; i < track->
entry; i++) {
258 int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
275 if ((acmod & 1) && acmod != 1)
329 #if CONFIG_AC3_PARSER
389 while (cumul_size != pkt->
size) {
536 avio_w8(pb, (size >> (7 * i)) | 0x80);
546 for (i = 0; i < track->
entry; i++)
554 int decoder_specific_info_len = track->
vos_len ? 5 + track->
vos_len : 0;
555 unsigned avg_bitrate;
562 put_descr(pb, 0x03, 3 + 5+13 + decoder_specific_info_len + 5+1);
567 put_descr(pb, 0x04, 13 + decoder_specific_info_len);
646 uint32_t layout_tag, bitmap;
654 "lack of channel information\n");
719 int unescaped_size, seq_found = 0;
720 int level = 0, interlace = 0;
729 packet_seq = packet_entry = 1;
731 "moov atom written before any packets, unable to write correct "
732 "dvc1 atom. Set the delay_moov flag to fix this.\n");
739 for (next = start; next <
end; start = next) {
743 size = next - start - 4;
855 if (cluster_idx >= track->
entry)
858 if (cluster_idx + 1 == track->
entry)
861 next_dts = track->
cluster[cluster_idx + 1].
dts;
873 int i, first_duration;
885 for (i = 1; i < track->
entry; i++) {
889 return first_duration;
896 uint32_t
tag = track->
tag;
983 else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'a'))
1050 interlaced = (track->
vos_data[5] & 2);
1102 for (i = 0; i < 10; i++)
1159 (tag ==
MKTAG(
't',
'x',
'3',
'g') ||
1160 tag ==
MKTAG(
't',
'e',
'x',
't'))))
1167 "Quicktime/Ipod might not play the file\n");
1179 else tag =
MKTAG(
'd',
'v',
'c',
' ');
1182 else tag =
MKTAG(
'd',
'v',
'p',
'p');
1185 else tag =
MKTAG(
'd',
'v',
'h',
'p');
1186 }
else if (track->
enc->
height == 1080) {
1188 else tag =
MKTAG(
'd',
'v',
'h',
'6');
1218 tag =
MKTAG(
'm',
'2',
'v',
'1');
1223 if (rate == 24) tag =
MKTAG(
'x',
'd',
'v',
'4');
1224 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'5');
1225 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'1');
1226 else if (rate == 50) tag =
MKTAG(
'x',
'd',
'v',
'a');
1227 else if (rate == 60) tag =
MKTAG(
'x',
'd',
'v',
'9');
1231 if (rate == 24) tag =
MKTAG(
'x',
'd',
'v',
'6');
1232 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'7');
1233 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'8');
1235 if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'3');
1236 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'2');
1240 if (rate == 24) tag =
MKTAG(
'x',
'd',
'v',
'd');
1241 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'e');
1242 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'f');
1244 if (rate == 25) tag =
MKTAG(
'x',
'd',
'v',
'c');
1245 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'v',
'b');
1251 if (rate == 24) tag =
MKTAG(
'x',
'd',
'5',
'4');
1252 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'5',
'5');
1253 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'5',
'1');
1254 else if (rate == 50) tag =
MKTAG(
'x',
'd',
'5',
'a');
1255 else if (rate == 60) tag =
MKTAG(
'x',
'd',
'5',
'9');
1259 if (rate == 24) tag =
MKTAG(
'x',
'd',
'5',
'd');
1260 else if (rate == 25) tag =
MKTAG(
'x',
'd',
'5',
'e');
1261 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'5',
'f');
1263 if (rate == 25) tag =
MKTAG(
'x',
'd',
'5',
'c');
1264 else if (rate == 30) tag =
MKTAG(
'x',
'd',
'5',
'b');
1280 tag =
MKTAG(
'a',
'v',
'c',
'i');
1285 if (rate == 24) tag =
MKTAG(
'a',
'i',
'5',
'p');
1286 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'5',
'q');
1287 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'5',
'p');
1288 else if (rate == 50) tag =
MKTAG(
'a',
'i',
'5',
'q');
1289 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'5',
'p');
1293 if (rate == 24) tag =
MKTAG(
'a',
'i',
'5',
'3');
1294 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'5',
'2');
1295 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'5',
'3');
1297 if (rate == 50) tag =
MKTAG(
'a',
'i',
'5',
'5');
1298 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'5',
'6');
1304 if (rate == 24) tag =
MKTAG(
'a',
'i',
'1',
'p');
1305 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'1',
'q');
1306 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'1',
'p');
1307 else if (rate == 50) tag =
MKTAG(
'a',
'i',
'1',
'q');
1308 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'1',
'p');
1312 if (rate == 24) tag =
MKTAG(
'a',
'i',
'1',
'3');
1313 else if (rate == 25) tag =
MKTAG(
'a',
'i',
'1',
'2');
1314 else if (rate == 30) tag =
MKTAG(
'a',
'i',
'1',
'3');
1316 if (rate == 25) tag =
MKTAG(
'a',
'i',
'1',
'5');
1317 else if (rate == 50) tag =
MKTAG(
'a',
'i',
'1',
'5');
1318 else if (rate == 60) tag =
MKTAG(
'a',
'i',
'1',
'6');
1323 tag =
MKTAG(
'a',
'i',
'v',
'x');
1330 static const struct {
1369 if (tag ==
MKTAG(
'r',
'a',
'w',
' ') &&
1372 av_log(s,
AV_LOG_ERROR,
"%s rawvideo cannot be written to mov, output file will be unreadable\n",
1402 "the file may be unplayable!\n");
1409 tag =
MKTAG(
'm',
's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
1411 "the file may be unplayable!\n");
1450 tag =
MKTAG(
'w',
'm',
'a',
' ');
1480 0x0000, 0x0100, 0x0201, 0x0206, 0x0209, 0x020e
1485 unsigned mov_field_order = 0;
1536 gama = (uint32_t)
lrint((
double)(1<<16) * gamma);
1566 }
else if (track->
enc->
width == 720 &&
1641 }
else if(track->
enc->
width == 1440) {
1648 av_strlcatf(compressor_name, len,
"%d", rate * (interlaced + 1));
1655 char compressor_name[32] = { 0 };
1689 avio_w8(pb, strlen(compressor_name));
1697 if (track->
tag ==
MKTAG(
'm',
'p',
'4',
'v'))
1723 }
else if (track->
vos_len > 0)
1780 uint64_t str_size =strlen(reel_name);
1783 if (str_size >= UINT16_MAX){
1805 if (nb_frames > 255) {
1863 uint32_t entries = 0;
1870 ctts_entries[0].
count = 1;
1872 for (i = 1; i < track->
entry; i++) {
1874 ctts_entries[entries].
count++;
1878 ctts_entries[entries].
count = 1;
1882 atom_size = 16 + (entries * 8);
1887 for (i = 0; i < entries; i++) {
1899 uint32_t entries = -1;
1904 stts_entries =
av_malloc(
sizeof(*stts_entries));
1911 stts_entries = track->
entry ?
1914 if (track->
entry && !stts_entries)
1916 for (i = 0; i < track->
entry; i++) {
1918 if (i && duration == stts_entries[entries].duration) {
1919 stts_entries[entries].
count++;
1923 stts_entries[entries].
count = 1;
1928 atom_size = 16 + (entries * 8);
1933 for (i = 0; i < entries; i++) {
2003 const char *font =
"Lucida Grande";
2043 if (track->
tag !=
MKTAG(
'c',
'6',
'0',
'8')) {
2089 return track->
tag ==
MKTAG(
'c',
'7',
'0',
'8') ||
2090 track->
tag ==
MKTAG(
'c',
'6',
'0',
'8');
2095 const char *hdlr, *descr =
NULL, *hdlr_type =
NULL;
2100 descr =
"DataHandler";
2103 hdlr = (track->
mode ==
MODE_MOV) ?
"mhlr" :
"\0\0\0\0";
2106 descr =
"VideoHandler";
2109 descr =
"SoundHandler";
2113 descr =
"ClosedCaptionHandler";
2115 if (track->
tag ==
MKTAG(
't',
'x',
'3',
'g')) {
2117 }
else if (track->
tag ==
MKTAG(
'm',
'p',
'4',
's')) {
2122 descr =
"SubtitleHandler";
2126 descr =
"HintHandler";
2129 descr =
"TimeCodeHandler";
2136 "Unknown hldr_type for %s / 0x%04X, writing dummy values\n",
2198 }
else if (track->
tag ==
MKTAG(
'r',
't',
'p',
' ')) {
2200 }
else if (track->
tag ==
MKTAG(
't',
'm',
'c',
'd')) {
2232 (version == 1) ?
avio_wb64(pb, UINT64_C(0xffffffffffffffff)) :
avio_wb32(pb, 0xffffffff);
2233 else if (!track->
entry)
2242 "FATAL error, file duration too long for timebase, this file will not be\n"
2243 "playable with quicktime. Choose a different timebase or a different\n"
2244 "container format\n");
2270 int16_t d, int16_t tx, int16_t ty)
2288 int version = duration < INT32_MAX ? 0 : 1;
2321 (version == 1) ?
avio_wb64(pb, UINT64_C(0xffffffffffffffff)) :
avio_wb32(pb, 0xffffffff);
2322 else if (!track->
entry)
2341 rotation = (rot && rot->
value) ? atoi(rot->
value) : 0;
2343 if (rotation == 90) {
2345 }
else if (rotation == 180) {
2347 }
else if (rotation == 270) {
2361 sample_aspect_ratio = 1;
2409 int version = duration < INT32_MAX ? 0 : 1;
2410 int entry_size, entry_count,
size;
2411 int64_t delay, start_ct = track->
start_cts;
2418 "EDTS using dts:%"PRId64
" cts:%d instead of dts:%"PRId64
" cts:%"PRId64
" tid:%d\n",
2420 start_dts, start_ct, track->
track_id);
2428 version |= delay < INT32_MAX ? 0 : 1;
2430 entry_size = (version == 1) ? 20 : 12;
2431 entry_count = 1 + (delay > 0);
2432 size = 24 + entry_count * entry_size;
2463 start_ct = -
FFMIN(start_dts, 0);
2521 char buf[1000] =
"";
2540 const char *
tag,
const char *str)
2584 int entry_backup = track->
entry;
2604 "Not writing any edit list even though one would have been required\n");
2614 if (track->
tag ==
MKTAG(
'r',
't',
'p',
' '))
2628 track->
entry = entry_backup;
2635 int i, has_audio = 0, has_video = 0;
2645 if (audio_profile < 0)
2646 audio_profile = 0xFF - has_audio;
2647 if (video_profile < 0)
2648 video_profile = 0xFF - has_video;
2688 int max_track_id = 1, i;
2689 int64_t max_track_len = 0;
2698 if (max_track_len < max_track_len_temp)
2699 max_track_len = max_track_len_temp;
2700 if (max_track_id < mov->tracks[i].track_id)
2711 version = max_track_len < UINT32_MAX ? 0 : 1;
2712 avio_wb32(pb, version == 1 ? 120 : 108);
2765 int size = 16 + strlen(data);
2778 return strlen(data) + 4;
2783 const char *
value,
int lang,
int long_style)
2786 if (value && value[0]) {
2797 const char *
name,
const char *
tag,
2800 int l, lang = 0,
len, len2;
2808 snprintf(tag2,
sizeof(tag2),
"%s-", tag);
2810 len2 = strlen(t2->
key);
2824 int size = 0, tmpo = t ? atoi(t->
value) : 0;
2843 disc ?
"disc" :
"track",
2845 int size = 0, track = t ? atoi(t->
value) : 0;
2848 char *slash = strchr(t->
value,
'/');
2850 tracks = atoi(slash + 1);
2867 const char *
name,
const char *
tag,
2874 if (len != 1 && len != 4)
2879 num = atoi(t->
value);
2947 const char *
name,
const char *key)
2955 len = strlen(t->
value);
2979 return (((str[0] - 0x60) & 0x1F) << 10) +
2980 (((str[1] - 0x60) & 0x1F) << 5) +
2981 (( str[2] - 0x60) & 0x1F);
2985 const char *
tag,
const char *str)
2994 if (!strcmp(tag,
"yrrc"))
2999 if (!strcmp(tag,
"albm") &&
3017 for (i = 0; i < nb_chapters; i++) {
3023 int len =
FFMIN(strlen(t->value), 255);
3085 const char *str,
const char *lang,
int type)
3140 uint64_t chunkSize = chunk->
size;
3145 for (i = 1; i<trk->
entry; i++){
3153 chunkSize = chunk->
size;
3225 avio_printf(pb,
"<param name=\"%s\" value=\"%d\" valuetype=\"data\"/>\n", name, value);
3230 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, value);
3236 len =
FFMIN(
sizeof(buf) / 2 - 1, len);
3238 buf[2 *
len] =
'\0';
3239 avio_printf(pb,
"<param name=\"%s\" value=\"%s\" valuetype=\"data\"/>\n", name, buf);
3246 static const uint8_t uuid[] = {
3247 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
3248 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
3256 avio_printf(pb,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
3257 avio_printf(pb,
"<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">\n");
3260 avio_printf(pb,
"<meta name=\"creator\" content=\"%s\" />\n",
3270 int track_id = i + 1;
3279 avio_printf(pb,
"<%s systemBitrate=\"%d\">\n", type,
3339 MOVTrack *track, int64_t moof_offset)
3344 if (!track->
entry) {
3406 for (i = 0; i < track->
entry; i++) {
3435 for (i = 0; i < track->
entry; i++) {
3440 if (flags & MOV_TRUN_SAMPLE_FLAGS)
3453 static const uint8_t uuid[] = {
3454 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
3455 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
3474 int size = 8 + 16 + 4 + 1 + 16*
n;
3475 static const uint8_t uuid[] = {
3476 0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
3477 0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
3490 for (i = 0; i <
n; i++) {
3491 int index = entry + 1 + i;
3495 if (n < mov->ism_lookahead) {
3526 if ((tracks >= 0 && i != tracks) || !track->
entry)
3570 MOVTrack *track, int64_t moof_offset,
3594 for (i = 0; i <
size; i++)
3603 int tracks,
int moof_size)
3615 if (tracks >= 0 && i != tracks)
3626 MOVTrack *track,
int ref_size,
int total_sidx_size)
3628 int64_t pos =
avio_tell(pb), offset_pos, end_pos;
3630 int starts_with_SAP, i, entries;
3645 if (presentation_time < 0)
3646 presentation_time = 0;
3660 for (i = 0; i < entries; i++) {
3661 if (!track->
entry) {
3667 starts_with_SAP = 1;
3669 avio_wb32(pb, (0 << 31) | (ref_size & 0x7fffffff));
3671 avio_wb32(pb, (starts_with_SAP << 31) | (0 << 28) | 0);
3675 offset = pos + total_sidx_size - end_pos;
3683 int tracks,
int ref_size)
3688 for (round = 0; round < 2; round++) {
3701 if (tracks >= 0 && i != tracks)
3706 if (!track->
entry && ref_size > 0)
3803 int has_h264 = 0, has_video = 0;
3822 minor = has_h264 ? 0x100 : 0x200;
3825 minor = has_h264 ? 0x20000 : 0x10000;
3882 int audio_kbitrate = audio_codec->
bit_rate / 1000;
3883 int video_kbitrate =
FFMIN(video_codec->
bit_rate / 1000, 800 - audio_kbitrate);
3944 int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;
3955 if (video_streams_nb != 1 || audio_streams_nb != 1 || other_streams_nb) {
3967 int i, closed_gop = 0;
3969 for (i = 0; i < pkt->
size - 4; i++) {
3970 c = (c << 8) + pkt->
data[i];
3972 closed_gop = pkt->
data[i + 4] >> 6 & 0x01;
3973 }
else if (c == 0x100) {
3974 int temp_ref = (pkt->
data[i + 1] << 2) | (pkt->
data[i + 2] >> 6);
3975 if (!temp_ref || closed_gop)
3988 int seq = 0, entry = 0;
3991 for (next = start; next <
end; start = next) {
4005 if (!trk->
entry && !fragment) {
4012 for (i = 0; i < trk->
entry; i++)
4045 int i, first_track = -1;
4046 int64_t mdat_size = 0;
4055 int buf_size, moov_size;
4110 if (first_track < 0)
4119 int buf_size, write_moof = 1, moof_tracks = -1;
4132 write_moof = i == first_track;
4182 unsigned int samples_in_chunk = 0;
4188 if (duration < 0 || duration > INT_MAX) {
4189 av_log(s,
AV_LOG_ERROR,
"Application provided duration: %"PRId64
" / timestamp: %"PRId64
" is out of range for mov/mp4 format\n",
4220 static uint16_t packed_size[16] =
4221 {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 1};
4224 while (len < size && samples_in_chunk < 100) {
4225 len += packed_size[(pkt->
data[
len] >> 3) & 0x0F];
4228 if (samples_in_chunk > 1) {
4229 av_log(s,
AV_LOG_ERROR,
"fatal error, input is not a single packet, implement a AVParser for it\n");
4238 samples_in_chunk = 1;
4257 "use the audio bitstream filter 'aac_adtstoasc' to fix it "
4258 "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
4282 #if CONFIG_AC3_PARSER
4284 size = handle_eac3(mov, pkt, trk);
4363 "Track %d starts with a nonzero dts %"PRId64
", while the moov "
4364 "already has been written. Set the delay_moov flag to handle "
4375 if (pkt->
dts != pkt->
pts)
4402 reformatted_data, size);
4416 int64_t frag_duration = 0;
4476 if (!pkt->
size)
return 0;
4505 if (ret < 0)
return ret;
4526 track->
tag =
MKTAG(
't',
'e',
'x',
't');
4534 uint8_t chapter_properties[43] = { 0, 0, 0, 0, 0, 0, 0, 1, };
4537 memcpy(track->
enc->
extradata, chapter_properties,
sizeof(chapter_properties));
4593 const char encd[12] = {
4594 0x00, 0x00, 0x00, 0x0C,
4596 0x00, 0x00, 0x01, 0x00 };
4597 len = strlen(t->value);
4603 memcpy(pkt.
data + 2, t->value,
len);
4604 memcpy(pkt.
data +
len + 2, encd,
sizeof(encd));
4630 track->
tag =
MKTAG(
't',
'm',
'c',
'd');
4702 if (!enabled[i] && first[i] >= 0)
4740 r = (rgb >> 16) & 0xFF;
4741 g = (rgb >> 8) & 0xFF;
4744 y = av_clip_uint8( 16. + 0.257 * r + 0.504 * g + 0.098 * b);
4745 cb = av_clip_uint8(128. - 0.148 * r - 0.291 * g + 0.439 * b);
4746 cr = av_clip_uint8(128. + 0.439 * r - 0.368 * g - 0.071 * b);
4748 return (y << 16) | (cr << 8) | cb;
4755 int have_palette = 0, have_size = 0;
4759 while (cur && *cur) {
4760 if (strncmp(
"palette:", cur, 8) == 0) {
4762 count = sscanf(cur + 8,
4763 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
4764 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
4765 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
", "
4766 "%06"PRIx32
", %06"PRIx32
", %06"PRIx32
", %06"PRIx32
"",
4767 &palette[ 0], &palette[ 1], &palette[ 2], &palette[ 3],
4768 &palette[ 4], &palette[ 5], &palette[ 6], &palette[ 7],
4769 &palette[ 8], &palette[ 9], &palette[10], &palette[11],
4770 &palette[12], &palette[13], &palette[14], &palette[15]);
4772 for (i = 0; i <
count; i++) {
4776 }
else if (!strncmp(
"size:", cur, 5)) {
4777 sscanf(cur + 5,
"%dx%d", &width, &
height);
4780 if (have_palette && have_size)
4782 cur += strcspn(cur,
"\n\r");
4783 cur += strspn(cur,
"\n\r");
4789 for (i = 0; i < 16; i++) {
4805 int i,
ret, hint_track = 0, tmcd_track = 0;
4862 av_log(s,
AV_LOG_WARNING,
"No meaningful edit list will be written when using empty_moov without delay_moov\n");
4913 "so timecode metadata are now ignored\n");
4942 "codec not currently supported in container\n",
4953 if (track->
tag ==
MKTAG(
'm',
'x',
'3',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'3',
'n') ||
4954 track->
tag ==
MKTAG(
'm',
'x',
'4',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'4',
'n') ||
4955 track->
tag ==
MKTAG(
'm',
'x',
'5',
'p') || track->
tag ==
MKTAG(
'm',
'x',
'5',
'n')) {
4961 track->
height = track->
tag >> 24 ==
'n' ? 486 : 576;
4977 "WARNING codec timebase is very high. If duration is too long,\n"
4978 "file may not be playable by quicktime. Specify a shorter timebase\n"
4979 "or choose different container.\n");
5060 trackj->
tag != track->
tag
5091 mov->
time += 0x7C25B080;
5181 int i, moov_size, moov_size2;
5197 if (moov_size2 != moov_size)
5221 int ret = 0, moov_size;
5225 int read_buf_id = 0;
5240 read_buf[1] = buf + moov_size;
5249 "the second pass (faststart)\n", s->
filename);
5262 #define READ_BLOCK do { \
5263 read_size[read_buf_id] = avio_read(read_pb, read_buf[read_buf_id], moov_size); \
5272 n = read_size[read_buf_id];
5277 }
while (pos < pos_end);
5336 av_log(s,
AV_LOG_INFO,
"Starting second pass: moving the moov atom to the beginning of the file\n");
5349 av_log(s,
AV_LOG_ERROR,
"reserved_moov_size is too small, needed %"PRId64
" additional\n", 8-size);
5387 #if CONFIG_MOV_MUXER
5392 .extensions =
"mov",
5395 .video_codec = CONFIG_LIBX264_ENCODER ?
5404 .priv_class = &mov_muxer_class,
5407 #if CONFIG_TGP_MUXER
5412 .extensions =
"3gp",
5421 .priv_class = &tgp_muxer_class,
5424 #if CONFIG_MP4_MUXER
5429 .mime_type =
"application/mp4",
5430 .extensions =
"mp4",
5433 .video_codec = CONFIG_LIBX264_ENCODER ?
5440 .priv_class = &mp4_muxer_class,
5443 #if CONFIG_PSP_MUXER
5448 .extensions =
"mp4,psp",
5451 .video_codec = CONFIG_LIBX264_ENCODER ?
5458 .priv_class = &psp_muxer_class,
5461 #if CONFIG_TG2_MUXER
5466 .extensions =
"3g2",
5475 .priv_class = &tg2_muxer_class,
5478 #if CONFIG_IPOD_MUXER
5483 .mime_type =
"application/mp4",
5484 .extensions =
"m4v,m4a",
5493 .priv_class = &ipod_muxer_class,
5496 #if CONFIG_ISMV_MUXER
5501 .mime_type =
"application/mp4",
5502 .extensions =
"ismv,isma",
5511 .priv_class = &ismv_muxer_class,
5514 #if CONFIG_F4V_MUXER
5519 .mime_type =
"application/f4v",
5520 .extensions =
"f4v",
5529 .priv_class = &f4v_muxer_class,