aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Van Sickle2012-09-19 13:51:29 -0400
committerAnton Khirnov2012-09-19 20:59:24 +0200
commit9bf41210a9a7511f44ea1d7fd2646430889a7c2b (patch)
treea65f3dbf1c5a513c56f2989d8bfd5ff9865dab7c
parentd17d0ec8c2b432f0b680737de0b2aa03f2d4dd8d (diff)
libx264: add support for nal-hrd, required for Blu-ray streams.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/libx264.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 91cac531ed..62815ced92 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -69,6 +69,7 @@ typedef struct X264Context {
int direct_pred;
int slice_max_size;
char *stats;
+ int nal_hrd
} X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -373,6 +374,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (x4->fastfirstpass)
x264_param_apply_fastfirstpass(&x4->params);
+ if (x4->nal_hrd >= 0)
+ x4->params.i_nal_hrd = x4->nal_hrd;
+
if (x4->profile)
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error setting profile %s.\n", x4->profile);
@@ -518,6 +522,11 @@ static const AVOption options[] = {
{ "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" },
{ "slice-max-size","Limit the size of each slice in bytes", OFFSET(slice_max_size),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE },
{ "stats", "Filename for 2 pass stats", OFFSET(stats), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+ { "nal-hrd", "Signal HRD information (requires vbv-bufsize; "
+ "cbr not allowed in .mp4)", OFFSET(nal_hrd), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE, "nal-hrd" },
+ { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" },
+ { "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
+ { "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" },
{ NULL },
};