FFmpeg
Loading...
Searching...
No Matches
flacenc.c
Go to the documentation of this file.
1/*
2 * raw FLAC muxer
3 * Copyright (c) 2006-2009 Justin Ruggles
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
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
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include "libavutil/avstring.h"
24#include "libavutil/opt.h"
25#include "libavutil/pixdesc.h"
26#include "libavcodec/flac.h"
27#include "packet_internal.h"
28#include "avformat.h"
29#include "avio_internal.h"
30#include "flacenc.h"
31#include "id3v2.h"
32#include "internal.h"
33#include "mux.h"
34#include "version.h"
35#include "vorbiscomment.h"
36
37
38typedef struct FlacMuxerContext {
39 const AVClass *class;
41
44 /* audio packets are queued here until we get all the attached pictures */
46
47 /* updated streaminfo sent by the encoder at the end */
50
53
54static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes,
55 int last_block)
56{
57 avio_w8(pb, last_block ? 0x81 : 0x01);
58 avio_wb24(pb, n_padding_bytes);
59 ffio_fill(pb, 0, n_padding_bytes);
60 return 0;
61}
62
64 int last_block, int bitexact)
65{
66 const char *vendor = bitexact ? "ffmpeg" : LIBAVFORMAT_IDENT;
67 int len;
68
70
71 len = ff_vorbiscomment_length(*m, vendor, NULL, 0);
72 if (len < 0)
73 return len;
74 if (len >= ((1<<24) - 4))
75 return AVERROR(EINVAL);
76
77 avio_w8(pb, last_block ? 0x84 : 0x04);
78 avio_wb24(pb, len);
79 ff_vorbiscomment_write(pb, *m, vendor, NULL, 0);
80
81 return 0;
82}
83
85{
86 FlacMuxerContext *c = s->priv_data;
87 AVIOContext *pb = s->pb;
88 const AVPixFmtDescriptor *pixdesc;
89 const CodecMime *mime = ff_id3v2_mime_tags;
91 const char *mimetype = NULL, *desc = "";
92 const AVStream *st = s->streams[pkt->stream_index];
93 int i, mimelen, desclen, type = 0, blocklen;
94
95 if (!pkt->data)
96 return 0;
97
98 while (mime->id != AV_CODEC_ID_NONE) {
99 if (mime->id == st->codecpar->codec_id) {
100 mimetype = mime->str;
101 break;
102 }
103 mime++;
104 }
105 if (!mimetype) {
106 av_log(s, AV_LOG_ERROR, "No mimetype is known for stream %d, cannot "
107 "write an attached picture.\n", st->index);
108 return AVERROR(EINVAL);
109 }
110 mimelen = strlen(mimetype);
111
112 /* get the picture type */
113 e = av_dict_get(st->metadata, "comment", NULL, 0);
114 for (i = 0; e && i < FF_ARRAY_ELEMS(ff_id3v2_picture_types); i++) {
116 type = i;
117 break;
118 }
119 }
120
121 if ((c->attached_types & (1 << type)) & 0x6) {
122 av_log(s, AV_LOG_ERROR, "Duplicate attachment for type '%s'\n", ff_id3v2_picture_types[type]);
123 return AVERROR(EINVAL);
124 }
125
126 if (type == 1 && (st->codecpar->codec_id != AV_CODEC_ID_PNG ||
127 st->codecpar->width != 32 ||
128 st->codecpar->height != 32)) {
129 av_log(s, AV_LOG_ERROR, "File icon attachment must be a 32x32 PNG");
130 return AVERROR(EINVAL);
131 }
132
133 c->attached_types |= (1 << type);
134
135 /* get the description */
136 if ((e = av_dict_get(st->metadata, "title", NULL, 0)))
137 desc = e->value;
138 desclen = strlen(desc);
139
140 blocklen = 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 + pkt->size;
141 if (blocklen >= 1<<24) {
142 av_log(s, AV_LOG_ERROR, "Picture block too big %d >= %d\n", blocklen, 1<<24);
143 return AVERROR(EINVAL);
144 }
145
146 avio_w8(pb, 0x06);
147 avio_wb24(pb, blocklen);
148
149 avio_wb32(pb, type);
150
151 avio_wb32(pb, mimelen);
152 avio_write(pb, mimetype, mimelen);
153
154 avio_wb32(pb, desclen);
155 avio_write(pb, desc, desclen);
156
157 avio_wb32(pb, st->codecpar->width);
158 avio_wb32(pb, st->codecpar->height);
159 if ((pixdesc = av_pix_fmt_desc_get(st->codecpar->format)))
160 avio_wb32(pb, av_get_bits_per_pixel(pixdesc));
161 else
162 avio_wb32(pb, 0);
163 avio_wb32(pb, 0);
164
165 avio_wb32(pb, pkt->size);
166 avio_write(pb, pkt->data, pkt->size);
167 return 0;
168}
169
171{
172 int i, ret, padding = s->metadata_header_padding;
173 if (padding < 0)
174 padding = 8192;
175 /* The FLAC specification states that 24 bits are used to represent the
176 * size of a metadata block so we must clip this value to 2^24-1. */
177 padding = av_clip_uintp2(padding, 24);
178
179 for (i = 0; i < s->nb_streams; i++) {
180 AVStream *st = s->streams[i];
181 AVPacket *pkt = st->priv_data;
182 if (!pkt)
183 continue;
184 ret = flac_write_picture(s, pkt);
186 if (ret < 0 && (s->error_recognition & AV_EF_EXPLODE))
187 return ret;
188 }
189
190 ret = flac_write_block_comment(s->pb, &s->metadata, !padding,
191 s->flags & AVFMT_FLAG_BITEXACT);
192 if (ret)
193 return ret;
194
195 /* The command line flac encoder defaults to placing a seekpoint
196 * every 10s. So one might add padding to allow that later
197 * but there seems to be no simple way to get the duration here.
198 * So just add the amount requested by the user. */
199 if (padding)
200 flac_write_block_padding(s->pb, padding, 1);
201
202 return 0;
203}
204
205static int flac_init(struct AVFormatContext *s)
206{
208 FlacMuxerContext *c = s->priv_data;
209 int i;
210
211 c->audio_stream_idx = -1;
212 for (i = 0; i < s->nb_streams; i++) {
213 AVStream *st = s->streams[i];
215 if (c->audio_stream_idx >= 0 || st->codecpar->codec_id != AV_CODEC_ID_FLAC) {
216 av_log(s, AV_LOG_ERROR, "Invalid audio stream. Exactly one FLAC "
217 "audio stream is required.\n");
218 return AVERROR(EINVAL);
219 }
220 par = s->streams[i]->codecpar;
221 c->audio_stream_idx = i;
222 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
224 av_log(s, AV_LOG_WARNING, "Video stream #%d is not an attached picture. Ignoring\n", i);
225 continue;
226 } else if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
227 av_log(s, AV_LOG_ERROR, "GIF image support is not implemented.\n");
229 } else if (!c->write_header) {
230 av_log(s, AV_LOG_ERROR, "Can't write attached pictures without a header.\n");
231 return AVERROR(EINVAL);
232 }
233 c->waiting_pics++;
234 } else {
235 av_log(s, AV_LOG_ERROR, "Only audio streams and pictures are allowed in FLAC.\n");
236 return AVERROR(EINVAL);
237 }
238 }
239 if (c->audio_stream_idx < 0) {
240 av_log(s, AV_LOG_ERROR, "No audio stream present.\n");
241 return AVERROR(EINVAL);
242 }
243
244 /* add the channel layout tag */
246 !(par->ch_layout.u.mask & ~0x3ffffULL) &&
248 AVDictionaryEntry *chmask = av_dict_get(s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK",
249 NULL, 0);
250
251 if (chmask) {
252 av_log(s, AV_LOG_WARNING, "A WAVEFORMATEXTENSIBLE_CHANNEL_MASK is "
253 "already present, this muxer will not overwrite it.\n");
254 } else {
255 uint8_t buf[32];
256 snprintf(buf, sizeof(buf), "0x%"PRIx64, par->ch_layout.u.mask);
257 av_dict_set(&s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
258 }
259 }
260
261 return 0;
262}
263
265{
266 FlacMuxerContext *c = s->priv_data;
267 AVCodecParameters *par = s->streams[c->audio_stream_idx]->codecpar;
268 int ret;
269
270 if (!c->write_header)
271 return 0;
272
273 ret = ff_flac_write_header(s->pb, par->extradata,
274 par->extradata_size, 0);
275 if (ret < 0)
276 return ret;
277
278 if (!c->waiting_pics)
279 ret = flac_finish_header(s);
280
281 return ret;
282}
283
285{
286 FlacMuxerContext *c = s->priv_data;
287 uint8_t *streaminfo;
288 size_t streaminfo_size;
289
290 /* check for updated streaminfo */
292 &streaminfo_size);
293 if (streaminfo && streaminfo_size == FLAC_STREAMINFO_SIZE) {
294 memcpy(c->streaminfo, streaminfo, FLAC_STREAMINFO_SIZE);
295 c->updated_streaminfo = 1;
296 }
297
298 if (pkt->size)
299 avio_write(s->pb, pkt->data, pkt->size);
300 return 0;
301}
302
304{
305 FlacMuxerContext *c = s->priv_data;
306 AVPacket *const pkt = ffformatcontext(s)->pkt;
307 int ret, write = 1;
308
309 ret = flac_finish_header(s);
310 if (ret < 0)
311 write = 0;
312
313 while (c->queue.head) {
314 ff_packet_list_get(&c->queue, pkt);
315 if (write && (ret = flac_write_audio_packet(s, pkt)) < 0)
316 write = 0;
318 }
319 return ret;
320}
321
323{
324 AVIOContext *pb = s->pb;
325 int64_t file_size;
326 FlacMuxerContext *c = s->priv_data;
327
328 if (c->waiting_pics) {
329 av_log(s, AV_LOG_WARNING, "No packets were sent for some of the "
330 "attached pictures.\n");
332 }
333
334 if (!c->write_header || !c->updated_streaminfo)
335 return 0;
336
337 if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
338 /* rewrite the STREAMINFO header block data */
339 file_size = avio_tell(pb);
340 avio_seek(pb, 8, SEEK_SET);
341 avio_write(pb, c->streaminfo, FLAC_STREAMINFO_SIZE);
342 avio_seek(pb, file_size, SEEK_SET);
343 } else {
344 av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
345 }
346
347 return 0;
348}
349
350static void flac_deinit(struct AVFormatContext *s)
351{
352 FlacMuxerContext *c = s->priv_data;
353
354 ff_packet_list_free(&c->queue);
355 for (unsigned i = 0; i < s->nb_streams; i++)
356 av_packet_free((AVPacket **)&s->streams[i]->priv_data);
357}
358
360{
361 FlacMuxerContext *c = s->priv_data;
362 int ret;
363
364 if (pkt->stream_index == c->audio_stream_idx) {
365 if (c->waiting_pics) {
366 /* buffer audio packets until we get all the pictures */
367 ret = ff_packet_list_put(&c->queue, pkt, NULL, 0);
368 if (ret < 0) {
369 av_log(s, AV_LOG_ERROR, "Out of memory in packet queue; skipping attached pictures\n");
370 c->waiting_pics = 0;
371 ret = flac_queue_flush(s);
372 if (ret < 0)
373 return ret;
375 }
376 } else
378 } else {
379 AVStream *st = s->streams[pkt->stream_index];
380
381 if (!c->waiting_pics ||
383 return 0;
384
385 /* warn only once for each stream */
386 if (st->nb_frames == 1) {
387 av_log(s, AV_LOG_WARNING, "Got more than one picture in stream %d,"
388 " ignoring.\n", pkt->stream_index);
389 }
390 if (st->nb_frames >= 1)
391 return 0;
392
394 if (!st->priv_data)
395 av_log(s, AV_LOG_ERROR, "Out of memory queueing an attached picture; skipping\n");
396 c->waiting_pics--;
397
398 /* flush the buffered audio packets */
399 if (!c->waiting_pics &&
400 (ret = flac_queue_flush(s)) < 0)
401 return ret;
402 }
403
404 return 0;
405}
406
407static const AVOption flacenc_options[] = {
408 { "write_header", "Write the file header", offsetof(FlacMuxerContext, write_header), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
409 { NULL },
410};
411
412static const AVClass flac_muxer_class = {
413 .class_name = "flac muxer",
414 .item_name = av_default_item_name,
415 .option = flacenc_options,
416 .version = LIBAVUTIL_VERSION_INT,
417};
418
420 .p.name = "flac",
421 .p.long_name = NULL_IF_CONFIG_SMALL("raw FLAC"),
422 .priv_data_size = sizeof(FlacMuxerContext),
423 .p.mime_type = "audio/x-flac",
424 .p.extensions = "flac",
425 .p.audio_codec = AV_CODEC_ID_FLAC,
426 .p.video_codec = AV_CODEC_ID_PNG,
427 .init = flac_init,
428 .write_header = flac_write_header,
429 .write_packet = flac_write_packet,
430 .write_trailer = flac_write_trailer,
431 .deinit = flac_deinit,
432 .p.flags = AVFMT_NOTIMESTAMPS,
433 .p.priv_class = &flac_muxer_class,
434};
const FFOutputFormat ff_flac_muxer
Definition flacenc.c:419
Main libavformat public API header.
#define AVFMT_FLAG_BITEXACT
When muxing, try to avoid writing any random/volatile data to the output.
Definition avformat.h:1501
#define AV_DISPOSITION_ATTACHED_PIC
The stream is stored in the file as an attached picture/"cover art" (e.g.
Definition avformat.h:692
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition avformat.h:498
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition aviobuf.c:236
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition avio.h:41
void avio_w8(AVIOContext *s, int b)
Definition aviobuf.c:184
void avio_wb32(AVIOContext *s, unsigned int val)
Definition aviobuf.c:368
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition avio.h:494
void avio_wb24(AVIOContext *s, unsigned int val)
Definition aviobuf.c:458
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition aviobuf.c:206
void ffio_fill(AVIOContext *s, int b, int64_t count)
Definition aviobuf.c:192
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
Public libavutil channel layout APIs header.
#define av_clip_uintp2
Definition common.h:124
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
#define AV_EF_EXPLODE
abort decoding on minor error detection
Definition defs.h:51
static AVPacket * pkt
static void write_header(FFV1Context *f)
Definition ffv1enc.c:384
FLAC (Free Lossless Audio Codec) common stuff.
#define FLAC_STREAMINFO_SIZE
Definition flac.h:32
int ff_flac_write_header(AVIOContext *pb, const uint8_t *extradata, int extradata_size, int last_block)
int ff_flac_is_native_layout(uint64_t channel_layout)
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition opt.h:351
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_CODEC_ID_PNG
Definition codec_id.h:111
@ AV_CODEC_ID_GIF
Definition codec_id.h:147
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
@ AV_CODEC_ID_FLAC
Definition codec_id.h:465
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Definition packet.h:56
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Definition packet.c:74
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition packet.c:434
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
Definition packet.c:478
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
Definition packet.c:252
@ AV_CHANNEL_ORDER_NATIVE
The native channel order, i.e.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
Definition dict.c:60
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition dict.c:86
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition error.h:64
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Definition avstring.c:208
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
cl_device_type type
const char *const ff_id3v2_picture_types[21]
Definition id3v2.c:114
const CodecMime ff_id3v2_mime_tags[]
Definition id3v2.c:138
static int flac_init(struct AVFormatContext *s)
Definition flacenc.c:205
static int flac_write_audio_packet(struct AVFormatContext *s, AVPacket *pkt)
Definition flacenc.c:284
static int flac_finish_header(struct AVFormatContext *s)
Definition flacenc.c:170
static const AVOption flacenc_options[]
Definition flacenc.c:407
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
Definition flacenc.c:359
static void flac_deinit(struct AVFormatContext *s)
Definition flacenc.c:350
static int flac_write_picture(struct AVFormatContext *s, AVPacket *pkt)
Definition flacenc.c:84
static int flac_write_block_padding(AVIOContext *pb, unsigned int n_padding_bytes, int last_block)
Definition flacenc.c:54
static int flac_queue_flush(AVFormatContext *s)
Definition flacenc.c:303
static int flac_write_block_comment(AVIOContext *pb, AVDictionary **m, int last_block, int bitexact)
Definition flacenc.c:63
static int flac_write_trailer(struct AVFormatContext *s)
Definition flacenc.c:322
static const AVClass flac_muxer_class
Definition flacenc.c:412
static int flac_write_header(struct AVFormatContext *s)
Definition flacenc.c:264
static av_always_inline FFFormatContext * ffformatcontext(AVFormatContext *s)
Definition internal.h:130
int ff_packet_list_get(PacketList *list, AVPacket *pkt)
Remove the oldest AVPacket in the list and return it.
Definition packet_list.c:89
void ff_packet_list_free(PacketList *list)
Wipe the list and unref all the packets in it.
int ff_packet_list_put(PacketList *list, AVPacket *pkt, int(*copy)(AVPacket *dst, const AVPacket *src), int flags)
Append an AVPacket to the list.
Definition packet_list.c:40
Libavformat version macros.
#define LIBAVFORMAT_IDENT
Definition version.h:45
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
const char * desc
Definition libsvtav1.c:83
void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv)
Definition metadata.c:26
AVOptions.
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
Definition pixdesc.c:3412
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
#define FF_ARRAY_ELEMS(a)
#define snprintf
Definition snprintf.h:34
enum AVChannelOrder order
Channel order used in this layout.
uint64_t mask
This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used for AV_CHANNEL_ORDER_AMBISONIC ...
union AVChannelLayout::@162063043056170047076125117143030261346263330336 u
Details about which channels are present in this layout.
Describe the class of an AVClass context structure.
Definition log.h:76
This struct describes the properties of an encoded stream.
Definition codec_par.h:49
int extradata_size
Size of the extradata content in bytes.
Definition codec_par.h:75
int height
The height of the video frame in pixels.
Definition codec_par.h:150
AVChannelLayout ch_layout
The channel layout and number of channels.
Definition codec_par.h:207
int width
The width of the video frame in pixels.
Definition codec_par.h:143
enum AVMediaType codec_type
General type of the encoded data.
Definition codec_par.h:53
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition codec_par.h:71
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition codec_par.h:57
char * value
Definition dict.h:92
Format I/O context.
Definition avformat.h:1333
Bytestream IO Context.
Definition avio.h:160
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition avio.h:261
AVOption.
Definition opt.h:428
This structure stores compressed data.
Definition packet.h:580
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
Stream structure.
Definition avformat.h:766
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition avformat.h:789
int64_t nb_frames
number of frames in this stream if known or 0
Definition avformat.h:827
AVDictionary * metadata
Definition avformat.h:846
void * priv_data
Definition avformat.h:791
int index
stream index in AVFormatContext
Definition avformat.h:772
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
Definition avformat.h:835
char str[32]
Definition internal.h:48
enum AVCodecID id
Definition internal.h:49
AVPacket * pkt
Used to hold temporary packets for the generic demuxing code.
Definition internal.h:111
PacketList queue
Definition flacenc.c:45
int updated_streaminfo
Definition flacenc.c:49
uint8_t streaminfo[FLAC_STREAMINFO_SIZE]
Definition flacenc.c:48
unsigned attached_types
Definition flacenc.c:51
int audio_stream_idx
Definition flacenc.c:42
#define av_log(a,...)
int len
int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *dict, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters)
Write a VorbisComment into an AVIOContext.
int ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string, AVChapter **chapters, unsigned int nb_chapters)
Calculate the length in bytes of a VorbisComment.
const AVMetadataConv ff_vorbiscomment_metadata_conv[]
VorbisComment metadata conversion mapping.
static double c[64]