Statistics
| Branch: | Revision:

ffmpeg / libavformat / flvenc.c @ b83a00b8

History | View | Annotate | Download (12.4 KB)

1 d4f5d74a Garrick Meeker
/*
2 7fbde343 Aurelien Jacobs
 * FLV muxer
3 d4f5d74a Garrick Meeker
 * Copyright (c) 2003 The FFmpeg Project.
4
 *
5 b78e7197 Diego Biurrun
 * This file is part of FFmpeg.
6
 *
7
 * FFmpeg is free software; you can redistribute it and/or
8 d4f5d74a Garrick Meeker
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10 b78e7197 Diego Biurrun
 * version 2.1 of the License, or (at your option) any later version.
11 d4f5d74a Garrick Meeker
 *
12 b78e7197 Diego Biurrun
 * FFmpeg is distributed in the hope that it will be useful,
13 d4f5d74a Garrick Meeker
 * 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
18 b78e7197 Diego Biurrun
 * License along with FFmpeg; if not, write to the Free Software
19 5509bffa Diego Biurrun
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 d4f5d74a Garrick Meeker
 */
21
#include "avformat.h"
22 6cac3a3b Allan Hsu
#include "flv.h"
23 148c9bdb Allan Hsu
#include "riff.h"
24 f23496b5 Baptiste Coudurier
#include "avc.h"
25 d4f5d74a Garrick Meeker
26 068f2a22 Michael Niedermayer
#undef NDEBUG
27
#include <assert.h>
28
29 7caf0cc6 Michael Niedermayer
static const AVCodecTag flv_video_codec_ids[] = {
30 148c9bdb Allan Hsu
    {CODEC_ID_FLV1,    FLV_CODECID_H263  },
31
    {CODEC_ID_FLASHSV, FLV_CODECID_SCREEN},
32
    {CODEC_ID_VP6F,    FLV_CODECID_VP6   },
33 09d8c0ae Benjamin Larsson
    {CODEC_ID_VP6,     FLV_CODECID_VP6   },
34 f23496b5 Baptiste Coudurier
    {CODEC_ID_H264,    FLV_CODECID_H264  },
35 148c9bdb Allan Hsu
    {CODEC_ID_NONE,    0}
36
};
37
38 7caf0cc6 Michael Niedermayer
static const AVCodecTag flv_audio_codec_ids[] = {
39 148c9bdb Allan Hsu
    {CODEC_ID_MP3,       FLV_CODECID_MP3    >> FLV_AUDIO_CODECID_OFFSET},
40 44de39f9 Michael Niedermayer
    {CODEC_ID_PCM_S8,    FLV_CODECID_PCM    >> FLV_AUDIO_CODECID_OFFSET},
41
    {CODEC_ID_PCM_S16BE, FLV_CODECID_PCM    >> FLV_AUDIO_CODECID_OFFSET},
42 148c9bdb Allan Hsu
    {CODEC_ID_PCM_S16LE, FLV_CODECID_PCM_LE >> FLV_AUDIO_CODECID_OFFSET},
43
    {CODEC_ID_ADPCM_SWF, FLV_CODECID_ADPCM  >> FLV_AUDIO_CODECID_OFFSET},
44 f23496b5 Baptiste Coudurier
    {CODEC_ID_AAC,       FLV_CODECID_AAC    >> FLV_AUDIO_CODECID_OFFSET},
45 b7d1cd02 Bartlomiej Wolowiec
    {CODEC_ID_NELLYMOSER, FLV_CODECID_NELLYMOSER >> FLV_AUDIO_CODECID_OFFSET},
46 148c9bdb Allan Hsu
    {CODEC_ID_NONE,      0}
47
};
48
49 d4f5d74a Garrick Meeker
typedef struct FLVContext {
50 11a8e425 Michael Niedermayer
    int reserved;
51 634b8cfa Baptiste Coudurier
    offset_t duration_offset;
52
    offset_t filesize_offset;
53
    int64_t duration;
54 f23496b5 Baptiste Coudurier
    int delay; ///< first dts delay for AVC
55 d4f5d74a Garrick Meeker
} FLVContext;
56
57 37cdf93d Michael Niedermayer
static int get_audio_flags(AVCodecContext *enc){
58 6cac3a3b Allan Hsu
    int flags = (enc->bits_per_sample == 16) ? FLV_SAMPLESSIZE_16BIT : FLV_SAMPLESSIZE_8BIT;
59 37cdf93d Michael Niedermayer
60 f23496b5 Baptiste Coudurier
    if (enc->codec_id == CODEC_ID_AAC) // specs force these parameters
61
        return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ | FLV_SAMPLESSIZE_16BIT | FLV_STEREO;
62
    else {
63 37cdf93d Michael Niedermayer
    switch (enc->sample_rate) {
64
        case    44100:
65 6cac3a3b Allan Hsu
            flags |= FLV_SAMPLERATE_44100HZ;
66 37cdf93d Michael Niedermayer
            break;
67
        case    22050:
68 6cac3a3b Allan Hsu
            flags |= FLV_SAMPLERATE_22050HZ;
69 37cdf93d Michael Niedermayer
            break;
70
        case    11025:
71 6cac3a3b Allan Hsu
            flags |= FLV_SAMPLERATE_11025HZ;
72 37cdf93d Michael Niedermayer
            break;
73
        case     8000: //nellymoser only
74
        case     5512: //not mp3
75 4838727e Michael Niedermayer
            if(enc->codec_id != CODEC_ID_MP3){
76 ec627278 Michael Niedermayer
                flags |= FLV_SAMPLERATE_SPECIAL;
77
                break;
78 4838727e Michael Niedermayer
            }
79 37cdf93d Michael Niedermayer
        default:
80 755bfeab Diego Biurrun
            av_log(enc, AV_LOG_ERROR, "flv does not support that sample rate, choose from (44100, 22050, 11025).\n");
81 37cdf93d Michael Niedermayer
            return -1;
82
    }
83 f23496b5 Baptiste Coudurier
    }
84 37cdf93d Michael Niedermayer
85
    if (enc->channels > 1) {
86 6cac3a3b Allan Hsu
        flags |= FLV_STEREO;
87 37cdf93d Michael Niedermayer
    }
88 115329f1 Diego Biurrun
89 37cdf93d Michael Niedermayer
    switch(enc->codec_id){
90
    case CODEC_ID_MP3:
91 6cac3a3b Allan Hsu
        flags |= FLV_CODECID_MP3    | FLV_SAMPLESSIZE_16BIT;
92 37cdf93d Michael Niedermayer
        break;
93 923bd441 Alex Beregszaszi
    case CODEC_ID_PCM_S8:
94 44de39f9 Michael Niedermayer
        flags |= FLV_CODECID_PCM    | FLV_SAMPLESSIZE_8BIT;
95 bb270c08 Diego Biurrun
        break;
96 923bd441 Alex Beregszaszi
    case CODEC_ID_PCM_S16BE:
97 44de39f9 Michael Niedermayer
        flags |= FLV_CODECID_PCM    | FLV_SAMPLESSIZE_16BIT;
98 bb270c08 Diego Biurrun
        break;
99 923bd441 Alex Beregszaszi
    case CODEC_ID_PCM_S16LE:
100 6cac3a3b Allan Hsu
        flags |= FLV_CODECID_PCM_LE | FLV_SAMPLESSIZE_16BIT;
101 bb270c08 Diego Biurrun
        break;
102 2fde8aae Alex Beregszaszi
    case CODEC_ID_ADPCM_SWF:
103 e9509536 Benjamin Larsson
        flags |= FLV_CODECID_ADPCM | FLV_SAMPLESSIZE_16BIT;
104 bb270c08 Diego Biurrun
        break;
105 b7d1cd02 Bartlomiej Wolowiec
    case CODEC_ID_NELLYMOSER:
106
        flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT;
107
        break;
108 37cdf93d Michael Niedermayer
    case 0:
109
        flags |= enc->codec_tag<<4;
110
        break;
111
    default:
112 a254c574 Michael Niedermayer
        av_log(enc, AV_LOG_ERROR, "codec not compatible with flv\n");
113 37cdf93d Michael Niedermayer
        return -1;
114
    }
115 115329f1 Diego Biurrun
116 37cdf93d Michael Niedermayer
    return flags;
117
}
118
119 fd0fb306 Michael Niedermayer
static void put_amf_string(ByteIOContext *pb, const char *str)
120
{
121
    size_t len = strlen(str);
122
    put_be16(pb, len);
123
    put_buffer(pb, str, len);
124
}
125
126
static void put_amf_double(ByteIOContext *pb, double d)
127
{
128 6cac3a3b Allan Hsu
    put_byte(pb, AMF_DATA_TYPE_NUMBER);
129 fd0fb306 Michael Niedermayer
    put_be64(pb, av_dbl2int(d));
130
}
131
132 148c9bdb Allan Hsu
static void put_amf_bool(ByteIOContext *pb, int b) {
133
    put_byte(pb, AMF_DATA_TYPE_BOOL);
134
    put_byte(pb, !!b);
135
}
136
137 d4f5d74a Garrick Meeker
static int flv_write_header(AVFormatContext *s)
138
{
139 899681cd Björn Axelsson
    ByteIOContext *pb = s->pb;
140 d4f5d74a Garrick Meeker
    FLVContext *flv = s->priv_data;
141 5366f15d Baptiste Coudurier
    AVCodecContext *audio_enc = NULL, *video_enc = NULL;
142
    int i;
143 fd0fb306 Michael Niedermayer
    double framerate = 0.0;
144
    int metadata_size_pos, data_size;
145 d4f5d74a Garrick Meeker
146 11a8e425 Michael Niedermayer
    for(i=0; i<s->nb_streams; i++){
147 01f4895c Michael Niedermayer
        AVCodecContext *enc = s->streams[i]->codec;
148 fd0fb306 Michael Niedermayer
        if (enc->codec_type == CODEC_TYPE_VIDEO) {
149
            if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) {
150
                framerate = av_q2d(s->streams[i]->r_frame_rate);
151
            } else {
152
                framerate = 1/av_q2d(s->streams[i]->codec->time_base);
153
            }
154 5366f15d Baptiste Coudurier
            video_enc = enc;
155
            if(enc->codec_tag == 0) {
156 148c9bdb Allan Hsu
                av_log(enc, AV_LOG_ERROR, "video codec not compatible with flv\n");
157
                return -1;
158
            }
159 fd0fb306 Michael Niedermayer
        } else {
160 5366f15d Baptiste Coudurier
            audio_enc = enc;
161 c45388b1 Michael Niedermayer
            if(get_audio_flags(enc)<0)
162
                return -1;
163 fd0fb306 Michael Niedermayer
        }
164 254629b1 Baptiste Coudurier
        av_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
165 c45388b1 Michael Niedermayer
    }
166
    put_tag(pb,"FLV");
167
    put_byte(pb,1);
168 5366f15d Baptiste Coudurier
    put_byte(pb,   FLV_HEADER_FLAG_HASAUDIO * !!audio_enc
169
                 + FLV_HEADER_FLAG_HASVIDEO * !!video_enc);
170 c45388b1 Michael Niedermayer
    put_be32(pb,9);
171
    put_be32(pb,0);
172
173
    for(i=0; i<s->nb_streams; i++){
174
        if(s->streams[i]->codec->codec_tag == 5){
175 11a8e425 Michael Niedermayer
            put_byte(pb,8); // message type
176
            put_be24(pb,0); // include flags
177
            put_be24(pb,0); // time stamp
178
            put_be32(pb,0); // reserved
179
            put_be32(pb,11); // size
180
            flv->reserved=5;
181
        }
182
    }
183 d4f5d74a Garrick Meeker
184 fd0fb306 Michael Niedermayer
    /* write meta_tag */
185
    put_byte(pb, 18);         // tag type META
186
    metadata_size_pos= url_ftell(pb);
187
    put_be24(pb, 0);          // size of data part (sum of all parts below)
188
    put_be24(pb, 0);          // time stamp
189
    put_be32(pb, 0);          // reserved
190
191
    /* now data of data_size size */
192
193
    /* first event name as a string */
194 6cac3a3b Allan Hsu
    put_byte(pb, AMF_DATA_TYPE_STRING);
195 fd0fb306 Michael Niedermayer
    put_amf_string(pb, "onMetaData"); // 12 bytes
196
197
    /* mixed array (hash) with size and string/type/data tuples */
198 6cac3a3b Allan Hsu
    put_byte(pb, AMF_DATA_TYPE_MIXEDARRAY);
199 5366f15d Baptiste Coudurier
    put_be32(pb, 5*!!video_enc + 4*!!audio_enc + 2); // +2 for duration and file size
200 fd0fb306 Michael Niedermayer
201 634b8cfa Baptiste Coudurier
    put_amf_string(pb, "duration");
202
    flv->duration_offset= url_ftell(pb);
203
    put_amf_double(pb, 0); // delayed write
204 fd0fb306 Michael Niedermayer
205 5366f15d Baptiste Coudurier
    if(video_enc){
206 fd0fb306 Michael Niedermayer
        put_amf_string(pb, "width");
207 5366f15d Baptiste Coudurier
        put_amf_double(pb, video_enc->width);
208 fd0fb306 Michael Niedermayer
209
        put_amf_string(pb, "height");
210 5366f15d Baptiste Coudurier
        put_amf_double(pb, video_enc->height);
211 fd0fb306 Michael Niedermayer
212
        put_amf_string(pb, "videodatarate");
213
        put_amf_double(pb, s->bit_rate / 1024.0);
214
215
        put_amf_string(pb, "framerate");
216
        put_amf_double(pb, framerate);
217 148c9bdb Allan Hsu
218
        put_amf_string(pb, "videocodecid");
219 5366f15d Baptiste Coudurier
        put_amf_double(pb, video_enc->codec_tag);
220 fd0fb306 Michael Niedermayer
    }
221
222 5366f15d Baptiste Coudurier
    if(audio_enc){
223 fd0fb306 Michael Niedermayer
        put_amf_string(pb, "audiosamplerate");
224 5366f15d Baptiste Coudurier
        put_amf_double(pb, audio_enc->sample_rate);
225 148c9bdb Allan Hsu
226
        put_amf_string(pb, "audiosamplesize");
227 5366f15d Baptiste Coudurier
        put_amf_double(pb, audio_enc->codec_id == CODEC_ID_PCM_S8 ? 8 : 16);
228 148c9bdb Allan Hsu
229
        put_amf_string(pb, "stereo");
230 5366f15d Baptiste Coudurier
        put_amf_bool(pb, audio_enc->channels == 2);
231 148c9bdb Allan Hsu
232
        put_amf_string(pb, "audiocodecid");
233 5366f15d Baptiste Coudurier
        put_amf_double(pb, audio_enc->codec_tag);
234 fd0fb306 Michael Niedermayer
    }
235
236 634b8cfa Baptiste Coudurier
    put_amf_string(pb, "filesize");
237
    flv->filesize_offset= url_ftell(pb);
238
    put_amf_double(pb, 0); // delayed write
239 fd0fb306 Michael Niedermayer
240
    put_amf_string(pb, "");
241 6cac3a3b Allan Hsu
    put_byte(pb, AMF_END_OF_OBJECT);
242 fd0fb306 Michael Niedermayer
243
    /* write total size of tag */
244
    data_size= url_ftell(pb) - metadata_size_pos - 10;
245
    url_fseek(pb, metadata_size_pos, SEEK_SET);
246
    put_be24(pb, data_size);
247
    url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
248
    put_be32(pb, data_size + 11);
249
250 f23496b5 Baptiste Coudurier
    for (i = 0; i < s->nb_streams; i++) {
251
        AVCodecContext *enc = s->streams[i]->codec;
252
        if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) {
253
            offset_t pos;
254
            put_byte(pb, enc->codec_type == CODEC_TYPE_VIDEO ?
255
                     FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
256
            put_be24(pb, 0); // size patched later
257
            put_be24(pb, 0); // ts
258
            put_byte(pb, 0); // ts ext
259
            put_be24(pb, 0); // streamid
260
            pos = url_ftell(pb);
261
            if (enc->codec_id == CODEC_ID_AAC) {
262
                put_byte(pb, get_audio_flags(enc));
263
                put_byte(pb, 0); // AAC sequence header
264
                put_buffer(pb, enc->extradata, enc->extradata_size);
265
            } else {
266
                put_byte(pb, enc->codec_tag | FLV_FRAME_KEY); // flags
267
                put_byte(pb, 0); // AVC sequence header
268
                put_be24(pb, 0); // composition time
269
                ff_isom_write_avcc(pb, enc->extradata, enc->extradata_size);
270
            }
271
            data_size = url_ftell(pb) - pos;
272
            url_fseek(pb, -data_size - 10, SEEK_CUR);
273
            put_be24(pb, data_size);
274
            url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
275
            put_be32(pb, data_size + 11); // previous tag size
276
        }
277
    }
278
279 d4f5d74a Garrick Meeker
    return 0;
280
}
281
282
static int flv_write_trailer(AVFormatContext *s)
283
{
284 14b32253 Michael Niedermayer
    int64_t file_size;
285
286 899681cd Björn Axelsson
    ByteIOContext *pb = s->pb;
287 d4f5d74a Garrick Meeker
    FLVContext *flv = s->priv_data;
288
289 14b32253 Michael Niedermayer
    file_size = url_ftell(pb);
290 634b8cfa Baptiste Coudurier
291
    /* update informations */
292
    url_fseek(pb, flv->duration_offset, SEEK_SET);
293
    put_amf_double(pb, flv->duration / (double)1000);
294
    url_fseek(pb, flv->filesize_offset, SEEK_SET);
295
    put_amf_double(pb, file_size);
296
297 d4f5d74a Garrick Meeker
    url_fseek(pb, file_size, SEEK_SET);
298
    return 0;
299
}
300
301 e928649b Michael Niedermayer
static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
302 d4f5d74a Garrick Meeker
{
303 899681cd Björn Axelsson
    ByteIOContext *pb = s->pb;
304 01f4895c Michael Niedermayer
    AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
305 d4f5d74a Garrick Meeker
    FLVContext *flv = s->priv_data;
306 f23496b5 Baptiste Coudurier
    unsigned ts;
307 e928649b Michael Niedermayer
    int size= pkt->size;
308 f683dbdc Michael Niedermayer
    int flags, flags_size;
309 d4f5d74a Garrick Meeker
310 949b1a13 Steve L'Homme
//    av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", enc->codec_type, timestamp, size);
311 115329f1 Diego Biurrun
312 f23496b5 Baptiste Coudurier
    if(enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F ||
313
       enc->codec_id == CODEC_ID_AAC)
314 f683dbdc Michael Niedermayer
        flags_size= 2;
315 f23496b5 Baptiste Coudurier
    else if(enc->codec_id == CODEC_ID_H264)
316
        flags_size= 5;
317 f683dbdc Michael Niedermayer
    else
318
        flags_size= 1;
319
320 d4f5d74a Garrick Meeker
    if (enc->codec_type == CODEC_TYPE_VIDEO) {
321 6cac3a3b Allan Hsu
        put_byte(pb, FLV_TAG_TYPE_VIDEO);
322 09d8c0ae Benjamin Larsson
323 bb85077f Michael Niedermayer
        flags = enc->codec_tag;
324 09d8c0ae Benjamin Larsson
        if(flags == 0) {
325
            av_log(enc, AV_LOG_ERROR, "video codec %X not compatible with flv\n",enc->codec_id);
326
            return -1;
327
        }
328
329 6cac3a3b Allan Hsu
        flags |= pkt->flags & PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER;
330 75293f05 Michael Niedermayer
    } else {
331
        assert(enc->codec_type == CODEC_TYPE_AUDIO);
332 37cdf93d Michael Niedermayer
        flags = get_audio_flags(enc);
333 115329f1 Diego Biurrun
334 068f2a22 Michael Niedermayer
        assert(size);
335
336 6cac3a3b Allan Hsu
        put_byte(pb, FLV_TAG_TYPE_AUDIO);
337 75293f05 Michael Niedermayer
    }
338
339 c2acba13 Baptiste Coudurier
    if (enc->codec_id == CODEC_ID_H264 &&
340
        /* check if extradata looks like mp4 formated */
341
        enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
342 f23496b5 Baptiste Coudurier
        if (ff_avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size) < 0)
343
            return -1;
344
        assert(pkt->size);
345
        size = pkt->size;
346
        /* cast needed to get negative value */
347 6f4eb12d Baptiste Coudurier
        if (!flv->delay && pkt->dts < 0)
348
            flv->delay = -pkt->dts;
349 f23496b5 Baptiste Coudurier
    }
350
351
    ts = pkt->dts + flv->delay; // add delay to force positive dts
352 f683dbdc Michael Niedermayer
    put_be24(pb,size + flags_size);
353 f23496b5 Baptiste Coudurier
    put_be24(pb,ts);
354 b83a00b8 Baptiste Coudurier
    put_byte(pb,(ts >> 24) & 0x7F); // timestamps are 32bits _signed_
355 018b6fb4 Alex Beregszaszi
    put_be24(pb,flv->reserved);
356 75293f05 Michael Niedermayer
    put_byte(pb,flags);
357 09d8c0ae Benjamin Larsson
    if (enc->codec_id == CODEC_ID_VP6)
358
        put_byte(pb,0);
359
    if (enc->codec_id == CODEC_ID_VP6F)
360
        put_byte(pb, enc->extradata_size ? enc->extradata[0] : 0);
361 f23496b5 Baptiste Coudurier
    else if (enc->codec_id == CODEC_ID_AAC)
362
        put_byte(pb,1); // AAC raw
363
    else if (enc->codec_id == CODEC_ID_H264) {
364
        put_byte(pb,1); // AVC NALU
365 6f4eb12d Baptiste Coudurier
        put_be24(pb,pkt->pts - pkt->dts);
366 f23496b5 Baptiste Coudurier
    }
367 75293f05 Michael Niedermayer
    put_buffer(pb, pkt->data, size);
368 f683dbdc Michael Niedermayer
    put_be32(pb,size+flags_size+11); // previous tag size
369 f23496b5 Baptiste Coudurier
    flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration);
370 115329f1 Diego Biurrun
371 d4f5d74a Garrick Meeker
    put_flush_packet(pb);
372
    return 0;
373
}
374
375 ff70e601 Måns Rullgård
AVOutputFormat flv_muxer = {
376 d4f5d74a Garrick Meeker
    "flv",
377 bde15e74 Stefano Sabatini
    NULL_IF_CONFIG_SMALL("FLV format"),
378 e817a73d Michael Niedermayer
    "video/x-flv",
379 d4f5d74a Garrick Meeker
    "flv",
380
    sizeof(FLVContext),
381 6ebe07fb Diego Biurrun
#ifdef CONFIG_LIBMP3LAME
382 80783dc2 Fabrice Bellard
    CODEC_ID_MP3,
383 6ebe07fb Diego Biurrun
#else // CONFIG_LIBMP3LAME
384 964ff354 Alex Beregszaszi
    CODEC_ID_ADPCM_SWF,
385 6ebe07fb Diego Biurrun
#endif // CONFIG_LIBMP3LAME
386 d4f5d74a Garrick Meeker
    CODEC_ID_FLV1,
387
    flv_write_header,
388
    flv_write_packet,
389
    flv_write_trailer,
390 c1854592 Reimar Döffinger
    .codec_tag= (const AVCodecTag* const []){flv_video_codec_ids, flv_audio_codec_ids, 0},
391 f23496b5 Baptiste Coudurier
    .flags= AVFMT_GLOBALHEADER,
392 d4f5d74a Garrick Meeker
};