36 uint8_t *buf,
int buf_size)
60 buf[126] = atoi(tag->
value);
109 .mime_type =
"audio/x-mpeg",
110 .extensions =
"mp2,m2a",
121 {
"id3v2_version",
"Select ID3v2 version to write. Currently 3 and 4 are supported.",
123 {
"write_id3v1",
"Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software.",
128 static const AVClass mp3_muxer_class = {
141 int64_t xing_offset = (codec->
channels == 2) ? 32 : 17;
144 int srate_idx, i, channels;
164 header |= (0x7 << 5 | 0x3 << 3 | 0x1 << 1 | 0x1) << 16;
165 header |= (bitrate_idx << 4 | srate_idx << 2) << 8;
166 header |= channels << 6;
177 mpah.frame_size -= 4 + xing_offset + 4 + 4 + 4;
203 .mime_type =
"audio/x-mpeg",
212 .priv_class = &mp3_muxer_class,
struct MP3Context MP3Context
#define ID3v2_DEFAULT_MAGIC
Default magic bytes for ID3v2 header: "ID3".
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define FF_ARRAY_ELEMS(a)
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
mpeg audio layer common tables.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static int mp3_write_trailer(struct AVFormatContext *s)
const uint16_t avpriv_mpa_freq_tab[3]
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
int ff_id3v2_write(struct AVFormatContext *s, int id3v2_version, const char *magic)
Write an ID3v2 tag.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
AVCodecContext * codec
codec context
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int void avio_flush(AVIOContext *s)
void ffio_fill(AVIOContext *s, int b, int count)
int av_strcasecmp(const char *a, const char *b)
int sample_rate
samples per second
static const OptionDef options[]
main external API structure.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Describe the class of an AVClass context structure.
static int id3v1_set_string(AVFormatContext *s, const char *key, uint8_t *buf, int buf_size)
mpeg audio declarations for both encoder and decoder.
int64_t nb_frames
number of frames in this stream if known or 0
int channels
number of audio channels
void * priv_data
Format private data.
void avio_wb32(AVIOContext *s, unsigned int val)
static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf)
const char *const ff_id3v1_genre_str[ID3v1_GENRE_MAX+1]
ID3v1 genres.
preferred ID for decoding MPEG audio layer 1, 2 or 3