Libav
mp3dec.c
Go to the documentation of this file.
1 /*
2  * MP3 demuxer
3  * Copyright (c) 2003 Fabrice Bellard
4  *
5  * This file is part of Libav.
6  *
7  * Libav 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  * Libav 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 Libav; 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"
23 #include "libavutil/intreadwrite.h"
24 #include "libavutil/crc.h"
25 #include "libavutil/dict.h"
26 #include "libavutil/mathematics.h"
27 #include "avformat.h"
28 #include "internal.h"
29 #include "avio_internal.h"
30 #include "id3v2.h"
31 #include "id3v1.h"
32 #include "replaygain.h"
33 
34 #include "libavcodec/avcodec.h"
36 
37 #define XING_FLAG_FRAMES 0x01
38 #define XING_FLAG_SIZE 0x02
39 #define XING_FLAG_TOC 0x04
40 #define XING_FLAC_QSCALE 0x08
41 
42 #define XING_TOC_COUNT 100
43 
44 typedef struct MP3DecContext {
45  int xing_toc;
46  unsigned frames; /* Total number of frames in file */
47  unsigned size; /* Total number of bytes in the stream */
48  int is_cbr;
50 
51 /* mp3 read */
52 
54 {
55  int max_frames, first_frames = 0;
56  int frames, ret;
57  uint32_t header;
58  uint8_t *buf, *buf0, *buf2, *end;
59 
60  buf0 = p->buf;
61  end = p->buf + p->buf_size - sizeof(uint32_t);
62  while(buf0 < end && !*buf0)
63  buf0++;
64 
65  max_frames = 0;
66  buf = buf0;
67 
68  for(; buf < end; buf= buf2+1) {
69  buf2 = buf;
70 
71  for(frames = 0; buf2 < end; frames++) {
73 
74  header = AV_RB32(buf2);
75  ret = avpriv_mpegaudio_decode_header(&h, header);
76  if (ret != 0)
77  break;
78  buf2 += h.frame_size;
79  }
80  max_frames = FFMAX(max_frames, frames);
81  if(buf == buf0)
82  first_frames= frames;
83  }
84  // keep this in sync with ac3 probe, both need to avoid
85  // issues with MPEG-files!
86  if (first_frames >= 10)
87  return AVPROBE_SCORE_EXTENSION + 5;
88  if (first_frames >= 4)
89  return AVPROBE_SCORE_EXTENSION + 1;
90 
91  if (max_frames) {
92  int pes = 0, i;
93  unsigned int code = -1;
94 
95 #define VIDEO_ID 0x000001e0
96 #define AUDIO_ID 0x000001c0
97  /* do a search for mpegps headers to be able to properly bias
98  * towards mpegps if we detect this stream as both. */
99  for (i = 0; i<p->buf_size; i++) {
100  code = (code << 8) + p->buf[i];
101  if ((code & 0xffffff00) == 0x100) {
102  if ((code & 0x1f0) == VIDEO_ID) pes++;
103  else if((code & 0x1e0) == AUDIO_ID) pes++;
104  }
105  }
106 
107  if (pes)
108  max_frames = (max_frames + pes - 1) / pes;
109  }
110  if (max_frames > 500) return AVPROBE_SCORE_EXTENSION;
111  else if (max_frames >= 4) return AVPROBE_SCORE_EXTENSION / 2;
112  else if (max_frames >= 1) return 1;
113  else return 0;
114 //mpegps_mp3_unrecognized_format.mpg has max_frames=3
115 }
116 
117 static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration)
118 {
119  int i;
120  MP3DecContext *mp3 = s->priv_data;
121 
122  if (!filesize &&
123  !(filesize = avio_size(s->pb))) {
124  av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");
125  return;
126  }
127 
128  for (i = 0; i < XING_TOC_COUNT; i++) {
129  uint8_t b = avio_r8(s->pb);
130 
132  av_rescale(b, filesize, 256),
133  av_rescale(i, duration, XING_TOC_COUNT),
134  0, 0, AVINDEX_KEYFRAME);
135  }
136  mp3->xing_toc = 1;
137 }
138 
140  MPADecodeHeader *c, uint32_t spf)
141 {
142 #define LAST_BITS(k, n) ((k) & ((1 << (n)) - 1))
143 #define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m)))
144 
145  uint16_t crc;
146  uint32_t v, delays;
147 
148  char version[10];
149 
150  uint32_t peak = 0;
151  int32_t r_gain = INT32_MIN, a_gain = INT32_MIN;
152 
153  MP3DecContext *mp3 = s->priv_data;
154  static const int64_t xing_offtbl[2][2] = { { 32, 17 }, { 17, 9 } };
155 
156  /* Check for Xing / Info tag */
157  avio_skip(s->pb, xing_offtbl[c->lsf == 1][c->nb_channels == 1]);
158  v = avio_rb32(s->pb);
159  mp3->is_cbr = v == MKBETAG('I', 'n', 'f', 'o');
160  if (v != MKBETAG('X', 'i', 'n', 'g') && !mp3->is_cbr)
161  return;
162 
163  v = avio_rb32(s->pb);
164  if (v & XING_FLAG_FRAMES)
165  mp3->frames = avio_rb32(s->pb);
166  if (v & XING_FLAG_SIZE)
167  mp3->size = avio_rb32(s->pb);
168  if (v & XING_FLAG_TOC && mp3->frames)
169  read_xing_toc(s, mp3->size, av_rescale_q(mp3->frames,
170  (AVRational){spf, c->sample_rate},
171  st->time_base));
172 
173  /* VBR quality */
174  if (v & XING_FLAC_QSCALE)
175  avio_rb32(s->pb);
176 
177  /* Encoder short version string */
178  memset(version, 0, sizeof(version));
179  avio_read(s->pb, version, 9);
180 
181  /* Info Tag revision + VBR method */
182  avio_r8(s->pb);
183 
184  /* Lowpass filter value */
185  avio_r8(s->pb);
186 
187  /* ReplayGain peak */
188  v = avio_rb32(s->pb);
189  peak = av_rescale(v, 100000, 1 << 23);
190 
191  /* Radio ReplayGain */
192  v = avio_rb16(s->pb);
193 
194  if (MIDDLE_BITS(v, 13, 15) == 1) {
195  r_gain = MIDDLE_BITS(v, 0, 8) * 10000;
196 
197  if (v & (1 << 9))
198  r_gain *= -1;
199  }
200 
201  /* Audiophile ReplayGain */
202  v = avio_rb16(s->pb);
203 
204  if (MIDDLE_BITS(v, 13, 15) == 2) {
205  a_gain = MIDDLE_BITS(v, 0, 8) * 10000;
206 
207  if (v & (1 << 9))
208  a_gain *= -1;
209  }
210 
211  /* Encoding flags + ATH Type */
212  avio_r8(s->pb);
213 
214  /* if ABR {specified bitrate} else {minimal bitrate} */
215  avio_r8(s->pb);
216 
217  /* Encoder delays */
218  delays = avio_rb24(s->pb);
219  st->codecpar->initial_padding = delays >> 12;
220  st->codecpar->trailing_padding = delays & ((1 << 12) - 1);
221 
222  /* Misc */
223  avio_r8(s->pb);
224 
225  /* MP3 gain */
226  avio_r8(s->pb);
227 
228  /* Preset and surround info */
229  avio_rb16(s->pb);
230 
231  /* Music length */
232  avio_rb32(s->pb);
233 
234  /* Music CRC */
235  avio_rb16(s->pb);
236 
237  /* Info Tag CRC */
238  crc = ffio_get_checksum(s->pb);
239  v = avio_rb16(s->pb);
240 
241  if (v == crc) {
242  ff_replaygain_export_raw(st, r_gain, peak, a_gain, 0);
243  av_dict_set(&st->metadata, "encoder", version, 0);
244  }
245 }
246 
247 static void mp3_parse_vbri_tag(AVFormatContext *s, AVStream *st, int64_t base)
248 {
249  uint32_t v;
250  MP3DecContext *mp3 = s->priv_data;
251 
252  /* Check for VBRI tag (always 32 bytes after end of mpegaudio header) */
253  avio_seek(s->pb, base + 4 + 32, SEEK_SET);
254  v = avio_rb32(s->pb);
255  if (v == MKBETAG('V', 'B', 'R', 'I')) {
256  /* Check tag version */
257  if (avio_rb16(s->pb) == 1) {
258  /* skip delay and quality */
259  avio_skip(s->pb, 4);
260  mp3->size = avio_rb32(s->pb);
261  mp3->frames = avio_rb32(s->pb);
262  }
263  }
264 }
265 
269 static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
270 {
271  uint32_t v, spf;
272  MPADecodeHeader c;
273  int vbrtag_size = 0;
274  MP3DecContext *mp3 = s->priv_data;
275  int ret;
276 
278 
279  v = avio_rb32(s->pb);
280 
281  ret = avpriv_mpegaudio_decode_header(&c, v);
282  if (ret < 0)
283  return ret;
284  else if (ret == 0)
285  vbrtag_size = c.frame_size;
286  if(c.layer != 3)
287  return -1;
288 
289  spf = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */
290 
291  mp3->frames = 0;
292  mp3->size = 0;
293 
294  mp3_parse_info_tag(s, st, &c, spf);
295  mp3_parse_vbri_tag(s, st, base);
296 
297  if (!mp3->frames && !mp3->size)
298  return -1;
299 
300  /* Skip the vbr tag frame */
301  avio_seek(s->pb, base + vbrtag_size, SEEK_SET);
302 
303  if (mp3->frames)
304  st->duration = av_rescale_q(mp3->frames, (AVRational){spf, c.sample_rate},
305  st->time_base);
306  if (mp3->size && mp3->frames && !mp3->is_cbr)
307  st->codecpar->bit_rate = av_rescale(mp3->size, 8 * c.sample_rate, mp3->frames * (int64_t)spf);
308 
309  return 0;
310 }
311 
313 {
314  AVStream *st;
315  int64_t off;
316  int ret;
317 
318  st = avformat_new_stream(s, NULL);
319  if (!st)
320  return AVERROR(ENOMEM);
321 
325  st->start_time = 0;
326 
327  // lcm of all mp3 sample rates
328  avpriv_set_pts_info(st, 64, 1, 14112000);
329 
330  off = avio_tell(s->pb);
331 
333  ff_id3v1_read(s);
334 
335  if (mp3_parse_vbr_tags(s, st, off) < 0)
336  avio_seek(s->pb, off, SEEK_SET);
337 
338  ret = ff_replaygain_export(st, s->metadata);
339  if (ret < 0)
340  return ret;
341 
342  /* the parameters will be extracted from the compressed bitstream */
343  return 0;
344 }
345 
346 #define MP3_PACKET_SIZE 1024
347 
349 {
350  int ret;
351 
352  ret = av_get_packet(s->pb, pkt, MP3_PACKET_SIZE);
353  if (ret < 0)
354  return ret;
355 
356  pkt->stream_index = 0;
357 
358  if (ret > ID3v1_TAG_SIZE &&
359  memcmp(&pkt->data[ret - ID3v1_TAG_SIZE], "TAG", 3) == 0)
360  ret -= ID3v1_TAG_SIZE;
361 
362  /* note: we need to modify the packet size here to handle the last
363  packet */
364  pkt->size = ret;
365  return ret;
366 }
367 
368 #define SEEK_PACKETS 4
369 #define SEEK_WINDOW (SEEK_PACKETS * MP3_PACKET_SIZE)
370 
371 /* The toc entry can position to the wrong byte offset, try to pick
372  * the closest frame by probing the data in a window of 4 packets.
373  */
374 
375 static int check(AVIOContext *pb, int64_t pos, int64_t *out_pos)
376 {
377  MPADecodeHeader mh = { 0 };
378  int i;
379  uint32_t header;
380  int64_t off = 0;
381 
382 
383  for (i = 0; i < SEEK_PACKETS; i++) {
384  off = avio_seek(pb, pos + mh.frame_size, SEEK_SET);
385  if (off < 0)
386  break;
387 
388  header = avio_rb32(pb);
389 
390 
391  if (avpriv_mpegaudio_decode_header(&mh, header))
392  break;
393  out_pos[i] = off;
394  }
395 
396  return i;
397 }
398 
399 static int reposition(AVFormatContext *s, int64_t pos)
400 {
401  int ret, best_valid = -1;
402  int64_t p, best_pos = -1;
403 
404  for (p = FFMAX(pos - SEEK_WINDOW / 2, 0); p < pos + SEEK_WINDOW / 2; p++) {
405  int64_t out_pos[SEEK_PACKETS];
406  ret = check(s->pb, p, out_pos);
407 
408  if (best_valid < ret) {
409  int i;
410  for (i = 0; i < ret; i++) {
411  if (llabs(best_pos - pos) > llabs(out_pos[i] - pos)) {
412  best_pos = out_pos[i];
413  best_valid = ret;
414  }
415  }
416  if (best_pos == pos && best_valid == SEEK_PACKETS)
417  break;
418  }
419  }
420 
421  if (best_valid <= 0)
422  return AVERROR(ENOSYS);
423 
424  p = avio_seek(s->pb, best_pos, SEEK_SET);
425  if (p < 0)
426  return p;
427 
428  return 0;
429 }
430 
431 static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
432  int flags)
433 {
434  MP3DecContext *mp3 = s->priv_data;
435  AVIndexEntry *ie;
436  AVStream *st = s->streams[0];
437  int64_t ret = av_index_search_timestamp(st, timestamp, flags);
438 
439  if (!mp3->xing_toc)
440  return AVERROR(ENOSYS);
441 
442  if (ret < 0)
443  return ret;
444 
445  ie = &st->index_entries[ret];
446 
447  ret = reposition(s, ie->pos);
448  if (ret < 0)
449  return ret;
450 
451  ff_update_cur_dts(s, st, ie->timestamp);
452 
453  return 0;
454 }
455 
457  .name = "mp3",
458  .long_name = NULL_IF_CONFIG_SMALL("MP2/3 (MPEG audio layer 2/3)"),
459  .read_probe = mp3_read_probe,
460  .read_header = mp3_read_header,
461  .read_packet = mp3_read_packet,
462  .read_seek = mp3_seek,
463  .priv_data_size = sizeof(MP3DecContext),
465  .extensions = "mp2,mp3,m2a,mpa", /* XXX: use probe */
466 };
static int reposition(AVFormatContext *s, int64_t pos)
Definition: mp3dec.c:399
Bytestream IO Context.
Definition: avio.h:104
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition: aviobuf.c:297
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
Definition: utils.c:1214
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:130
void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: utils.c:2986
int64_t pos
Definition: avformat.h:664
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: avcodec.h:3483
void ff_id3v1_read(AVFormatContext *s)
Read an ID3v1 tag.
Definition: id3v1.c:227
int size
Definition: avcodec.h:1347
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:242
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
Definition: avformat.h:890
static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration)
Definition: mp3dec.c:117
unsigned int avio_rb16(AVIOContext *s)
Definition: aviobuf.c:681
int trailing_padding
Audio only.
Definition: avcodec.h:3586
unsigned frames
Definition: mp3dec.c:46
Format I/O context.
Definition: avformat.h:940
void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
Update cur_dts of all streams based on the given timestamp and AVStream.
Definition: utils.c:1137
Public dictionary API.
static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: mp3dec.c:348
uint8_t
#define XING_FLAG_SIZE
Definition: mp3dec.c:38
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:696
static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: mp3dec.c:431
#define AV_RB32
Definition: intreadwrite.h:130
enum AVStreamParseType need_parsing
Definition: avformat.h:879
#define b
Definition: input.c:52
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:2648
AVStream ** streams
A list of all streams in the file.
Definition: avformat.h:1008
int64_t duration
Definition: movenc.c:63
int initial_padding
Audio only.
Definition: avcodec.h:3579
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:38
uint8_t * data
Definition: avcodec.h:1346
int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
static int flags
Definition: log.c:50
static const uint8_t xing_offtbl[2][2]
Definition: mp3enc.c:123
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
Definition: utils.c:117
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:295
int ff_replaygain_export(AVStream *st, AVDictionary *metadata)
Parse replaygain tags and export them as per-stream side data.
Definition: replaygain.c:91
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:545
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Definition: mathematics.c:99
#define VIDEO_ID
#define AVINDEX_KEYFRAME
Definition: avformat.h:666
AVDictionary * metadata
Metadata that applies to the whole file.
Definition: avformat.h:1148
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
Definition: utils.c:1255
#define AVERROR(e)
Definition: error.h:43
int64_t timestamp
Definition: avformat.h:665
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
static int mp3_read_header(AVFormatContext *s)
Definition: mp3dec.c:312
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:479
enum AVMediaType codec_type
General type of the encoded data.
Definition: avcodec.h:3479
#define FFMAX(a, b)
Definition: common.h:64
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:536
int bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: avcodec.h:3512
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:401
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:400
#define SEEK_WINDOW
Definition: mp3dec.c:369
void ffio_init_checksum(AVIOContext *s, unsigned long(*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum)
Definition: aviobuf.c:524
unsigned int avio_rb24(AVIOContext *s)
Definition: aviobuf.c:689
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
Definition: mathematics.c:86
#define MP3_PACKET_SIZE
Definition: mp3dec.c:346
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: avio.h:286
static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st, MPADecodeHeader *c, uint32_t spf)
Definition: mp3dec.c:139
int32_t
int xing_toc
Definition: mp3dec.c:45
AVDictionary * metadata
Definition: avformat.h:772
unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf, unsigned int len)
Definition: aviobuf.c:510
static void mp3_parse_vbri_tag(AVFormatContext *s, AVStream *st, int64_t base)
Definition: mp3dec.c:247
if(ac->has_optimized_func)
Stream structure.
Definition: avformat.h:705
static int mp3_read_probe(AVProbeData *p)
Definition: mp3dec.c:53
NULL
Definition: eval.c:55
Libavcodec external API header.
version
Definition: ffv1enc.c:1091
AVIOContext * pb
I/O context.
Definition: avformat.h:982
#define XING_FLAG_FRAMES
Definition: mp3dec.c:37
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:68
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:421
rational number numerator/denominator
Definition: rational.h:43
#define SEEK_PACKETS
Definition: mp3dec.c:368
#define XING_FLAC_QSCALE
Definition: mp3dec.c:40
unsigned long ffio_get_checksum(AVIOContext *s)
Definition: aviobuf.c:516
#define AVPROBE_SCORE_EXTENSION
score for file extension
Definition: avformat.h:405
This structure contains the data a format has to probe a file.
Definition: avformat.h:398
#define AUDIO_ID
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:757
MPEG Audio header decoder.
int is_cbr
Definition: mp3dec.c:48
full parsing and repack
Definition: avformat.h:657
Main libavformat public API header.
static int check(AVIOContext *pb, int64_t pos, int64_t *out_pos)
Definition: mp3dec.c:375
int ff_replaygain_export_raw(AVStream *st, int32_t tg, uint32_t tp, int32_t ag, uint32_t ap)
Export already decoded replaygain values as per-stream side data.
Definition: replaygain.c:70
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
Definition: avformat.h:750
AVInputFormat ff_mp3_demuxer
Definition: mp3dec.c:456
#define MKBETAG(a, b, c, d)
Definition: common.h:257
#define XING_FLAG_TOC
Definition: mp3dec.c:39
#define MIDDLE_BITS(k, m, n)
unsigned size
Definition: mp3dec.c:47
void * priv_data
Format private data.
Definition: avformat.h:968
#define XING_TOC_COUNT
Definition: mp3dec.c:42
static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
Try to find Xing/Info/VBRI tags and compute duration from info therein.
Definition: mp3dec.c:269
#define ID3v1_TAG_SIZE
Definition: id3v1.h:27
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:529
#define AV_DICT_IGNORE_SUFFIX
Definition: dict.h:60
AVCodecParameters * codecpar
Definition: avformat.h:831
int stream_index
Definition: avcodec.h:1348
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Definition: avformat.h:742
This structure stores compressed data.
Definition: avcodec.h:1323