FFmpeg
Loading...
Searching...
No Matches
isom.c
Go to the documentation of this file.
1/*
2 * ISO Media common code
3 * Copyright (c) 2001 Fabrice Bellard
4 * Copyright (c) 2002 Francois Revol <revol@free.fr>
5 * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@free.fr>
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include "avformat.h"
25#include "demux.h"
26#include "internal.h"
27#include "isom.h"
31
32/* http://www.mp4ra.org */
33/* ordered by muxing preference */
35 { AV_CODEC_ID_MOV_TEXT , 0x08 },
36 { AV_CODEC_ID_MPEG4 , 0x20 },
37 { AV_CODEC_ID_H264 , 0x21 },
38 { AV_CODEC_ID_HEVC , 0x23 },
39 { AV_CODEC_ID_VVC , 0x33 },
40 { AV_CODEC_ID_AAC , 0x40 },
41 { AV_CODEC_ID_MP4ALS , 0x40 }, /* 14496-3 ALS */
42 { AV_CODEC_ID_MPEG2VIDEO , 0x61 }, /* MPEG-2 Main */
43 { AV_CODEC_ID_MPEG2VIDEO , 0x60 }, /* MPEG-2 Simple */
44 { AV_CODEC_ID_MPEG2VIDEO , 0x62 }, /* MPEG-2 SNR */
45 { AV_CODEC_ID_MPEG2VIDEO , 0x63 }, /* MPEG-2 Spatial */
46 { AV_CODEC_ID_MPEG2VIDEO , 0x64 }, /* MPEG-2 High */
47 { AV_CODEC_ID_MPEG2VIDEO , 0x65 }, /* MPEG-2 422 */
48 { AV_CODEC_ID_AAC , 0x66 }, /* MPEG-2 AAC Main */
49 { AV_CODEC_ID_AAC , 0x67 }, /* MPEG-2 AAC Low */
50 { AV_CODEC_ID_AAC , 0x68 }, /* MPEG-2 AAC SSR */
51 { AV_CODEC_ID_MP3 , 0x69 }, /* 13818-3 */
52 { AV_CODEC_ID_MP2 , 0x69 }, /* 11172-3 */
53 { AV_CODEC_ID_MPEG1VIDEO , 0x6A }, /* 11172-2 */
54 { AV_CODEC_ID_MP3 , 0x6B }, /* 11172-3 */
55 { AV_CODEC_ID_MJPEG , 0x6C }, /* 10918-1 */
56 { AV_CODEC_ID_PNG , 0x6D },
57 { AV_CODEC_ID_JPEG2000 , 0x6E }, /* 15444-1 */
58 { AV_CODEC_ID_VC1 , 0xA3 },
59 { AV_CODEC_ID_DIRAC , 0xA4 },
60 { AV_CODEC_ID_AC3 , 0xA5 },
61 { AV_CODEC_ID_EAC3 , 0xA6 },
62 { AV_CODEC_ID_DTS , 0xA9 }, /* mp4ra.org */
63 { AV_CODEC_ID_OPUS , 0xAD }, /* mp4ra.org */
64 { AV_CODEC_ID_VP9 , 0xB1 }, /* mp4ra.org */
65 { AV_CODEC_ID_TSCC2 , 0xD0 }, /* nonstandard, camtasia uses it */
66 { AV_CODEC_ID_EVRC , 0xD1 }, /* nonstandard, pvAuthor uses it */
67 { AV_CODEC_ID_VORBIS , 0xDD }, /* nonstandard, gpac uses it */
68 { AV_CODEC_ID_DVD_SUBTITLE, 0xE0 }, /* nonstandard, see unsupported-embedded-subs-2.mp4 */
69 { AV_CODEC_ID_QCELP , 0xE1 },
72 { AV_CODEC_ID_NONE , 0 },
73};
74
76 { AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'e', 'x', 't') },
77 { AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'x', '3', 'g') },
78 { AV_CODEC_ID_EIA_608, MKTAG('c', '6', '0', '8') },
79 { AV_CODEC_ID_NONE, 0 },
80};
81
83 { AV_CODEC_ID_BIN_DATA, MKTAG('g', 'p', 'm', 'd') },
84 { AV_CODEC_ID_ITUT_T35, MKTAG('i', 't', '3', '5') },
85 { AV_CODEC_ID_NONE, 0 },
86};
87
88/* map numeric codes from mdhd atom to ISO 639 */
89/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
90/* http://developer.apple.com/documentation/mac/Text/Text-368.html */
91/* deprecated by putting the code as 3*5 bits ASCII */
92static const char mov_mdhd_language_map[][4] = {
93 "eng", /* 0 English */
94 "fra", /* 1 French */
95 "ger", /* 2 German */
96 "ita", /* 3 Italian */
97 "dut", /* 4 Dutch */
98 "sve", /* 5 Swedish */
99 "spa", /* 6 Spanish */
100 "dan", /* 7 Danish */
101 "por", /* 8 Portuguese */
102 "nor", /* 9 Norwegian */
103 "heb", /* 10 Hebrew */
104 "jpn", /* 11 Japanese */
105 "ara", /* 12 Arabic */
106 "fin", /* 13 Finnish */
107 "gre", /* 14 Greek */
108 "ice", /* 15 Icelandic */
109 "mlt", /* 16 Maltese */
110 "tur", /* 17 Turkish */
111 "hr ", /* 18 Croatian */
112 "chi", /* 19 Traditional Chinese */
113 "urd", /* 20 Urdu */
114 "hin", /* 21 Hindi */
115 "tha", /* 22 Thai */
116 "kor", /* 23 Korean */
117 "lit", /* 24 Lithuanian */
118 "pol", /* 25 Polish */
119 "hun", /* 26 Hungarian */
120 "est", /* 27 Estonian */
121 "lav", /* 28 Latvian */
122 "smi", /* 29 Sami */
123 "fo ", /* 30 Faroese */
124 "per", /* 31 Farsi */
125 "rus", /* 32 Russian */
126 "chi", /* 33 Simplified Chinese */
127 "", /* 34 Flemish */
128 "iri", /* 35 Irish */
129 "alb", /* 36 Albanian */
130 "ron", /* 37 Romanian */
131 "ces", /* 38 Czech */
132 "slk", /* 39 Slovak */
133 "slv", /* 40 Slovenian */
134 "yid", /* 41 Yiddish */
135 "sr ", /* 42 Serbian */
136 "mac", /* 43 Macedonian */
137 "bul", /* 44 Bulgarian */
138 "ukr", /* 45 Ukrainian */
139 "bel", /* 46 Belarusian */
140 "uzb", /* 47 Uzbek */
141 "kaz", /* 48 Kazakh */
142 "aze", /* 49 Azerbaijani */
143 "aze", /* 50 AzerbaijanAr */
144 "arm", /* 51 Armenian */
145 "geo", /* 52 Georgian */
146 "mol", /* 53 Moldavian */
147 "kir", /* 54 Kirghiz */
148 "tgk", /* 55 Tajiki */
149 "tuk", /* 56 Turkmen */
150 "mon", /* 57 Mongolian */
151 "", /* 58 MongolianCyr */
152 "pus", /* 59 Pashto */
153 "kur", /* 60 Kurdish */
154 "kas", /* 61 Kashmiri */
155 "snd", /* 62 Sindhi */
156 "tib", /* 63 Tibetan */
157 "nep", /* 64 Nepali */
158 "san", /* 65 Sanskrit */
159 "mar", /* 66 Marathi */
160 "ben", /* 67 Bengali */
161 "asm", /* 68 Assamese */
162 "guj", /* 69 Gujarati */
163 "pa ", /* 70 Punjabi */
164 "ori", /* 71 Oriya */
165 "mal", /* 72 Malayalam */
166 "kan", /* 73 Kannada */
167 "tam", /* 74 Tamil */
168 "tel", /* 75 Telugu */
169 "sin", /* 76 Sinhala */
170 "bur", /* 77 Burmese */
171 "khm", /* 78 Khmer */
172 "lao", /* 79 Lao */
173 "vie", /* 80 Vietnamese */
174 "ind", /* 81 Indonesian */
175 "tgl", /* 82 Tagalog */
176 "may", /* 83 MalayRoman */
177 "may", /* 84 MalayArabic */
178 "amh", /* 85 Amharic */
179 "tir", /* 86 Galla */
180 "orm", /* 87 Oromo */
181 "som", /* 88 Somali */
182 "swa", /* 89 Swahili */
183 "kin", /* 90 Kinyarwanda */
184 "run", /* 91 Rundi */
185 "nya", /* 92 Nyanja */
186 "mlg", /* 93 Malagasy */
187 "epo", /* 94 Esperanto */
188 "", /* 95 */
189 "", /* 96 */
190 "", /* 97 */
191 "", /* 98 */
192 "", /* 99 */
193 "", /* 100 */
194 "", /* 101 */
195 "", /* 102 */
196 "", /* 103 */
197 "", /* 104 */
198 "", /* 105 */
199 "", /* 106 */
200 "", /* 107 */
201 "", /* 108 */
202 "", /* 109 */
203 "", /* 110 */
204 "", /* 111 */
205 "", /* 112 */
206 "", /* 113 */
207 "", /* 114 */
208 "", /* 115 */
209 "", /* 116 */
210 "", /* 117 */
211 "", /* 118 */
212 "", /* 119 */
213 "", /* 120 */
214 "", /* 121 */
215 "", /* 122 */
216 "", /* 123 */
217 "", /* 124 */
218 "", /* 125 */
219 "", /* 126 */
220 "", /* 127 */
221 "wel", /* 128 Welsh */
222 "baq", /* 129 Basque */
223 "cat", /* 130 Catalan */
224 "lat", /* 131 Latin */
225 "que", /* 132 Quechua */
226 "grn", /* 133 Guarani */
227 "aym", /* 134 Aymara */
228 "tat", /* 135 Tatar */
229 "uig", /* 136 Uighur */
230 "dzo", /* 137 Dzongkha */
231 "jav", /* 138 JavaneseRom */
232};
233
234int ff_mov_iso639_to_lang(const char lang[4], int mp4)
235{
236 int i, code = 0;
237
238 /* old way, only for QT? */
239 for (i = 0; lang[0] && !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
240 if (!strcmp(lang, mov_mdhd_language_map[i]))
241 return i;
242 }
243 /* XXX:can we do that in mov too? */
244 if (!mp4)
245 return -1;
246 /* handle undefined as such */
247 if (lang[0] == '\0')
248 lang = "und";
249 /* 5 bits ASCII */
250 for (i = 0; i < 3; i++) {
251 uint8_t c = lang[i];
252 c -= 0x60;
253 if (c > 0x1f)
254 return -1;
255 code <<= 5;
256 code |= c;
257 }
258 return code;
259}
260
261int ff_mov_lang_to_iso639(unsigned code, char to[4])
262{
263 int i;
264 memset(to, 0, 4);
265 /* is it the mangled iso code? */
266 /* see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt */
267 if (code >= 0x400 && code != 0x7fff) {
268 for (i = 2; i >= 0; i--) {
269 to[i] = 0x60 + (code & 0x1f);
270 code >>= 5;
271 }
272 return 1;
273 }
274 /* old fashion apple lang code */
276 return 0;
278 return 0;
279 memcpy(to, mov_mdhd_language_map[code], 4);
280 return 1;
281}
282
284{
285 int len = 0;
286 int count = 4;
287 while (count--) {
288 int c = avio_r8(pb);
289 len = (len << 7) | (c & 0x7f);
290 if (!(c & 0x80))
291 break;
292 }
293 return len;
294}
295
296int ff_mp4_read_descr(void *logctx, AVIOContext *pb, int *tag)
297{
298 int len;
299 *tag = avio_r8(pb);
301 av_log(logctx, AV_LOG_TRACE, "MPEG-4 description: tag=0x%02x len=%d\n", *tag, len);
302 return len;
303}
304
306{
307 int flags;
308 if (es_id) *es_id = avio_rb16(pb);
309 else avio_rb16(pb);
310 flags = avio_r8(pb);
311 if (flags & 0x80) //streamDependenceFlag
312 avio_rb16(pb);
313 if (flags & 0x40) { //URL_Flag
314 int len = avio_r8(pb);
315 avio_skip(pb, len);
316 }
317 if (flags & 0x20) //OCRstreamFlag
318 avio_rb16(pb);
319}
320
321static const AVCodecTag mp4_audio_types[] = {
322 { AV_CODEC_ID_MP3ON4, AOT_PS }, /* old mp3on4 draft */
323 { AV_CODEC_ID_MP3ON4, AOT_L1 }, /* layer 1 */
324 { AV_CODEC_ID_MP3ON4, AOT_L2 }, /* layer 2 */
325 { AV_CODEC_ID_MP3ON4, AOT_L3 }, /* layer 3 */
326 { AV_CODEC_ID_MP4ALS, AOT_ALS }, /* MPEG-4 ALS */
328};
329
331{
332 enum AVCodecID codec_id;
333 int len, tag;
334 int ret;
335 int object_type_id = avio_r8(pb);
336 avio_r8(pb); /* stream type */
337 avio_rb24(pb); /* buffer size db */
338 avio_rb32(pb); /* rc_max_rate */
339
340 st->codecpar->bit_rate = avio_rb32(pb); /* avg bitrate */
341
342 codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
343 if (codec_id)
345 av_log(logctx, AV_LOG_TRACE, "esds object type id 0x%02x\n", object_type_id);
346 len = ff_mp4_read_descr(logctx, pb, &tag);
348 av_log(logctx, AV_LOG_TRACE, "Specific MPEG-4 header len=%d\n", len);
349 /* As per 14496-3:2009 9.D.2.2, No decSpecificInfo is defined
350 for MPEG-1 Audio or MPEG-2 Audio; MPEG-2 AAC excluded. */
351 if (object_type_id == 0x69 || object_type_id == 0x6b)
352 return 0;
353 if (!len || (uint64_t)len > (1<<30))
354 return AVERROR_INVALIDDATA;
355 if ((ret = ff_get_extradata(logctx, st->codecpar, pb, len)) < 0)
356 return ret;
357 if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
358 MPEG4AudioConfig cfg = {0};
360 st->codecpar->extradata_size, 1, logctx);
361 if (ret < 0)
362 return ret;
363 if (cfg.channels != st->codecpar->ch_layout.nb_channels) {
366 st->codecpar->ch_layout.nb_channels = cfg.channels;
367 }
368 if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
369 st->codecpar->sample_rate = ff_mpa_freq_tab[cfg.sampling_index];
370 else if (cfg.ext_sample_rate)
371 st->codecpar->sample_rate = cfg.ext_sample_rate;
372 else
373 st->codecpar->sample_rate = cfg.sample_rate;
374 switch (cfg.object_type) {
375 case AOT_AAC_MAIN:
376 case AOT_AAC_LC:
377 case AOT_AAC_SSR:
378 case AOT_AAC_LTP:
379 case AOT_ER_AAC_LC:
380 case AOT_ER_AAC_LD:
381 case AOT_ER_AAC_ELD:
382 case AOT_USAC:
383 st->codecpar->frame_size = cfg.frame_length;
384 break;
385 }
386 av_log(logctx, AV_LOG_TRACE, "mp4a config channels %d obj %d ext obj %d "
387 "sample rate %d ext sample rate %d frame_length %d\n", cfg.channels,
388 cfg.object_type, cfg.ext_object_type,
389 cfg.sample_rate, cfg.ext_sample_rate,
390 cfg.frame_length);
392 cfg.object_type)))
394 }
395 }
396 return 0;
397}
398
403
405 { AV_CH_LAYOUT_MONO, (100<<16) | 1}, // kCAFChannelLayoutTag_Mono
406 { AV_CH_LAYOUT_STEREO, (101<<16) | 2}, // kCAFChannelLayoutTag_Stereo
407 { AV_CH_LAYOUT_STEREO, (102<<16) | 2}, // kCAFChannelLayoutTag_StereoHeadphones
408 { AV_CH_LAYOUT_2_1, (131<<16) | 3}, // kCAFChannelLayoutTag_ITU_2_1
409 { AV_CH_LAYOUT_QUAD, (132<<16) | 4}, // kCAFChannelLayoutTag_ITU_2_2
410 { AV_CH_LAYOUT_2_2, (132<<16) | 4}, // kCAFChannelLayoutTag_ITU_2_2
411 { AV_CH_LAYOUT_QUAD, (108<<16) | 4}, // kCAFChannelLayoutTag_Quadraphonic
412 { AV_CH_LAYOUT_SURROUND, (113<<16) | 3}, // kCAFChannelLayoutTag_MPEG_3_0_A
413 { AV_CH_LAYOUT_4POINT0, (115<<16) | 4}, // kCAFChannelLayoutTag_MPEG_4_0_A
414 { AV_CH_LAYOUT_5POINT0_BACK, (117<<16) | 5}, // kCAFChannelLayoutTag_MPEG_5_0_A
415 { AV_CH_LAYOUT_5POINT0, (117<<16) | 5}, // kCAFChannelLayoutTag_MPEG_5_0_A
416 { AV_CH_LAYOUT_5POINT1_BACK, (121<<16) | 6}, // kCAFChannelLayoutTag_MPEG_5_1_A
417 { AV_CH_LAYOUT_5POINT1, (121<<16) | 6}, // kCAFChannelLayoutTag_MPEG_5_1_A
418 { AV_CH_LAYOUT_7POINT1, (128<<16) | 8}, // kCAFChannelLayoutTag_MPEG_7_1_C
419 { AV_CH_LAYOUT_7POINT1_WIDE, (126<<16) | 8}, // kCAFChannelLayoutTag_MPEG_7_1_A
420 { AV_CH_LAYOUT_5POINT1_BACK|AV_CH_LAYOUT_STEREO_DOWNMIX, (130<<16) | 8}, // kCAFChannelLayoutTag_SMPTE_DTV
421 { AV_CH_LAYOUT_2POINT1, (133<<16) | 3}, // kCAFChannelLayoutTag_DVD_4
422 { AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY, (134<<16) | 4}, // kCAFChannelLayoutTag_DVD_5
423 { AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY, (135<<16) | 4}, // kCAFChannelLayoutTag_DVD_6
424 { AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY, (135<<16) | 4}, // kCAFChannelLayoutTag_DVD_6
425 { AV_CH_LAYOUT_3POINT1, (136<<16) | 4}, // kCAFChannelLayoutTag_DVD_10
426 { AV_CH_LAYOUT_4POINT1, (137<<16) | 5}, // kCAFChannelLayoutTag_DVD_11
427 { 0, 0},
428};
429
430void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
431{
433 uint32_t layout_tag = 0;
434
435 for (layouts = mov_channel_layout; layouts->channel_layout; layouts++)
436 if (channel_layout == layouts->channel_layout) {
437 layout_tag = layouts->layout_tag;
438 break;
439 }
440
441 if (layout_tag) {
442 avio_wb32(pb, layout_tag); // mChannelLayoutTag
443 avio_wb32(pb, 0); // mChannelBitmap
444 } else {
445 avio_wb32(pb, 0x10000); // kCAFChannelLayoutTag_UseChannelBitmap
446 avio_wb32(pb, channel_layout);
447 }
448 avio_wb32(pb, 0); // mNumberChannelDescriptions
449}
450
453 "caption" },
455 "commentary" },
457 "description" },
459 "dub" },
461 "forced-subtitle" },
462 { 0, NULL }
463};
464
466 { "urn:mpeg:dash:role:2011", dash_role_map },
467 { 0, NULL }
468};
Main libavformat public API header.
#define AV_DISPOSITION_HEARING_IMPAIRED
The stream is intended for hearing impaired audiences.
Definition avformat.h:676
#define AV_DISPOSITION_COMMENT
The stream is a commentary track.
Definition avformat.h:657
#define AV_DISPOSITION_CAPTIONS
The subtitle stream contains captions, providing a transcription and possibly a translation of audio.
Definition avformat.h:710
#define AV_DISPOSITION_DUB
The stream is not in original language.
Definition avformat.h:647
#define AV_DISPOSITION_FORCED
Track should be used during playback by default.
Definition avformat.h:672
#define AV_DISPOSITION_VISUAL_IMPAIRED
The stream is intended for visually impaired audiences.
Definition avformat.h:680
#define AV_DISPOSITION_DESCRIPTIONS
The subtitle stream contains a textual description of the video content.
Definition avformat.h:716
void avio_wb32(AVIOContext *s, unsigned int val)
Definition aviobuf.c:368
unsigned int avio_rb16(AVIOContext *s)
Definition aviobuf.c:749
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition aviobuf.c:321
unsigned int avio_rb24(AVIOContext *s)
Definition aviobuf.c:757
unsigned int avio_rb32(AVIOContext *s)
Definition aviobuf.c:764
int avio_r8(AVIOContext *s)
Definition aviobuf.c:606
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
Public libavutil channel layout APIs header.
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0 and f...
static CheckasmConfig cfg
Definition checkasm.c:74
#define AV_CH_LAYOUT_2POINT1
#define AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_5POINT0
#define AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_STEREO_DOWNMIX
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_2_2
#define AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_7POINT1_WIDE
#define AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_5POINT1
#define AV_CH_LAYOUT_4POINT1
#define AV_CH_LAYOUT_2_1
#define AV_CH_LAYOUT_3POINT1
#define AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LOW_FREQUENCY
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition codec_id.h:47
@ AV_CODEC_ID_DIRAC
Definition codec_id.h:166
@ AV_CODEC_ID_VORBIS
Definition codec_id.h:458
@ AV_CODEC_ID_PNG
Definition codec_id.h:111
@ AV_CODEC_ID_EAC3
Definition codec_id.h:493
@ AV_CODEC_ID_DVD_SUBTITLE
Definition codec_id.h:566
@ AV_CODEC_ID_MP4ALS
Definition codec_id.h:498
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
@ AV_CODEC_ID_EVRC
Definition codec_id.h:524
@ AV_CODEC_ID_JPEG2000
Definition codec_id.h:138
@ AV_CODEC_ID_VVC
Definition codec_id.h:247
@ AV_CODEC_ID_VC1
Definition codec_id.h:120
@ AV_CODEC_ID_EIA_608
Definition codec_id.h:576
@ AV_CODEC_ID_MP2
Definition codec_id.h:453
@ AV_CODEC_ID_DTS
Definition codec_id.h:457
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
@ AV_CODEC_ID_BIN_DATA
Definition codec_id.h:607
@ AV_CODEC_ID_AAC
Definition codec_id.h:455
@ AV_CODEC_ID_QCELP
Definition codec_id.h:477
@ AV_CODEC_ID_AC3
Definition codec_id.h:456
@ AV_CODEC_ID_MP3ON4
Definition codec_id.h:467
@ AV_CODEC_ID_TSCC2
Definition codec_id.h:213
@ AV_CODEC_ID_MPEG4
Definition codec_id.h:62
@ AV_CODEC_ID_MJPEG
Definition codec_id.h:57
@ AV_CODEC_ID_MPEG4SYSTEMS
FAKE codec to indicate a MPEG-4 Systems stream (only used by libavformat)
Definition codec_id.h:618
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition codec_id.h:454
@ AV_CODEC_ID_VP9
Definition codec_id.h:217
@ AV_CODEC_ID_MPEG1VIDEO
Definition codec_id.h:51
@ AV_CODEC_ID_OPUS
Definition codec_id.h:513
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition codec_id.h:52
@ AV_CODEC_ID_ITUT_T35
Definition codec_id.h:611
@ AV_CODEC_ID_MOV_TEXT
Definition codec_id.h:571
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition log.h:236
void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id)
Definition isom.c:305
int ff_mp4_read_descr_len(AVIOContext *pb)
Definition isom.c:283
int ff_mp4_read_dec_config_descr(void *logctx, AVStream *st, AVIOContext *pb)
Definition isom.c:330
int ff_mp4_read_descr(void *logctx, AVIOContext *pb, int *tag)
Definition isom.c:296
const AVCodecTag ff_mp4_obj_type[]
Definition isom.c:34
int ff_mov_iso639_to_lang(const char lang[4], int mp4)
Definition isom.c:234
static const char mov_mdhd_language_map[][4]
Definition isom.c:92
int ff_mov_lang_to_iso639(unsigned code, char to[4])
Definition isom.c:261
static const struct MP4TrackKindValueMapping dash_role_map[]
Definition isom.c:451
static const AVCodecTag mp4_audio_types[]
Definition isom.c:321
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
Definition isom.c:430
const AVCodecTag ff_codec_movdata_tags[]
Definition isom.c:82
const struct MP4TrackKindMapping ff_mov_track_kind_table[]
Definition isom.c:465
static const MovChannelLayout mov_channel_layout[]
Definition isom.c:404
const AVCodecTag ff_codec_movsubtitle_tags[]
Definition isom.c:75
#define MP4DecSpecificDescrTag
Definition isom.h:405
const char * to
Definition webvttdec.c:36
enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
Definition utils.c:143
#define MKTAG(a, b, c, d)
Definition macros.h:55
enum MovChannelLayoutTag * layouts
Definition mov_chan.c:335
uint32_t tag
Definition movenc.c:2073
int avpriv_mpeg4audio_get_config2(MPEG4AudioConfig *c, const uint8_t *buf, int size, int sync_extension, void *logctx)
Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration.
Definition mpeg4audio.c:212
@ AOT_ALS
Y Audio LosslesS.
Definition mpeg4audio.h:108
@ AOT_L3
Y Layer 3.
Definition mpeg4audio.h:106
@ AOT_AAC_LTP
Y Long Term Prediction.
Definition mpeg4audio.h:77
@ AOT_ER_AAC_LD
N Error Resilient Low Delay.
Definition mpeg4audio.h:95
@ AOT_ER_AAC_ELD
N Error Resilient Enhanced Low Delay.
Definition mpeg4audio.h:111
@ AOT_ER_AAC_LC
N Error Resilient Low Complexity.
Definition mpeg4audio.h:89
@ AOT_L2
Y Layer 2.
Definition mpeg4audio.h:105
@ AOT_USAC
Y Unified Speech and Audio Coding.
Definition mpeg4audio.h:114
@ AOT_L1
Y Layer 1.
Definition mpeg4audio.h:104
@ AOT_AAC_SSR
N (code in SoC repo) Scalable Sample Rate.
Definition mpeg4audio.h:76
@ AOT_AAC_LC
Y Low Complexity.
Definition mpeg4audio.h:75
@ AOT_NULL
Definition mpeg4audio.h:72
@ AOT_PS
N Parametric Stereo.
Definition mpeg4audio.h:101
@ AOT_AAC_MAIN
Y Main.
Definition mpeg4audio.h:74
mpeg audio layer common tables.
const uint16_t ff_mpa_freq_tab[3]
#define FF_ARRAY_ELEMS(a)
const uint8_t * code
Definition spdifenc.c:433
enum AVChannelOrder order
Channel order used in this layout.
int nb_channels
Number of channels in this layout.
int extradata_size
Size of the extradata content in bytes.
Definition codec_par.h:75
int frame_size
Audio frame size, if known.
Definition codec_par.h:227
AVChannelLayout ch_layout
The channel layout and number of channels.
Definition codec_par.h:207
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
Definition codec_par.h:99
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
int sample_rate
The number of audio samples per second.
Definition codec_par.h:213
Bytestream IO Context.
Definition avio.h:160
Stream structure.
Definition avformat.h:766
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition avformat.h:789
uint32_t layout_tag
Definition isom.c:401
int64_t channel_layout
Definition isom.c:400
#define av_log(a,...)
enum AVCodecID codec_id
int len
static double c[64]