38 #define KEYFRAMES_TAG "keyframes"
39 #define KEYFRAMES_TIMESTAMP_TAG "times"
40 #define KEYFRAMES_BYTEOFFSET_TAG "filepositions"
44 uint8_t *new_extradata[2];
45 int new_extradata_size[2];
55 if (d[0] ==
'F' && d[1] ==
'L' && d[2] ==
'V' && d[3] < 5 && d[5]==0 &&
AV_RB32(d+5)>8) {
100 switch(flv_codecid) {
127 if(length >= buffsize) {
134 buffer[length] =
'\0';
140 unsigned int arraylen = 0, timeslen = 0, fileposlen = 0, i;
143 int64_t *times =
NULL;
144 int64_t *filepositions =
NULL;
150 if (creator && !strcmp(creator->
value,
"MEGA")) {
161 int64_t* current_array;
176 if (!(times =
av_mallocz(
sizeof(*times) * arraylen))) {
181 current_array = times;
183 if (!(filepositions =
av_mallocz(
sizeof(*filepositions) * arraylen))) {
187 fileposlen = arraylen;
188 current_array = filepositions;
192 for (i = 0; i < arraylen &&
avio_tell(ioc) < max_pos - 1; i++) {
196 current_array[i] = num_val;
198 if (times && filepositions) {
206 if (!ret && timeslen == fileposlen)
207 for (i = 0; i < fileposlen; i++)
217 if (ret < 0 &&
avio_seek(ioc, initial_pos, SEEK_SET) > 0)
246 if ((vstream || astream) && key && !strcmp(
KEYFRAMES_TAG, key) && depth == 1)
275 unsigned int arraylen, i;
278 for(i = 0; i < arraylen &&
avio_tell(ioc) < max_pos - 1; i++) {
291 if(depth == 1 && key) {
292 acodec = astream ? astream->
codec :
NULL;
293 vcodec = vstream ? vstream->
codec :
NULL;
296 if (!strcmp(key,
"duration"))
298 else if (!strcmp(key,
"videodatarate") && vcodec && 0 <= (
int)(num_val * 1024.0))
299 vcodec->
bit_rate = num_val * 1024.0;
300 else if (!strcmp(key,
"audiodatarate") && acodec && 0 <= (
int)(num_val * 1024.0))
301 acodec->
bit_rate = num_val * 1024.0;
304 if (!strcmp(key,
"duration") ||
305 !strcmp(key,
"filesize") ||
306 !strcmp(key,
"width") ||
307 !strcmp(key,
"height") ||
308 !strcmp(key,
"videodatarate") ||
309 !strcmp(key,
"framerate") ||
310 !strcmp(key,
"videocodecid") ||
311 !strcmp(key,
"audiodatarate") ||
312 !strcmp(key,
"audiosamplerate") ||
313 !strcmp(key,
"audiosamplesize") ||
314 !strcmp(key,
"stereo") ||
315 !strcmp(key,
"audiocodecid"))
319 av_strlcpy(str_val, num_val > 0 ?
"true" :
"false",
sizeof(str_val));
322 snprintf(str_val,
sizeof(str_val),
"%.f", num_val);
333 AVStream *stream, *astream, *vstream;
444 int sample_rate = 0, channels = 0;
453 av_dlog(s,
"type:%d, size:%d, dts:%"PRId64
"\n", type, size, dts);
472 if ((flags & 0xf0) == 0x50)
478 av_log(s,
AV_LOG_DEBUG,
"skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
491 if (st->
id == is_audio)
529 int bits_per_coded_sample;
557 int32_t cts = (
avio_rb24(s->
pb)+0xff800000)^0xff800000;
584 av_dlog(s,
"mp4a config channels %d sample rate %d\n",
635 int64_t ts,
int flags)
642 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
649 if (stream_index < 0) {
651 if (stream_index < 0)