22 #include "libavutil/intreadwrite.h"
23 #include "libavutil/dict.h"
24 #include "libavutil/intfloat.h"
25 #include "libavutil/avassert.h"
83 "FLV only supports wideband (16kHz) Speex audio\n");
111 "FLV does not support sample rate %d, "
112 "choose from (44100, 22050, 11025)\n", enc->
sample_rate);
164 size_t len = strlen(str);
174 avio_w8(pb, (ts >> 24) & 0x7F);
199 int i, metadata_count = 0;
200 double framerate = 0.0;
201 int64_t metadata_size_pos, data_size, metadata_count_pos;
217 av_log(s,
AV_LOG_ERROR,
"Video codec '%s' for stream %d is not compatible with FLV\n",
229 "use vstrict=-1 / -strict -1 to use it anyway.\n");
296 metadata_count = 5 * !!video_enc +
349 if( !strcmp(tag->
key,
"width")
350 ||!strcmp(tag->
key,
"height")
351 ||!strcmp(tag->
key,
"videodatarate")
352 ||!strcmp(tag->
key,
"framerate")
353 ||!strcmp(tag->
key,
"videocodecid")
354 ||!strcmp(tag->
key,
"audiodatarate")
355 ||!strcmp(tag->
key,
"audiosamplerate")
356 ||!strcmp(tag->
key,
"audiosamplesize")
357 ||!strcmp(tag->
key,
"stereo")
358 ||!strcmp(tag->
key,
"audiocodecid")
359 ||!strcmp(tag->
key,
"duration")
360 ||!strcmp(tag->
key,
"onMetaData")
379 data_size =
avio_tell(pb) - metadata_size_pos - 10;
381 avio_seek(pb, metadata_count_pos, SEEK_SET);
384 avio_seek(pb, metadata_size_pos, SEEK_SET);
411 avio_seek(pb, -data_size - 10, SEEK_CUR);
463 int flags = -1, flags_size, ret;
480 "Video codec '%s' is not compatible with FLV\n",
510 "use audio bitstream filter 'aac_adtstoasc' to fix it "
511 "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
522 "Packets are not in the proper order with respect to DTS\n");
531 "8 frames per packet. Adobe Flash "
532 "Player cannot handle this!\n");
539 avio_w8(pb, (ts >> 24) & 0x7F);
558 data_size =
avio_tell(pb) - metadata_size_pos;
559 avio_seek(pb, metadata_size_pos - 10, SEEK_SET);
561 avio_seek(pb, data_size + 10 - 3, SEEK_CUR);
593 .mime_type =
"video/x-flv",