wav: remove a use of deprecated AV_METADATA_ macro
[libav.git] / libavformat / flvenc.c
CommitLineData
d4f5d74a 1/*
7fbde343 2 * FLV muxer
2912e87a 3 * Copyright (c) 2003 The Libav Project
d4f5d74a 4 *
2912e87a 5 * This file is part of Libav.
b78e7197 6 *
2912e87a 7 * Libav is free software; you can redistribute it and/or
d4f5d74a
GM
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
b78e7197 10 * version 2.1 of the License, or (at your option) any later version.
d4f5d74a 11 *
2912e87a 12 * Libav is distributed in the hope that it will be useful,
d4f5d74a
GM
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
2912e87a 18 * License along with Libav; if not, write to the Free Software
5509bffa 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d4f5d74a 20 */
ee8aecd2
MR
21
22#include "libavutil/intfloat_readwrite.h"
d4f5d74a 23#include "avformat.h"
6cac3a3b 24#include "flv.h"
80b39e1c 25#include "internal.h"
f23496b5 26#include "avc.h"
16f82508 27#include "metadata.h"
d2d67e42 28#include "libavutil/dict.h"
d4f5d74a 29
068f2a22
MN
30#undef NDEBUG
31#include <assert.h>
32
7caf0cc6 33static const AVCodecTag flv_video_codec_ids[] = {
148c9bdb
AH
34 {CODEC_ID_FLV1, FLV_CODECID_H263 },
35 {CODEC_ID_FLASHSV, FLV_CODECID_SCREEN},
1b88277b 36 {CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2},
148c9bdb 37 {CODEC_ID_VP6F, FLV_CODECID_VP6 },
09d8c0ae 38 {CODEC_ID_VP6, FLV_CODECID_VP6 },
f23496b5 39 {CODEC_ID_H264, FLV_CODECID_H264 },
148c9bdb
AH
40 {CODEC_ID_NONE, 0}
41};
42
7caf0cc6 43static const AVCodecTag flv_audio_codec_ids[] = {
148c9bdb 44 {CODEC_ID_MP3, FLV_CODECID_MP3 >> FLV_AUDIO_CODECID_OFFSET},
8e9efe43 45 {CODEC_ID_PCM_U8, FLV_CODECID_PCM >> FLV_AUDIO_CODECID_OFFSET},
44de39f9 46 {CODEC_ID_PCM_S16BE, FLV_CODECID_PCM >> FLV_AUDIO_CODECID_OFFSET},
148c9bdb
AH
47 {CODEC_ID_PCM_S16LE, FLV_CODECID_PCM_LE >> FLV_AUDIO_CODECID_OFFSET},
48 {CODEC_ID_ADPCM_SWF, FLV_CODECID_ADPCM >> FLV_AUDIO_CODECID_OFFSET},
f23496b5 49 {CODEC_ID_AAC, FLV_CODECID_AAC >> FLV_AUDIO_CODECID_OFFSET},
b7d1cd02 50 {CODEC_ID_NELLYMOSER, FLV_CODECID_NELLYMOSER >> FLV_AUDIO_CODECID_OFFSET},
046c4001 51 {CODEC_ID_SPEEX, FLV_CODECID_SPEEX >> FLV_AUDIO_CODECID_OFFSET},
148c9bdb
AH
52 {CODEC_ID_NONE, 0}
53};
54
d4f5d74a 55typedef struct FLVContext {
11a8e425 56 int reserved;
bc5c918e
DB
57 int64_t duration_offset;
58 int64_t filesize_offset;
634b8cfa 59 int64_t duration;
f23496b5 60 int delay; ///< first dts delay for AVC
df4f1d51 61 int64_t last_video_ts;
d4f5d74a
GM
62} FLVContext;
63
37cdf93d 64static int get_audio_flags(AVCodecContext *enc){
dd1c8f3e 65 int flags = (enc->bits_per_coded_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT;
37cdf93d 66
f23496b5
BC
67 if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters
68 return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO;
046c4001
JR
69 else if (enc->codec_id == CODEC_ID_SPEEX) {
70 if (enc->sample_rate != 16000) {
71 av_log(enc, AV_LOG_ERROR, "flv only supports wideband (16kHz) Speex audio\n");
72 return -1;
73 }
74 if (enc->channels != 1) {
75 av_log(enc, AV_LOG_ERROR, "flv only supports mono Speex audio\n");
76 return -1;
77 }
78 if (enc->frame_size / 320 > 8) {
68677dd8
JR
79 av_log(enc, AV_LOG_WARNING, "Warning: Speex stream has more than "
80 "8 frames per packet. Adobe Flash "
81 "Player cannot handle this!\n");
046c4001
JR
82 }
83 return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ | FLV_SAMPLESSIZE_16BIT;
84 } else {
37cdf93d
MN
85 switch (enc->sample_rate) {
86 case 44100:
6cac3a3b 87 flags |= FLV_SAMPLERATE_44100HZ;
37cdf93d
MN
88 break;
89 case 22050:
6cac3a3b 90 flags |= FLV_SAMPLERATE_22050HZ;
37cdf93d
MN
91 break;
92 case 11025:
6cac3a3b 93 flags |= FLV_SAMPLERATE_11025HZ;
37cdf93d
MN
94 break;
95 case 8000: //nellymoser only
96 case 5512: //not mp3
4838727e 97 if(enc->codec_id != CODEC_ID_MP3){
ec627278
MN
98 flags |= FLV_SAMPLERATE_SPECIAL;
99 break;
4838727e 100 }
37cdf93d 101 default:
755bfeab 102 av_log(enc, AV_LOG_ERROR, "flv does not support that sample rate, choose from (44100, 22050, 11025).\n");
37cdf93d
MN
103 return -1;
104 }
f23496b5 105 }
37cdf93d
MN
106
107 if (enc->channels > 1) {
6cac3a3b 108 flags |= FLV_STEREO;
37cdf93d 109 }
115329f1 110
37cdf93d
MN
111 switch(enc->codec_id){
112 case CODEC_ID_MP3:
6cac3a3b 113 flags |= FLV_CODECID_MP3 | FLV_SAMPLESSIZE_16BIT;
37cdf93d 114 break;
8e9efe43 115 case CODEC_ID_PCM_U8:
44de39f9 116 flags |= FLV_CODECID_PCM | FLV_SAMPLESSIZE_8BIT;
bb270c08 117 break;
923bd441 118 case CODEC_ID_PCM_S16BE:
44de39f9 119 flags |= FLV_CODECID_PCM | FLV_SAMPLESSIZE_16BIT;
bb270c08 120 break;
923bd441 121 case CODEC_ID_PCM_S16LE:
6cac3a3b 122 flags |= FLV_CODECID_PCM_LE | FLV_SAMPLESSIZE_16BIT;
bb270c08 123 break;
2fde8aae 124 case CODEC_ID_ADPCM_SWF:
e9509536 125 flags |= FLV_CODECID_ADPCM | FLV_SAMPLESSIZE_16BIT;
bb270c08 126 break;
b7d1cd02 127 case CODEC_ID_NELLYMOSER:
8ddd280d
AW
128 if (enc->sample_rate == 8000) {
129 flags |= FLV_CODECID_NELLYMOSER_8KHZ_MONO | FLV_SAMPLESSIZE_16BIT;
130 } else {
131 flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT;
132 }
b7d1cd02 133 break;
37cdf93d
MN
134 case 0:
135 flags |= enc->codec_tag<<4;
136 break;
137 default:
a254c574 138 av_log(enc, AV_LOG_ERROR, "codec not compatible with flv\n");
37cdf93d
MN
139 return -1;
140 }
115329f1 141
37cdf93d
MN
142 return flags;
143}
144
ae628ec1 145static void put_amf_string(AVIOContext *pb, const char *str)
fd0fb306
MN
146{
147 size_t len = strlen(str);
77eb5504
AK
148 avio_wb16(pb, len);
149 avio_write(pb, str, len);
fd0fb306
MN
150}
151
ae628ec1 152static void put_avc_eos_tag(AVIOContext *pb, unsigned ts) {
77eb5504
AK
153 avio_w8(pb, FLV_TAG_TYPE_VIDEO);
154 avio_wb24(pb, 5); /* Tag Data Size */
155 avio_wb24(pb, ts); /* lower 24 bits of timestamp in ms*/
156 avio_w8(pb, (ts >> 24) & 0x7F); /* MSB of ts in ms*/
157 avio_wb24(pb, 0); /* StreamId = 0 */
158 avio_w8(pb, 23); /* ub[4] FrameType = 1, ub[4] CodecId = 7 */
159 avio_w8(pb, 2); /* AVC end of sequence */
160 avio_wb24(pb, 0); /* Always 0 for AVC EOS. */
161 avio_wb32(pb, 16); /* Size of FLV tag */
df4f1d51
TF
162}
163
ae628ec1 164static void put_amf_double(AVIOContext *pb, double d)
fd0fb306 165{
77eb5504
AK
166 avio_w8(pb, AMF_DATA_TYPE_NUMBER);
167 avio_wb64(pb, av_dbl2int(d));
fd0fb306
MN
168}
169
ae628ec1 170static void put_amf_bool(AVIOContext *pb, int b) {
77eb5504
AK
171 avio_w8(pb, AMF_DATA_TYPE_BOOL);
172 avio_w8(pb, !!b);
148c9bdb
AH
173}
174
d4f5d74a
GM
175static int flv_write_header(AVFormatContext *s)
176{
ae628ec1 177 AVIOContext *pb = s->pb;
d4f5d74a 178 FLVContext *flv = s->priv_data;
5366f15d
BC
179 AVCodecContext *audio_enc = NULL, *video_enc = NULL;
180 int i;
fd0fb306
MN
181 double framerate = 0.0;
182 int metadata_size_pos, data_size;
d2d67e42 183 AVDictionaryEntry *tag = NULL;
d4f5d74a 184
11a8e425 185 for(i=0; i<s->nb_streams; i++){
01f4895c 186 AVCodecContext *enc = s->streams[i]->codec;
72415b2a 187 if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
fd0fb306
MN
188 if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) {
189 framerate = av_q2d(s->streams[i]->r_frame_rate);
190 } else {
191 framerate = 1/av_q2d(s->streams[i]->codec->time_base);
192 }
5366f15d
BC
193 video_enc = enc;
194 if(enc->codec_tag == 0) {
148c9bdb
AH
195 av_log(enc, AV_LOG_ERROR, "video codec not compatible with flv\n");
196 return -1;
197 }
fd0fb306 198 } else {
5366f15d 199 audio_enc = enc;
c45388b1
MN
200 if(get_audio_flags(enc)<0)
201 return -1;
fd0fb306 202 }
254629b1 203 av_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
c45388b1 204 }
bbc413f9 205 avio_write(pb, "FLV", 3);
77eb5504
AK
206 avio_w8(pb,1);
207 avio_w8(pb, FLV_HEADER_FLAG_HASAUDIO * !!audio_enc
5366f15d 208 + FLV_HEADER_FLAG_HASVIDEO * !!video_enc);
77eb5504
AK
209 avio_wb32(pb,9);
210 avio_wb32(pb,0);
c45388b1
MN
211
212 for(i=0; i<s->nb_streams; i++){
213 if(s->streams[i]->codec->codec_tag == 5){
77eb5504
AK
214 avio_w8(pb,8); // message type
215 avio_wb24(pb,0); // include flags
216 avio_wb24(pb,0); // time stamp
217 avio_wb32(pb,0); // reserved
218 avio_wb32(pb,11); // size
11a8e425
MN
219 flv->reserved=5;
220 }
221 }
d4f5d74a 222
df4f1d51
TF
223 flv->last_video_ts = -1;
224
fd0fb306 225 /* write meta_tag */
77eb5504 226 avio_w8(pb, 18); // tag type META
a2704c97 227 metadata_size_pos= avio_tell(pb);
77eb5504
AK
228 avio_wb24(pb, 0); // size of data part (sum of all parts below)
229 avio_wb24(pb, 0); // time stamp
230 avio_wb32(pb, 0); // reserved
fd0fb306
MN
231
232 /* now data of data_size size */
233
234 /* first event name as a string */
77eb5504 235 avio_w8(pb, AMF_DATA_TYPE_STRING);
fd0fb306
MN
236 put_amf_string(pb, "onMetaData"); // 12 bytes
237
238 /* mixed array (hash) with size and string/type/data tuples */
77eb5504
AK
239 avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY);
240 avio_wb32(pb, 5*!!video_enc + 5*!!audio_enc + 2); // +2 for duration and file size
fd0fb306 241
634b8cfa 242 put_amf_string(pb, "duration");
a2704c97 243 flv->duration_offset= avio_tell(pb);
c5e1e982 244 put_amf_double(pb, s->duration / AV_TIME_BASE); // fill in the guessed duration, it'll be corrected later if incorrect
fd0fb306 245
5366f15d 246 if(video_enc){
fd0fb306 247 put_amf_string(pb, "width");
5366f15d 248 put_amf_double(pb, video_enc->width);
fd0fb306
MN
249
250 put_amf_string(pb, "height");
5366f15d 251 put_amf_double(pb, video_enc->height);
fd0fb306
MN
252
253 put_amf_string(pb, "videodatarate");
426a6f34 254 put_amf_double(pb, video_enc->bit_rate / 1024.0);
fd0fb306
MN
255
256 put_amf_string(pb, "framerate");
257 put_amf_double(pb, framerate);
148c9bdb
AH
258
259 put_amf_string(pb, "videocodecid");
5366f15d 260 put_amf_double(pb, video_enc->codec_tag);
fd0fb306
MN
261 }
262
5366f15d 263 if(audio_enc){
426a6f34
SK
264 put_amf_string(pb, "audiodatarate");
265 put_amf_double(pb, audio_enc->bit_rate / 1024.0);
266
fd0fb306 267 put_amf_string(pb, "audiosamplerate");
5366f15d 268 put_amf_double(pb, audio_enc->sample_rate);
148c9bdb
AH
269
270 put_amf_string(pb, "audiosamplesize");
8e9efe43 271 put_amf_double(pb, audio_enc->codec_id == CODEC_ID_PCM_U8 ? 8 : 16);
148c9bdb
AH
272
273 put_amf_string(pb, "stereo");
5366f15d 274 put_amf_bool(pb, audio_enc->channels == 2);
148c9bdb
AH
275
276 put_amf_string(pb, "audiocodecid");
5366f15d 277 put_amf_double(pb, audio_enc->codec_tag);
fd0fb306
MN
278 }
279
d2d67e42 280 while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
16f82508 281 put_amf_string(pb, tag->key);
77eb5504 282 avio_w8(pb, AMF_DATA_TYPE_STRING);
16f82508
TT
283 put_amf_string(pb, tag->value);
284 }
285
634b8cfa 286 put_amf_string(pb, "filesize");
a2704c97 287 flv->filesize_offset= avio_tell(pb);
634b8cfa 288 put_amf_double(pb, 0); // delayed write
fd0fb306
MN
289
290 put_amf_string(pb, "");
77eb5504 291 avio_w8(pb, AMF_END_OF_OBJECT);
fd0fb306
MN
292
293 /* write total size of tag */
a2704c97 294 data_size= avio_tell(pb) - metadata_size_pos - 10;
6b4aa5da 295 avio_seek(pb, metadata_size_pos, SEEK_SET);
77eb5504 296 avio_wb24(pb, data_size);
45a8a02a 297 avio_skip(pb, data_size + 10 - 3);
77eb5504 298 avio_wb32(pb, data_size + 11);
fd0fb306 299
f23496b5
BC
300 for (i = 0; i < s->nb_streams; i++) {
301 AVCodecContext *enc = s->streams[i]->codec;
302 if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) {
bc5c918e 303 int64_t pos;
77eb5504 304 avio_w8(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ?
f23496b5 305 FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
77eb5504
AK
306 avio_wb24(pb, 0); // size patched later
307 avio_wb24(pb, 0); // ts
308 avio_w8(pb, 0); // ts ext
309 avio_wb24(pb, 0); // streamid
a2704c97 310 pos = avio_tell(pb);
f23496b5 311 if (enc->codec_id == CODEC_ID_AAC) {
77eb5504
AK
312 avio_w8(pb, get_audio_flags(enc));
313 avio_w8(pb, 0); // AAC sequence header
314 avio_write(pb, enc->extradata, enc->extradata_size);
f23496b5 315 } else {
77eb5504
AK
316 avio_w8(pb, enc->codec_tag | FLV_FRAME_KEY); // flags
317 avio_w8(pb, 0); // AVC sequence header
318 avio_wb24(pb, 0); // composition time
f23496b5
BC
319 ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size);
320 }
a2704c97 321 data_size = avio_tell(pb) - pos;
6b4aa5da 322 avio_seek(pb, -data_size - 10, SEEK_CUR);
77eb5504 323 avio_wb24(pb, data_size);
45a8a02a 324 avio_skip(pb, data_size + 10 - 3);
77eb5504 325 avio_wb32(pb, data_size + 11); // previous tag size
f23496b5
BC
326 }
327 }
328
d4f5d74a
GM
329 return 0;
330}
331
d4f5d74a
GM
332static int flv_write_trailer(AVFormatContext *s)
333{
14b32253 334 int64_t file_size;
14b32253 335
ae628ec1 336 AVIOContext *pb = s->pb;
d4f5d74a 337 FLVContext *flv = s->priv_data;
df4f1d51
TF
338 int i;
339
340 /* Add EOS tag */
341 for (i = 0; i < s->nb_streams; i++) {
342 AVCodecContext *enc = s->streams[i]->codec;
b9f9e59a 343 if (enc->codec_type == AVMEDIA_TYPE_VIDEO &&
df4f1d51
TF
344 enc->codec_id == CODEC_ID_H264) {
345 put_avc_eos_tag(pb, flv->last_video_ts);
346 }
347 }
d4f5d74a 348
a2704c97 349 file_size = avio_tell(pb);
634b8cfa
BC
350
351 /* update informations */
6b4aa5da 352 avio_seek(pb, flv->duration_offset, SEEK_SET);
634b8cfa 353 put_amf_double(pb, flv->duration / (double)1000);
6b4aa5da 354 avio_seek(pb, flv->filesize_offset, SEEK_SET);
634b8cfa
BC
355 put_amf_double(pb, file_size);
356
6b4aa5da 357 avio_seek(pb, file_size, SEEK_SET);
d4f5d74a
GM
358 return 0;
359}
360
e928649b 361static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
d4f5d74a 362{
ae628ec1 363 AVIOContext *pb = s->pb;
01f4895c 364 AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
d4f5d74a 365 FLVContext *flv = s->priv_data;
f23496b5 366 unsigned ts;
e928649b 367 int size= pkt->size;
71e685b0 368 uint8_t *data= NULL;
f683dbdc 369 int flags, flags_size;
d4f5d74a 370
949b1a13 371// av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", enc->codec_type, timestamp, size);
115329f1 372
f23496b5
BC
373 if(enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F ||
374 enc->codec_id == CODEC_ID_AAC)
f683dbdc 375 flags_size= 2;
f23496b5
BC
376 else if(enc->codec_id == CODEC_ID_H264)
377 flags_size= 5;
f683dbdc
MN
378 else
379 flags_size= 1;
380
72415b2a 381 if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
77eb5504 382 avio_w8(pb, FLV_TAG_TYPE_VIDEO);
09d8c0ae 383
bb85077f 384 flags = enc->codec_tag;
09d8c0ae
BL
385 if(flags == 0) {
386 av_log(enc, AV_LOG_ERROR, "video codec %X not compatible with flv\n",enc->codec_id);
387 return -1;
388 }
389
cc947f04 390 flags |= pkt->flags & AV_PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER;
75293f05 391 } else {
72415b2a 392 assert(enc->codec_type == AVMEDIA_TYPE_AUDIO);
37cdf93d 393 flags = get_audio_flags(enc);
115329f1 394
068f2a22 395 assert(size);
068f2a22 396
77eb5504 397 avio_w8(pb, FLV_TAG_TYPE_AUDIO);
75293f05
MN
398 }
399
7d637efa 400 if (enc->codec_id == CODEC_ID_H264) {
71e685b0
BC
401 /* check if extradata looks like mp4 formated */
402 if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
403 if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0)
404 return -1;
405 }
6f4eb12d
BC
406 if (!flv->delay && pkt->dts < 0)
407 flv->delay = -pkt->dts;
f23496b5
BC
408 }
409
410 ts = pkt->dts + flv->delay; // add delay to force positive dts
b9f9e59a 411 if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
df4f1d51
TF
412 if (flv->last_video_ts < ts)
413 flv->last_video_ts = ts;
414 }
77eb5504
AK
415 avio_wb24(pb,size + flags_size);
416 avio_wb24(pb,ts);
417 avio_w8(pb,(ts >> 24) & 0x7F); // timestamps are 32bits _signed_
418 avio_wb24(pb,flv->reserved);
419 avio_w8(pb,flags);
09d8c0ae 420 if (enc->codec_id == CODEC_ID_VP6)
77eb5504 421 avio_w8(pb,0);
09d8c0ae 422 if (enc->codec_id == CODEC_ID_VP6F)
77eb5504 423 avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0);
f23496b5 424 else if (enc->codec_id == CODEC_ID_AAC)
77eb5504 425 avio_w8(pb,1); // AAC raw
f23496b5 426 else if (enc->codec_id == CODEC_ID_H264) {
77eb5504
AK
427 avio_w8(pb,1); // AVC NALU
428 avio_wb24(pb,pkt->pts - pkt->dts);
f23496b5 429 }
71e685b0 430
77eb5504 431 avio_write(pb, data ? data : pkt->data, size);
71e685b0 432
77eb5504 433 avio_wb32(pb,size+flags_size+11); // previous tag size
f23496b5 434 flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration);
115329f1 435
b7f2fdde 436 avio_flush(pb);
71e685b0
BC
437
438 av_free(data);
439
0e28e9ca 440 return pb->error;
d4f5d74a
GM
441}
442
c6610a21 443AVOutputFormat ff_flv_muxer = {
d4f5d74a 444 "flv",
bde15e74 445 NULL_IF_CONFIG_SMALL("FLV format"),
e817a73d 446 "video/x-flv",
d4f5d74a
GM
447 "flv",
448 sizeof(FLVContext),
b250f9c6 449#if CONFIG_LIBMP3LAME
80783dc2 450 CODEC_ID_MP3,
6ebe07fb 451#else // CONFIG_LIBMP3LAME
964ff354 452 CODEC_ID_ADPCM_SWF,
6ebe07fb 453#endif // CONFIG_LIBMP3LAME
d4f5d74a
GM
454 CODEC_ID_FLV1,
455 flv_write_header,
456 flv_write_packet,
457 flv_write_trailer,
c1854592 458 .codec_tag= (const AVCodecTag* const []){flv_video_codec_ids, flv_audio_codec_ids, 0},
e458dd0b 459 .flags= AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
d4f5d74a 460};