30 #include "libavutil/attributes.h"
31 #include "libavutil/channel_layout.h"
32 #include "libavutil/intreadwrite.h"
33 #include "libavutil/intfloat.h"
34 #include "libavutil/mathematics.h"
35 #include "libavutil/avstring.h"
36 #include "libavutil/dict.h"
37 #include "libavutil/opt.h"
38 #include "libavutil/timecode.h"
69 unsigned len,
const char *key)
73 short current, total = 0;
79 snprintf(buf,
sizeof(buf),
"%d", current);
81 snprintf(buf,
sizeof(buf),
"%d/%d", current, total);
88 unsigned len,
const char *key)
104 unsigned len,
const char *key)
115 unsigned len,
const char *key)
133 char key[1024]={0},
data[1024]={0};
143 if (atom.
size <= 8)
return 0;
145 for (i = 0; i < 3; i++) {
148 int str_size = 0, skip_size = 0;
152 case MKTAG(
'n',
'a',
'm',
'e'):
154 str_size = skip_size = data_size - 12;
158 case MKTAG(
'd',
'a',
't',
'a'):
161 str_size = skip_size = data_size - 16;
166 skip_size = data_size - 8;
174 target[str_size] = 0;
176 atom.
size -= skip_size;
179 if (skip_size > str_size)
avio_skip(pb, skip_size - str_size);
183 if (strcmp(key,
"iTunSMPB") == 0) {
184 int priming, remainder, samples;
185 if(sscanf(
data,
"%*X %X %X %X", &priming, &remainder, &samples) == 3){
186 if(priming>0 && priming<16384)
191 if (strcmp(key,
"cdec") == 0) {
200 0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
201 0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
202 0x00EA,0x00EB,0x00ED,0x00EC,0x00EE,0x00EF,0x00F1,0x00F3,
203 0x00F2,0x00F4,0x00F6,0x00F5,0x00FA,0x00F9,0x00FB,0x00FC,
204 0x2020,0x00B0,0x00A2,0x00A3,0x00A7,0x2022,0x00B6,0x00DF,
205 0x00AE,0x00A9,0x2122,0x00B4,0x00A8,0x2260,0x00C6,0x00D8,
206 0x221E,0x00B1,0x2264,0x2265,0x00A5,0x00B5,0x2202,0x2211,
207 0x220F,0x03C0,0x222B,0x00AA,0x00BA,0x03A9,0x00E6,0x00F8,
208 0x00BF,0x00A1,0x00AC,0x221A,0x0192,0x2248,0x2206,0x00AB,
209 0x00BB,0x2026,0x00A0,0x00C0,0x00C3,0x00D5,0x0152,0x0153,
210 0x2013,0x2014,0x201C,0x201D,0x2018,0x2019,0x00F7,0x25CA,
211 0x00FF,0x0178,0x2044,0x20AC,0x2039,0x203A,0xFB01,0xFB02,
212 0x2021,0x00B7,0x201A,0x201E,0x2030,0x00C2,0x00CA,0x00C1,
213 0x00CB,0x00C8,0x00CD,0x00CE,0x00CF,0x00CC,0x00D3,0x00D4,
214 0xF8FF,0x00D2,0x00DA,0x00DB,0x00D9,0x0131,0x02C6,0x02DC,
215 0x00AF,0x02D8,0x02D9,0x02DA,0x00B8,0x02DD,0x02DB,0x02C7,
219 char *dst,
int dstlen)
222 char *
end = dst+dstlen-1;
225 for (i = 0; i <
len; i++) {
227 if (c < 0x80 && p < end)
279 unsigned len,
const char *key)
291 #ifdef MOV_EXPORT_ALL_METADATA
294 char str[1024], key2[16], language[4] = {0};
295 const char *key = NULL;
296 uint16_t langcode = 0;
297 uint32_t data_type = 0, str_size;
304 case MKTAG(0xa9,
'n',
'a',
'm'): key =
"title";
break;
305 case MKTAG(0xa9,
'a',
'u',
't'):
306 case MKTAG(0xa9,
'A',
'R',
'T'): key =
"artist";
break;
307 case MKTAG(
'a',
'A',
'R',
'T'): key =
"album_artist";
break;
308 case MKTAG(0xa9,
'w',
'r',
't'): key =
"composer";
break;
309 case MKTAG(
'c',
'p',
'r',
't'):
310 case MKTAG(0xa9,
'c',
'p',
'y'): key =
"copyright";
break;
311 case MKTAG(0xa9,
'g',
'r',
'p'): key =
"grouping";
break;
312 case MKTAG(0xa9,
'l',
'y',
'r'): key =
"lyrics";
break;
313 case MKTAG(0xa9,
'c',
'm',
't'):
314 case MKTAG(0xa9,
'i',
'n',
'f'): key =
"comment";
break;
315 case MKTAG(0xa9,
'a',
'l',
'b'): key =
"album";
break;
316 case MKTAG(0xa9,
'd',
'a',
'y'): key =
"date";
break;
317 case MKTAG(0xa9,
'g',
'e',
'n'): key =
"genre";
break;
318 case MKTAG(
'g',
'n',
'r',
'e'): key =
"genre";
320 case MKTAG(0xa9,
't',
'o',
'o'):
321 case MKTAG(0xa9,
's',
'w',
'r'): key =
"encoder";
break;
322 case MKTAG(0xa9,
'e',
'n',
'c'): key =
"encoder";
break;
323 case MKTAG(0xa9,
'm',
'a',
'k'): key =
"make";
break;
324 case MKTAG(0xa9,
'm',
'o',
'd'): key =
"model";
break;
325 case MKTAG(0xa9,
'x',
'y',
'z'): key =
"location";
break;
326 case MKTAG(
'd',
'e',
's',
'c'): key =
"description";
break;
327 case MKTAG(
'l',
'd',
'e',
's'): key =
"synopsis";
break;
328 case MKTAG(
't',
'v',
's',
'h'): key =
"show";
break;
329 case MKTAG(
't',
'v',
'e',
'n'): key =
"episode_id";
break;
330 case MKTAG(
't',
'v',
'n',
'n'): key =
"network";
break;
331 case MKTAG(
't',
'r',
'k',
'n'): key =
"track";
333 case MKTAG(
'd',
'i',
's',
'k'): key =
"disc";
335 case MKTAG(
't',
'v',
'e',
's'): key =
"episode_sort";
337 case MKTAG(
't',
'v',
's',
'n'): key =
"season_number";
339 case MKTAG(
's',
't',
'i',
'k'): key =
"media_type";
341 case MKTAG(
'h',
'd',
'v',
'd'): key =
"hd_video";
343 case MKTAG(
'p',
'g',
'a',
'p'): key =
"gapless_playback";
345 case MKTAG(
'@',
'P',
'R',
'M'):
347 case MKTAG(
'@',
'P',
'R',
'Q'):
354 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
357 str_size = data_size - 16;
360 if (atom.
type ==
MKTAG(
'c',
'o',
'v',
'r')) {
374 str_size = atom.
size;
376 #ifdef MOV_EXPORT_ALL_METADATA
388 str_size =
FFMIN3(
sizeof(str)-1, str_size, atom.
size);
391 parse(c, pb, str_size, key);
393 if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) {
400 if (*language && strcmp(language,
"und")) {
401 snprintf(key2,
sizeof(key2),
"%s-%s", key, language);
405 av_dlog(c->
fc,
"lang \"%3s\" ", language);
406 av_dlog(c->
fc,
"tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64
"\n",
407 key, str, (
char*)&atom.
type, str_size, atom.
size);
415 int i, nb_chapters, str_len,
version;
418 if ((atom.
size -= 5) < 0)
427 for (i = 0; i < nb_chapters; i++) {
434 if ((atom.
size -= 9+str_len) < 0)
444 #define MIN_DATA_ENTRY_BOX_SIZE 12
459 entries >= UINT_MAX /
sizeof(*sc->
drefs))
478 av_dlog(c->
fc,
"type %.4s size %d\n", (
char*)&dref->
type, size);
480 if (dref->
type ==
MKTAG(
'a',
'l',
'i',
's') && size > 150) {
482 uint16_t volume_len,
len;
488 volume_len =
FFMIN(volume_len, 27);
490 dref->
volume[volume_len] = 0;
496 len =
FFMIN(len, 63);
511 for (type = 0; type != -1 &&
avio_tell(pb) < next; ) {
525 if (len > volume_len && !strncmp(dref->
path, dref->
volume, volume_len)) {
527 memmove(dref->
path, dref->
path+volume_len, len);
530 for (j = 0; j <
len; j++)
531 if (dref->
path[j] ==
':')
534 }
else if (type == 0) {
541 for (j = 0; j <
len; j++)
542 if (dref->
dir[j] ==
':')
574 av_dlog(c->
fc,
"ctype= %.4s (0x%08x)\n", (
char*)&ctype, ctype);
575 av_dlog(c->
fc,
"stype= %.4s\n", (
char*)&type);
577 if (type ==
MKTAG(
'v',
'i',
'd',
'e'))
579 else if (type ==
MKTAG(
's',
'o',
'u',
'n'))
581 else if (type ==
MKTAG(
'm',
'1',
'a',
' '))
583 else if ((type ==
MKTAG(
's',
'u',
'b',
'p')) || (type ==
MKTAG(
'c',
'l',
'c',
'p')))
590 title_size = atom.
size - 24;
591 if (title_size > 0) {
596 title_str[title_size] = 0;
599 (!c->
isom && title_str[0] == title_size - 1), 0);
636 int ac3info, acmod, lfeon, bsmod;
643 bsmod = (ac3info >> 14) & 0x7;
644 acmod = (ac3info >> 11) & 0x7;
645 lfeon = (ac3info >> 10) & 0x1;
646 st->
codec->
channels = ((
int[]){2,1,2,3,3,4,4,5})[acmod] + lfeon;
660 int eac3info, acmod, lfeon, bsmod;
671 bsmod = (eac3info >> 12) & 0x1f;
672 acmod = (eac3info >> 9) & 0x7;
673 lfeon = (eac3info >> 8) & 0x1;
732 "sample aspect ratio already set to %d:%d, ignoring 'pasp' atom (%d:%d)\n",
735 }
else if (den != 0) {
756 char minor_ver_str[11];
757 char* comp_brands_str;
761 if (strcmp(type,
"qt "))
766 snprintf(minor_ver_str,
sizeof(minor_ver_str),
"%d", minor_ver);
769 comp_brand_size = atom.
size - 8;
770 if (comp_brand_size < 0)
772 comp_brands_str =
av_malloc(comp_brand_size + 1);
773 if (!comp_brands_str)
775 avio_read(pb, comp_brands_str, comp_brand_size);
776 comp_brands_str[comp_brand_size] = 0;
815 if(time >= 2082844800)
818 ptm = gmtime(&timet);
820 strftime(buffer,
sizeof(buffer),
"%Y-%m-%d %H:%M:%S", ptm);
830 char language[4] = {0};
832 int64_t creation_time;
872 int64_t creation_time;
921 av_dlog(c->
fc,
"enda %d\n", little_endian);
922 if (little_endian == 1) {
946 unsigned mov_field_order;
955 if ((mov_field_order & 0xFF00) == 0x0100)
957 else if ((mov_field_order & 0xFF00) == 0x0200) {
958 switch (mov_field_order & 0xFF) {
994 if (size > INT_MAX || (uint64_t)atom.
size > INT_MAX)
1052 codec->
width = 1440;
1072 if ((uint64_t)atom.
size > (1<<30))
1083 }
else if (atom.
size > 8) {
1104 if ((uint64_t)atom.
size > (1<<30))
1107 if (atom.
size >= 10) {
1113 if (type ==
MKTAG(
'f',
'i',
'e',
'l') && size == atom.
size)
1132 if (atom.
size >= (1<<28) || atom.
size < 7)
1136 if ((profile_level & 0xf0) != 0xc0)
1158 if (atom.
size <= 40)
1162 if ((uint64_t)atom.
size > (1<<30))
1177 unsigned int i, entries;
1191 if (entries >= UINT_MAX/
sizeof(int64_t))
1199 if (atom.
type ==
MKTAG(
's',
't',
'c',
'o'))
1202 else if (atom.
type ==
MKTAG(
'c',
'o',
'6',
'4'))
1235 ((format & 0xFFFF) ==
'm' + (
's' << 8) ||
1236 (format & 0xFFFF) ==
'T' + (
'S' << 8)))
1243 format && format !=
MKTAG(
'm',
'p',
'4',
's')) {
1266 unsigned int color_depth,
len, j;
1267 int color_greyscale;
1291 if (!memcmp(st->
codec->
codec_name,
"Planar Y'CbCr 8-bit 4:2:0", 25)) {
1303 av_dlog(c->
fc,
"depth %d, ctab id %d\n",
1310 if ((color_depth == 2) || (color_depth == 4) || (color_depth == 8)) {
1312 unsigned int color_start, color_count, color_end;
1313 unsigned char a,
r,
g,
b;
1315 if (color_greyscale) {
1316 int color_index, color_dec;
1319 color_count = 1 << color_depth;
1321 color_dec = 256 / (color_count - 1);
1322 for (j = 0; j < color_count; j++) {
1324 r = g = b = color_count - 1 - color_index;
1326 r = g = b = color_index;
1327 sc->
palette[j] = (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
1328 color_index -= color_dec;
1329 if (color_index < 0)
1332 }
else if (color_table_id) {
1335 color_count = 1 << color_depth;
1336 if (color_depth == 2)
1338 else if (color_depth == 4)
1343 for (j = 0; j < color_count; j++) {
1344 r = color_table[j * 3 + 0];
1345 g = color_table[j * 3 + 1];
1346 b = color_table[j * 3 + 2];
1347 sc->
palette[j] = (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
1354 if ((color_start <= 255) && (color_end <= 255)) {
1355 for (j = color_start; j <= color_end; j++) {
1366 sc->
palette[j] = (a << 24 ) | (r << 16) | (g << 8) | (b);
1377 int bits_per_sample,
flags;
1394 av_dlog(c->
fc,
"version =%d, isom =%d\n", version, c->
isom);
1396 (compatible_brands && strstr(compatible_brands->
value,
"qt "))) {
1403 }
else if (version == 2) {
1457 if (bits_per_sample) {
1511 #if CONFIG_DV_DEMUXER
1576 int codec_tag,
int format,
1582 (codec_tag != format &&
1584 : codec_tag !=
MKTAG(
'j',
'p',
'e',
'g')))) {
1593 if ( codec_tag ==
AV_RL32(
"avc1") ||
1594 codec_tag ==
AV_RL32(
"hvc1") ||
1606 int pseudo_stream_id;
1613 for (pseudo_stream_id = 0;
1615 pseudo_stream_id++) {
1618 int ret, dref_id = 1;
1628 }
else if (size <= 7){
1642 av_dlog(c->
fc,
"size=%"PRId64
" 4CC= %c%c%c%c codec_type=%d\n", size,
1643 (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
1667 }
else if (a.
size > 0)
1692 unsigned int i, entries;
1708 if (entries >= UINT_MAX /
sizeof(*sc->
stsc_data))
1714 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1732 unsigned i, entries;
1742 if (entries >= UINT_MAX /
sizeof(*sc->
stps_data))
1748 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1765 unsigned int i, entries;
1777 av_dlog(c->
fc,
"keyframe_count = %d\n", entries);
1786 if (entries >= UINT_MAX /
sizeof(
int))
1792 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1809 unsigned int i, entries, sample_size, field_size, num_bytes;
1821 if (atom.
type ==
MKTAG(
's',
't',
's',
'z')) {
1840 if (field_size != 4 && field_size != 8 && field_size != 16 && field_size != 32) {
1847 if (entries >= UINT_MAX /
sizeof(
int) || entries >= (UINT_MAX - 4) / field_size)
1853 num_bytes = (entries*field_size+4)>>3;
1861 if (
avio_read(pb, buf, num_bytes) < num_bytes) {
1869 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1887 unsigned int i, entries;
1889 int64_t total_sample_count=0;
1900 av_dlog(c->
fc,
"track[%i].stts.entries = %i\n",
1903 if (entries >= UINT_MAX /
sizeof(*sc->
stts_data))
1910 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1911 int sample_duration;
1918 if (sample_duration < 0) {
1920 sample_duration = 1;
1922 if (sample_count < 0) {
1929 av_dlog(c->
fc,
"sample_count=%d, sample_duration=%d\n",
1930 sample_count, sample_duration);
1932 duration+=(int64_t)sample_duration*sample_count;
1933 total_sample_count+=sample_count;
1959 unsigned int i, entries;
1974 if (entries >= UINT_MAX /
sizeof(*sc->
ctts_data))
1980 for (i = 0; i < entries && !pb->
eof_reached; i++) {
1987 av_dlog(c->
fc,
"count=%d, duration=%d\n",
1990 if (
FFABS(duration) > (1<<28) && i+2<entries) {
2015 unsigned int i, entries;
2017 uint32_t grouping_type;
2027 if (grouping_type !=
MKTAG(
'r',
'a',
'p',
' '))
2035 if (entries >= UINT_MAX /
sizeof(*sc->
rap_group))
2041 for (i = 0; i < entries && !pb->
eof_reached; i++) {
2054 int64_t current_offset;
2055 int64_t current_dts = 0;
2056 unsigned int stts_index = 0;
2057 unsigned int stsc_index = 0;
2058 unsigned int stss_index = 0;
2059 unsigned int stps_index = 0;
2061 uint64_t stream_size = 0;
2081 unsigned int current_sample = 0;
2082 unsigned int stts_sample = 0;
2083 unsigned int sample_size;
2085 unsigned int rap_group_index = 0;
2086 unsigned int rap_group_sample = 0;
2137 if (rap_group_present && rap_group_index < sc->rap_group_count) {
2140 if (++rap_group_sample == sc->
rap_group[rap_group_index].
count) {
2141 rap_group_sample = 0;
2151 e->
pos = current_offset;
2153 e->
size = sample_size;
2156 av_dlog(mov->
fc,
"AVIndex stream %d, sample %d, offset %"PRIx64
", dts %"PRId64
", "
2157 "size %d, distance %d, keyframe %d\n", st->
index, current_sample,
2158 current_offset, current_dts, sample_size, distance, keyframe);
2161 current_offset += sample_size;
2162 stream_size += sample_size;
2176 unsigned chunk_samples, total = 0;
2180 unsigned count, chunk_count;
2193 count = (chunk_samples+samples-1) / samples;
2195 count = (chunk_samples+1023) / 1024;
2198 if (i < sc->stsc_count - 1)
2202 total += chunk_count *
count;
2205 av_dlog(mov->
fc,
"chunk count %d\n", total);
2224 while (chunk_samples > 0) {
2226 unsigned size, samples;
2237 samples =
FFMIN(1024, chunk_samples);
2247 e->
pos = current_offset;
2252 av_dlog(mov->
fc,
"AVIndex stream %d, chunk %d, offset %"PRIx64
", dts %"PRId64
", "
2253 "size %d, duration %d\n", st->
index, i, current_offset, current_dts,
2256 current_offset +=
size;
2257 current_dts += samples;
2258 chunk_samples -= samples;
2270 char filename[1024];
2271 const char *src_path;
2275 src_path = strrchr(src,
'/');
2282 for (i = 0, l = strlen(ref->
path) - 1; l >= 0; l--)
2283 if (ref->
path[l] ==
'/') {
2291 if (i == ref->
nlvl_to - 1 && src_path - src <
sizeof(filename)) {
2292 memcpy(filename, src, src_path - src);
2293 filename[src_path -
src] = 0;
2303 }
else if (use_absolute_path) {
2305 "this is a possible security issue\n");
2330 if (!st)
return AVERROR(ENOMEM);
2333 if (!sc)
return AVERROR(ENOMEM);
2361 "stream %d, error opening alias: path='%s', dir='%s', "
2362 "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
2381 #if FF_API_R_FRAME_RATE
2395 #if CONFIG_H261_DECODER
2398 #if CONFIG_H263_DECODER
2401 #if CONFIG_MPEG4_DECODER
2432 while (atom.
size > 8) {
2435 if (tag ==
MKTAG(
'h',
'd',
'l',
'r')) {
2449 int64_t disp_transform[2];
2450 int display_matrix[3][2];
2488 for (i = 0; i < 3; i++) {
2496 sc->
width = width >> 16;
2497 sc->
height = height >> 16;
2502 if (display_matrix[1][0] == -65536 && display_matrix[0][1] == 65536) {
2506 if (display_matrix[0][0] == -65536 && display_matrix[1][1] == -65536) {
2510 if (display_matrix[1][0] == 65536 && display_matrix[0][1] == -65536) {
2518 if (width && height &&
2519 ((display_matrix[0][0] != 65536 ||
2520 display_matrix[1][1] != 65536) &&
2521 !display_matrix[0][1] &&
2522 !display_matrix[1][0] &&
2523 !display_matrix[2][0] && !display_matrix[2][1])) {
2524 for (i = 0; i < 2; i++)
2526 (int64_t) width * display_matrix[0][i] +
2527 (int64_t) height * display_matrix[1][i] +
2528 ((int64_t) display_matrix[2][i] << 16);
2532 ((
double) disp_transform[0] * height) /
2533 ((
double) disp_transform[1] * width), INT_MAX);
2542 int flags, track_id, i;
2615 int data_offset = 0;
2616 unsigned entries, first_sample_flags = frag->
flags;
2635 av_dlog(c->
fc,
"flags 0x%x entries %d\n", flags, entries);
2665 av_dlog(c->
fc,
"first sample flags 0x%x\n", first_sample_flags);
2666 for (i = 0; i < entries && !pb->
eof_reached; i++) {
2667 unsigned sample_size = frag->
size;
2668 int sample_flags = i ? frag->
flags : first_sample_flags;
2669 unsigned sample_duration = frag->
duration;
2682 else if (!found_keyframe)
2683 keyframe = found_keyframe =
2690 av_dlog(c->
fc,
"AVIndex stream %d, sample %d, offset %"PRIx64
", dts %"PRId64
", "
2692 offset, dts, sample_size, distance, keyframe);
2694 dts += sample_duration;
2695 offset += sample_size;
2722 if (atom.
type !=
MKTAG(
'm',
'd',
'a',
't')) {
2736 long cmov_len, moov_len;
2750 cmov_len = atom.
size - 6 * 4;
2761 if (uncompress (moov_data, (uLongf *) &moov_len, (
const Bytef *)cmov_data, cmov_len) != Z_OK)
2762 goto free_and_return;
2763 if (
ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
2764 goto free_and_return;
2766 atom.
size = moov_len;
2782 int i, edit_count,
version, edit_start_index = 0;
2793 if ((uint64_t)edit_count*12+8 > atom.
size)
2797 for (i=0; i<edit_count; i++){
2809 if (i == 0 && time == -1) {
2811 edit_start_index = 1;
2812 }
else if (i == edit_start_index && time >= 0)
2817 av_dlog(c->
fc,
"duration=%"PRId64
" time=%"PRId64
" rate=%f\n",
2818 duration, time, rate / 65536.0);
2823 "a/v desync might occur, patch welcome\n");
2843 static const uint8_t uuid_isml_manifest[] = {
2844 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
2845 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
2848 if (atom.
size <
sizeof(uuid) || atom.
size == INT64_MAX)
2851 ret =
avio_read(pb, uuid,
sizeof(uuid));
2854 }
else if (ret !=
sizeof(uuid)) {
2857 if (!memcmp(uuid, uuid_isml_manifest,
sizeof(uuid))) {
2860 size_t len = atom.
size -
sizeof(uuid);
2876 }
else if (ret != len) {
2882 while ((ptr =
av_stristr(ptr,
"systemBitrate=\"")) != NULL) {
2883 ptr +=
sizeof(
"systemBitrate=\"") - 1;
2892 ret = strtol(ptr, &endptr, 10);
2893 if (ret < 0 || errno || *endptr !=
'"') {
2976 int64_t total_size = 0;
2981 atom.
size = INT64_MAX;
2986 if (atom.
size >= 8) {
2989 if (atom.
type !=
MKTAG(
'r',
'o',
'o',
't') &&
3005 av_dlog(c->
fc,
"type: %08x '%.4s' parent:'%.4s' sz: %"PRId64
" %"PRId64
" %"PRId64
"\n",
3008 a.
size = atom.
size - total_size + 8;
3015 for (i = 0; mov_default_parse_table[i].
type; i++)
3016 if (mov_default_parse_table[i].
type == a.
type) {
3031 int err =
parse(c, pb, a);
3044 else if (left < 0) {
3046 "overread end of atom '%.4s' by %"PRId64
" bytes\n",
3047 (
char*)&a.
type, -left);
3052 total_size += a.
size;
3055 if (total_size < atom.
size && atom.
size < 0x7ffff)
3066 int moov_offset = -1;
3072 if ((offset + 8) > (
unsigned int)p->
buf_size)
3077 case MKTAG(
'm',
'o',
'o',
'v'):
3078 moov_offset = offset + 4;
3079 case MKTAG(
'j',
'P',
' ',
' '):
3080 case MKTAG(
'm',
'd',
'a',
't'):
3081 case MKTAG(
'p',
'n',
'o',
't'):
3082 case MKTAG(
'u',
'd',
't',
'a'):
3083 case MKTAG(
'f',
't',
'y',
'p'):
3086 offset + 12 > (
unsigned int)p->
buf_size ||
3095 case MKTAG(
'e',
'd',
'i',
'w'):
3096 case MKTAG(
'w',
'i',
'd',
'e'):
3097 case MKTAG(
'f',
'r',
'e',
'e'):
3098 case MKTAG(
'j',
'u',
'n',
'k'):
3099 case MKTAG(
'p',
'i',
'c',
't'):
3103 case MKTAG(0x82,0x82,0x7f,0x7d):
3104 case MKTAG(
's',
'k',
'i',
'p'):
3105 case MKTAG(
'u',
'u',
'i',
'd'):
3106 case MKTAG(
'p',
'r',
'f',
'l'):
3118 offset = moov_offset;
3120 while(offset < (p->
buf_size - 16)){
3125 av_log(NULL,
AV_LOG_WARNING,
"Found media data tag MPEG indicating this is a MOV-packed MPEG-PS.\n");
3177 if (len > sample->
size-2)
3179 title_len = 2*len + 1;
3192 else if (ch == 0xfffe)
3196 if (len == 1 || len == 2)
3340 atom.
size = INT64_MAX;
3369 int tmcd_st_id = -1;
3375 if (tmcd_st_id < 0 || tmcd_st_id == i)
3414 int64_t best_dts = INT64_MAX;
3425 ((msc->
pb != s->
pb && dts < best_dts) || (msc->
pb == s->
pb &&
3428 sample = current_sample;
3488 #if CONFIG_DV_DEMUXER
3523 av_dlog(s,
"stream %d, pts %"PRId64
", dts %"PRId64
", pos 0x%"PRIx64
", duration %d\n",
3535 av_dlog(s,
"stream %d, timestamp %"PRId64
", sample %d\n", st->
index, timestamp, sample);
3536 if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
3561 int64_t seek_timestamp, timestamp;
3568 st = s->
streams[stream_index];
3581 if (stream_index == i)
3591 {
"use_absolute_path",
3592 "allow using absolute path when opening alias, this is a possible security issue",
3608 .
name =
"mov,mp4,m4a,3gp,3g2,mj2",
3616 .priv_class = &mov_class,
static int mov_read_targa_y216(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int itunes_metadata
metadata are itunes style
int * bitrates
bitrates read before streams creation
static int mov_read_moof(MOVContext *c, AVIOContext *pb, MOVAtom atom)
const char const char void * val
static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#define PUT_UTF8(val, tmp, PUT_BYTE)
#define AVERROR_PATCHWELCOME
static int mov_read_dec3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
uint32_t tmcd_flags
tmcd track flags
unsigned int rap_group_count
void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id)
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
static int mov_read_wide(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
#define MOV_TFHD_DEFAULT_DURATION
static AVIndexEntry * mov_find_next_sample(AVFormatContext *s, AVStream **st)
static int mov_read_chpl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
unsigned int samples_per_frame
static void mov_build_index(MOVContext *mov, AVStream *st)
#define AV_LOG_WARNING
Something somehow does not look correct.
uint64_t base_data_offset
#define LIBAVUTIL_VERSION_INT
int64_t pos
byte position in stream, -1 if unknown
static int mov_metadata_gnre(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
AVCodecContext * codec
Codec context associated with this stream.
static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int index
stream index in AVFormatContext
#define MOV_TRUN_SAMPLE_CTS
static int tmcd_is_referenced(AVFormatContext *s, int tmcd_id)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx)
Init a timecode struct with the passed parameters.
static const uint8_t ff_qt_default_palette_256[256 *3]
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
#define CODEC_FLAG2_DROP_FRAME_TIMECODE
timecode is in drop frame format. DEPRECATED!!!!
int16_t audio_cid
stsd audio compression id
static int mov_open_dref(AVIOContext **pb, const char *src, MOVDref *ref, AVIOInterruptCB *int_cb, int use_absolute_path, AVFormatContext *fc)
static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int found_moov
'moov' atom has been found
static int mov_read_stps(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static void export_orphan_timecode(AVFormatContext *s)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define MOV_TKHD_FLAG_ENABLED
int isom
1 if file is ISO Media (mp4/3gp)
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
int found_mdat
'mdat' atom has been found
static int mov_probe(AVProbeData *p)
static int mov_read_header(AVFormatContext *s)
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int mov_read_moov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
const char * av_default_item_name(void *ctx)
Return the context name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
unsigned int sample_count
const AVCodecTag ff_codec_movvideo_tags[]
int dts_shift
dts shift when ctts is negative
static const uint8_t offset[511][2]
static av_cold int end(AVCodecContext *avctx)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int id
Format-specific stream ID.
enum AVStreamParseType need_parsing
AVInputFormat ff_mov_demuxer
static int mov_read_cmov(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#define AV_CH_LOW_FREQUENCY
static int mov_metadata_int8_no_padding(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#define AV_OPT_FLAG_VIDEO_PARAM
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
#define MOV_TRUN_SAMPLE_SIZE
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
bitstream reader API header.
static av_cold int read_close(AVFormatContext *ctx)
timecode wraps after 24 hours
static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int64_t start_time
start time of the media
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
const OptionDef options[]
enum AVCodecID video_codec_id
Forced video codec_id.
#define MOV_TFHD_DEFAULT_SIZE
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int64_t time_offset
time offset of the edit list entries
unsigned int keyframe_count
static const uint8_t ff_qt_default_palette_4[4 *3]
static int mov_read_custom_metadata(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const
Rescale a 64-bit integer by 2 rational numbers.
const uint16_t avpriv_ac3_channel_layout_tab[8]
Map audio coding mode (acmod) to channel layout mask.
static int mov_read_fiel(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
Callback for checking whether to abort blocking functions.
int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb)
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_DICT_MATCH_CASE
int has_b_frames
Size of the frame reordering buffer in the decoder.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
const AVIOInterruptCB int_cb
static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
void * priv_data
Format private data.
char filename[1024]
input or output filename
static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
char * av_stristr(const char *haystack, const char *needle)
Locate the first case-independent occurrence in the string haystack of the string needle...
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
static int mov_read_svq3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
preferred ID for decoding MPEG audio layer 1, 2 or 3
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int skip_samples
Number of samples to skip at the start of the frame decoded from the next packet. ...
AVRational avg_frame_rate
Average framerate.
const AVCodecTag ff_codec_wav_tags[]
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES
int min_distance
Minimum distance between this and the previous keyframe, used to avoid unneeded searching.
#define av_unused
Disable warnings about deprecated features This is useful for sections of code kept for backward comp...
static void mov_metadata_creation_time(AVDictionary **metadata, int64_t time)
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
const AVCodecTag ff_codec_movsubtitle_tags[]
#define MIN_DATA_ENTRY_BOX_SIZE
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
static float distance(float x, float y, int band)
static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int buf_size
Size of buf except extra allocated bytes.
static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
unsigned int nb_streams
A list of all streams in the file.
static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags)
static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
AVRational av_d2q(double d, int max) av_const
Convert a double precision floating point number to a rational.
static int mov_read_chap(MOVContext *c, AVIOContext *pb, MOVAtom atom)
Opaque data information usually continuous.
int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const
Rescale a 64-bit integer with rounding to nearest.
#define AV_TIME_BASE
Internal time base represented as integer.
void * av_realloc(void *ptr, size_t size) 1(2)
Allocate or reallocate a block of memory.
const AVCodecTag ff_codec_bmp_tags[]
static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and chilren.
static int mov_read_tmcd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int width
picture width / height.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int mov_read_jp2h(MOVContext *c, AVIOContext *pb, MOVAtom atom)
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static int mov_read_timecode_track(AVFormatContext *s, AVStream *st)
static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom)
char * av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum)
Load timecode string in buf.
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc, int size)
int64_t empty_duration
empty duration of the first edit list entry
#define MOV_TRUN_SAMPLE_DURATION
static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
static int mov_read_close(AVFormatContext *s)
static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
This function reads atom content and puts data in extradata without tag nor size unlike mov_read_extr...
int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, int64_t size)
Read 'chan' tag from the input stream.
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)
static int read_header(FFV1Context *f)
int64_t duration
duration of the longest track
int ff_mov_lang_to_iso639(unsigned code, char to[4])
static const ColorEntry color_table[]
static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
DVDemuxContext * dv_demux
static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
static const uint32_t mac_to_unicode[128]
static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
enum AVMediaType codec_type
#define MP4DecConfigDescrTag
const AVCodecTag ff_codec_movaudio_tags[]
static void mov_read_chapters(AVFormatContext *s)
int sample_rate
samples per second
static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc)
unsigned int stsz_sample_size
always contains sample size from stsz atom
main external API structure.
static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#define MOV_TRUN_FIRST_SAMPLE_FLAGS
#define AV_TIMECODE_STR_SIZE
static int mov_read_ilst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
void * av_realloc_f(void *ptr, size_t nelem, size_t elsize)
Allocate or reallocate a block of memory.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
BYTE int const BYTE int int int height
Describe the class of an AVClass context structure.
#define MKTAG(a, b, c, d)
rational number numerator/denominator
MOVFragment fragment
current fragment in moof atom
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int64_t track_end
used for dts generation in fragmented movie files
static const uint8_t ff_qt_default_palette_16[16 *3]
static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc)
static int mov_read_mac_string(MOVContext *c, AVIOContext *pb, int len, char *dst, int dstlen)
#define MOV_TFHD_DEFAULT_FLAGS
#define MOV_TRUN_SAMPLE_FLAGS
This structure contains the data a format has to probe a file.
int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
AVFormatContext * dv_fctx
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
static void mov_update_dts_shift(MOVStreamContext *sc, int duration)
static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom)
unsigned * stps_data
partial sync sample for mpeg-2 open gop
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
int(* parse)(MOVContext *ctx, AVIOContext *pb, MOVAtom atom)
static int mov_read_mdat(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_metadata_int8_bypass_padding(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
int64_t duration
Decoding: duration of the stream, in stream time base.
static int mov_read_avid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int start_pad
amount of samples to skip due to enc-dec delay
int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag)
static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
An strf atom is a BITMAPINFOHEADER struct.
unsigned int bytes_per_frame
int wrong_dts
dts are wrong due to huge ctts offset (iMovie files)
static av_always_inline double av_int2double(uint64_t i)
Reinterpret a 64-bit integer as a double.
#define MOV_TFHD_BASE_DATA_OFFSET
int ffio_init_context(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
static const MOVParseTableEntry mov_default_parse_table[]
static int parse_timecode_in_framenum_format(AVFormatContext *s, AVStream *st, uint32_t value, int flags)
static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int disposition
AV_DISPOSITION_* bit field.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
static int mov_codec_id(AVStream *st, uint32_t format)
int64_t nb_frames
number of frames in this stream if known or 0
static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_skip_multiple_stsd(MOVContext *c, AVIOContext *pb, int codec_tag, int format, int size)
unsigned int index_entries_allocated_size
#define AVERROR_INVALIDDATA
static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc)
int eof_reached
true if eof reached
static int mov_read_avss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
as in Berlin toast format
int channels
number of audio channels
static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom, enum AVCodecID codec_id)
unsigned int sample_size
may contain value calculated from stsd or value from stsz atom
static const AVClass mov_class
enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
Compute codec id for 'lpcm' tag.
#define MOV_TRUN_DATA_OFFSET
int64_t next_root_atom
offset of the next root atom
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int pseudo_stream_id
-1 means demux all ids
int64_t duration
Decoding: duration of the stream, in AV_TIME_BASE fractional seconds.
int ffindex
AVStream index.
enum AVFieldOrder field_order
Field order.
static int mov_read_trex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
negative time values are allowed
static int mov_read_alac(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static int unsupported(AVCodecContext *avctx)
static int mov_metadata_raw(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
static void fix_timescale(MOVContext *c, MOVStreamContext *sc)
AVRational r_frame_rate
Real base framerate of the stream.
const char *const ff_id3v1_genre_str[ID3v1_GENRE_MAX+1]
ID3v1 genres.
This structure stores compressed data.
static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc, int size)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
AVPacket attached_pic
For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached pictu...
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC