History

Pass VBV delay to the calling application via ctx

VBV delay is useful for T-STD compliance in some TS muxers. It is certainly possible to retrieve it by parsing the output of FFmpeg, but getting it from the context makes it simpler and less error-prone.

Christophe Massiot committed 15 years ago

Commit b6d07001 parent c4c9fb42 files · +10 −1Browse files

Unified · Split

2 files
  1. libavcodec/avcodec.h +9 −1
  2. libavcodec/mpegvideo_enc.c +1 −0
libavcodec/avcodec.h+9−1
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #include "libavutil/cpu.h"
3333
3434 #define LIBAVCODEC_VERSION_MAJOR 52
35−#define LIBAVCODEC_VERSION_MINOR 112
35+#define LIBAVCODEC_VERSION_MINOR 113
3636 #define LIBAVCODEC_VERSION_MICRO 1
3737
3838 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -2901,6 +2901,14 @@ typedef struct AVCodecContext { · 2862 unmodified lines
29012901 */
29022902 int thread_safe_callbacks;
29032903
2904+ /**
2905+ * VBV delay coded in the last frame (in periods of a 27 MHz clock).
2906+ * Used for compliant TS muxing.
2907+ * - encoding: Set by libavcodec.
2908+ * - decoding: unused.
2909+ */
2910+ uint64_t vbv_delay;
2911+
29042912 /**
29052913 * Current statistics for PTS correction.
29062914 * - decoding: maintained and used by libavcodec, not intended to be used by user apps
libavcodec/mpegvideo_enc.c+1−0
@@ -1381,6 +1381,7 @@ vbv_retry: · 1380 unmodified lines
13811381 s->vbv_delay_ptr[1] = vbv_delay>>5;
13821382 s->vbv_delay_ptr[2] &= 0x07;
13831383 s->vbv_delay_ptr[2] |= vbv_delay<<3;
1384+ avctx->vbv_delay = vbv_delay*300;
13841385 }
13851386 s->total_bits += s->frame_bits;
13861387 avctx->frame_bits = s->frame_bits;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t