4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVCODEC_CODEC_ID_H
22 #define AVCODEC_CODEC_ID_H
24 #include "libavutil/avutil.h"
25 #include "libavutil/samplefmt.h"
27 #include "version_major.h"
30 * @addtogroup lavc_core
35 * Identify the syntax and semantics of the bitstream.
36 * The principle is roughly:
37 * Two decoders with the same ID can decode the same streams.
38 * Two encoders with the same ID can encode compatible streams.
39 * There may be slight deviations from the principle due to implementation
42 * If you add a codec ID to this list, add it so that
43 * 1. no value of an existing codec ID changes (that would break ABI),
44 * 2. it is as close as possible to similar codecs
46 * After adding new codec IDs, do not forget to add an entry to the codec
47 * descriptor list and bump libavcodec minor version.
53 AV_CODEC_ID_MPEG1VIDEO,
54 AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
66 AV_CODEC_ID_MSMPEG4V1,
67 AV_CODEC_ID_MSMPEG4V2,
68 AV_CODEC_ID_MSMPEG4V3,
91 AV_CODEC_ID_INTERPLAY_VIDEO,
103 AV_CODEC_ID_TRUEMOTION1,
104 AV_CODEC_ID_VMDVIDEO,
129 AV_CODEC_ID_TRUEMOTION2,
135 AV_CODEC_ID_SMACKVIDEO,
140 AV_CODEC_ID_JPEG2000,
146 AV_CODEC_ID_DSICINVIDEO,
147 AV_CODEC_ID_TIERTEXSEQVIDEO,
155 AV_CODEC_ID_BETHSOFTVID,
167 AV_CODEC_ID_ESCAPE124,
171 AV_CODEC_ID_MOTIONPIXELS,
183 AV_CODEC_ID_FLASHSV2,
184 AV_CODEC_ID_CDGRAPHICS,
187 AV_CODEC_ID_BINKVIDEO,
188 AV_CODEC_ID_IFF_ILBM,
189 #define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM
195 AV_CODEC_ID_A64_MULTI,
196 AV_CODEC_ID_A64_MULTI5,
199 AV_CODEC_ID_LAGARITH,
203 AV_CODEC_ID_WMV3IMAGE,
204 AV_CODEC_ID_VC1IMAGE,
206 AV_CODEC_ID_BMV_VIDEO,
213 AV_CODEC_ID_ZEROCODEC,
222 AV_CODEC_ID_ESCAPE130,
225 AV_CODEC_ID_HNM4_VIDEO,
227 #define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
229 AV_CODEC_ID_ALIAS_PIX,
230 AV_CODEC_ID_BRENDER_PIX,
231 AV_CODEC_ID_PAF_VIDEO,
244 AV_CODEC_ID_SCREENPRESSO,
251 #define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
256 #if FF_API_AYUV_CODECID
259 AV_CODEC_ID_TARGA_Y216,
271 AV_CODEC_ID_TRUEMOTION2RT,
273 AV_CODEC_ID_MAGICYUV,
274 AV_CODEC_ID_SHEERVIDEO,
281 AV_CODEC_ID_CLEARVIDEO,
284 AV_CODEC_ID_BITPACKED,
291 AV_CODEC_ID_PROSUMER,
307 AV_CODEC_ID_MOBICLIP,
312 AV_CODEC_ID_SIMBIOSIS_IMX,
313 AV_CODEC_ID_SGA_VIDEO,
319 AV_CODEC_ID_RADIANCE_HDR,
321 AV_CODEC_ID_MEDIA100,
328 /* various PCM "codecs" */
329 AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
330 AV_CODEC_ID_PCM_S16LE = 0x10000,
331 AV_CODEC_ID_PCM_S16BE,
332 AV_CODEC_ID_PCM_U16LE,
333 AV_CODEC_ID_PCM_U16BE,
336 AV_CODEC_ID_PCM_MULAW,
337 AV_CODEC_ID_PCM_ALAW,
338 AV_CODEC_ID_PCM_S32LE,
339 AV_CODEC_ID_PCM_S32BE,
340 AV_CODEC_ID_PCM_U32LE,
341 AV_CODEC_ID_PCM_U32BE,
342 AV_CODEC_ID_PCM_S24LE,
343 AV_CODEC_ID_PCM_S24BE,
344 AV_CODEC_ID_PCM_U24LE,
345 AV_CODEC_ID_PCM_U24BE,
346 AV_CODEC_ID_PCM_S24DAUD,
347 AV_CODEC_ID_PCM_ZORK,
348 AV_CODEC_ID_PCM_S16LE_PLANAR,
350 AV_CODEC_ID_PCM_F32BE,
351 AV_CODEC_ID_PCM_F32LE,
352 AV_CODEC_ID_PCM_F64BE,
353 AV_CODEC_ID_PCM_F64LE,
354 AV_CODEC_ID_PCM_BLURAY,
357 AV_CODEC_ID_PCM_S8_PLANAR,
358 AV_CODEC_ID_PCM_S24LE_PLANAR,
359 AV_CODEC_ID_PCM_S32LE_PLANAR,
360 AV_CODEC_ID_PCM_S16BE_PLANAR,
361 AV_CODEC_ID_PCM_S64LE,
362 AV_CODEC_ID_PCM_S64BE,
363 AV_CODEC_ID_PCM_F16LE,
364 AV_CODEC_ID_PCM_F24LE,
365 AV_CODEC_ID_PCM_VIDC,
368 /* various ADPCM codecs */
369 AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
370 AV_CODEC_ID_ADPCM_IMA_WAV,
371 AV_CODEC_ID_ADPCM_IMA_DK3,
372 AV_CODEC_ID_ADPCM_IMA_DK4,
373 AV_CODEC_ID_ADPCM_IMA_WS,
374 AV_CODEC_ID_ADPCM_IMA_SMJPEG,
375 AV_CODEC_ID_ADPCM_MS,
376 AV_CODEC_ID_ADPCM_4XM,
377 AV_CODEC_ID_ADPCM_XA,
378 AV_CODEC_ID_ADPCM_ADX,
379 AV_CODEC_ID_ADPCM_EA,
380 AV_CODEC_ID_ADPCM_G726,
381 AV_CODEC_ID_ADPCM_CT,
382 AV_CODEC_ID_ADPCM_SWF,
383 AV_CODEC_ID_ADPCM_YAMAHA,
384 AV_CODEC_ID_ADPCM_SBPRO_4,
385 AV_CODEC_ID_ADPCM_SBPRO_3,
386 AV_CODEC_ID_ADPCM_SBPRO_2,
387 AV_CODEC_ID_ADPCM_THP,
388 AV_CODEC_ID_ADPCM_IMA_AMV,
389 AV_CODEC_ID_ADPCM_EA_R1,
390 AV_CODEC_ID_ADPCM_EA_R3,
391 AV_CODEC_ID_ADPCM_EA_R2,
392 AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
393 AV_CODEC_ID_ADPCM_IMA_EA_EACS,
394 AV_CODEC_ID_ADPCM_EA_XAS,
395 AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
396 AV_CODEC_ID_ADPCM_IMA_ISS,
397 AV_CODEC_ID_ADPCM_G722,
398 AV_CODEC_ID_ADPCM_IMA_APC,
399 AV_CODEC_ID_ADPCM_VIMA,
400 AV_CODEC_ID_ADPCM_AFC,
401 AV_CODEC_ID_ADPCM_IMA_OKI,
402 AV_CODEC_ID_ADPCM_DTK,
403 AV_CODEC_ID_ADPCM_IMA_RAD,
404 AV_CODEC_ID_ADPCM_G726LE,
405 AV_CODEC_ID_ADPCM_THP_LE,
406 AV_CODEC_ID_ADPCM_PSX,
407 AV_CODEC_ID_ADPCM_AICA,
408 AV_CODEC_ID_ADPCM_IMA_DAT4,
409 AV_CODEC_ID_ADPCM_MTAF,
410 AV_CODEC_ID_ADPCM_AGM,
411 AV_CODEC_ID_ADPCM_ARGO,
412 AV_CODEC_ID_ADPCM_IMA_SSI,
413 AV_CODEC_ID_ADPCM_ZORK,
414 AV_CODEC_ID_ADPCM_IMA_APM,
415 AV_CODEC_ID_ADPCM_IMA_ALP,
416 AV_CODEC_ID_ADPCM_IMA_MTF,
417 AV_CODEC_ID_ADPCM_IMA_CUNNING,
418 AV_CODEC_ID_ADPCM_IMA_MOFLEX,
419 AV_CODEC_ID_ADPCM_IMA_ACORN,
420 AV_CODEC_ID_ADPCM_XMD,
423 AV_CODEC_ID_AMR_NB = 0x12000,
426 /* RealAudio codecs*/
427 AV_CODEC_ID_RA_144 = 0x13000,
430 /* various DPCM codecs */
431 AV_CODEC_ID_ROQ_DPCM = 0x14000,
432 AV_CODEC_ID_INTERPLAY_DPCM,
433 AV_CODEC_ID_XAN_DPCM,
434 AV_CODEC_ID_SOL_DPCM,
435 AV_CODEC_ID_SDX2_DPCM,
436 AV_CODEC_ID_GREMLIN_DPCM,
437 AV_CODEC_ID_DERF_DPCM,
438 AV_CODEC_ID_WADY_DPCM,
439 AV_CODEC_ID_CBD2_DPCM,
442 AV_CODEC_ID_MP2 = 0x15000,
443 AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
453 AV_CODEC_ID_VMDAUDIO,
459 AV_CODEC_ID_WESTWOOD_SND1,
460 AV_CODEC_ID_GSM, ///< as in Berlin toast format
463 AV_CODEC_ID_TRUESPEECH,
465 AV_CODEC_ID_SMACKAUDIO,
468 AV_CODEC_ID_DSICINAUDIO,
470 AV_CODEC_ID_MUSEPACK7,
472 AV_CODEC_ID_GSM_MS, /* as found in WAV */
475 AV_CODEC_ID_NELLYMOSER,
476 AV_CODEC_ID_MUSEPACK8,
478 AV_CODEC_ID_WMAVOICE,
480 AV_CODEC_ID_WMALOSSLESS,
489 AV_CODEC_ID_BINKAUDIO_RDFT,
490 AV_CODEC_ID_BINKAUDIO_DCT,
491 AV_CODEC_ID_AAC_LATM,
496 AV_CODEC_ID_8SVX_EXP,
497 AV_CODEC_ID_8SVX_FIB,
498 AV_CODEC_ID_BMV_AUDIO,
503 AV_CODEC_ID_COMFORT_NOISE,
505 AV_CODEC_ID_METASOUND,
506 AV_CODEC_ID_PAF_AUDIO,
510 AV_CODEC_ID_FFWAVESYNTH,
512 AV_CODEC_ID_SONIC_LS,
515 AV_CODEC_ID_DSD_LSBF,
516 AV_CODEC_ID_DSD_MSBF,
517 AV_CODEC_ID_DSD_LSBF_PLANAR,
518 AV_CODEC_ID_DSD_MSBF_PLANAR,
520 AV_CODEC_ID_INTERPLAY_ACM,
524 AV_CODEC_ID_ATRAC3AL,
525 AV_CODEC_ID_ATRAC3PAL,
532 AV_CODEC_ID_ACELP_KELVIN,
533 AV_CODEC_ID_MPEGH_3D_AUDIO,
536 AV_CODEC_ID_FASTAUDIO,
537 AV_CODEC_ID_MSNSIREN,
548 /* subtitle codecs */
549 AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
550 AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
551 AV_CODEC_ID_DVB_SUBTITLE,
552 AV_CODEC_ID_TEXT, ///< raw UTF-8 text
555 AV_CODEC_ID_MOV_TEXT,
556 AV_CODEC_ID_HDMV_PGS_SUBTITLE,
557 AV_CODEC_ID_DVB_TELETEXT,
559 AV_CODEC_ID_MICRODVD,
563 AV_CODEC_ID_REALTEXT,
565 AV_CODEC_ID_SUBVIEWER1,
566 AV_CODEC_ID_SUBVIEWER,
573 AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
575 AV_CODEC_ID_ARIB_CAPTION,
577 /* other specific kind of codecs (generally used for attachments) */
578 AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
579 AV_CODEC_ID_TTF = 0x18000,
581 AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream.
587 AV_CODEC_ID_SMPTE_KLV,
589 AV_CODEC_ID_TIMED_ID3,
590 AV_CODEC_ID_BIN_DATA,
591 AV_CODEC_ID_SMPTE_2038,
594 AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
596 AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
597 * stream (only used by libavformat) */
598 AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
599 * stream (only used by libavformat) */
600 AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
601 AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket
603 * Dummy null video codec, useful mainly for development and debugging.
604 * Null encoder/decoder discard all input and never return any output.
608 * Dummy null audio codec, useful mainly for development and debugging.
609 * Null encoder/decoder discard all input and never return any output.
615 * Get the type of the given codec.
617 enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
620 * Get the name of a codec.
621 * @return a static string identifying the codec; never NULL
623 const char *avcodec_get_name(enum AVCodecID id);
626 * Return codec bits per sample.
628 * @param[in] codec_id the codec
629 * @return Number of bits per sample or zero if unknown for the given codec.
631 int av_get_bits_per_sample(enum AVCodecID codec_id);
634 * Return codec bits per sample.
635 * Only return non-zero if the bits per sample is exactly correct, not an
638 * @param[in] codec_id the codec
639 * @return Number of bits per sample or zero if unknown for the given codec.
641 int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
644 * Return a name for the specified profile, if available.
646 * @param codec_id the ID of the codec to which the requested profile belongs
647 * @param profile the profile value for which a name is requested
648 * @return A name for the profile if found, NULL otherwise.
650 * @note unlike av_get_profile_name(), which searches a list of profiles
651 * supported by a specific decoder or encoder implementation, this
652 * function searches the list of profiles from the AVCodecDescriptor
654 const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
657 * Return the PCM codec associated with a sample format.
658 * @param be endianness, 0 for little, 1 for big,
659 * -1 (or anything else) for native
660 * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE
662 enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
668 #endif // AVCODEC_CODEC_ID_H