Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
transcoding: fix compile when using libav, fixes #2877
  • Loading branch information
stbenz authored and perexg committed May 24, 2015
1 parent 247dd3a commit bb8fea8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plumbing/transcoding.c
Expand Up @@ -1126,7 +1126,9 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
if (t->t_props.tp_vbitrate < 64) {
// encode with specified quality and optimize for low latency
// valid values for quality are 1-63, smaller means better quality, use 15 as default
av_dict_set_int(&opts, "crf", (t->t_props.tp_vbitrate == 0 ? 15 : t->t_props.tp_vbitrate), 0);
char valuestr[3];
snprintf(valuestr, sizeof (valuestr), "%d", t->t_props.tp_vbitrate == 0 ? 15 : t->t_props.tp_vbitrate);
av_dict_set(&opts, "crf", valuestr, 0);
// bitrate setting is still required, as it's used as max rate in CQ mode
// and set to a very low value by default
octx->bit_rate = 25000000;
Expand Down Expand Up @@ -1154,7 +1156,9 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
if (t->t_props.tp_vbitrate < 64) {
// encode with specified quality and optimize for low latency
// valid values for quality are 1-51, smaller means better quality, use 15 as default
av_dict_set_int(&opts, "crf", (t->t_props.tp_vbitrate == 0 ? 15 : MIN(51, t->t_props.tp_vbitrate)), 0);
char valuestr[3];
snprintf(valuestr, sizeof (valuestr), "%d", t->t_props.tp_vbitrate == 0 ? 15 : MIN(51, t->t_props.tp_vbitrate));
av_dict_set(&opts, "crf", valuestr, 0);
// tune "zerolatency" removes as much encoder latency as possible
av_dict_set(&opts, "tune", "zerolatency", 0);
} else {
Expand Down

0 comments on commit bb8fea8

Please sign in to comment.