Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c
- index a8144f5..ab721fc 100644
- --- a/src/plumbing/transcoding.c
- +++ b/src/plumbing/transcoding.c
- @@ -1099,8 +1099,12 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
- break;
- case SCT_H264:
- +
- octx->codec_id = AV_CODEC_ID_H264;
- - octx->pix_fmt = PIX_FMT_YUV420P;
- + if (!strcmp(ocodec->name, "nvenc"))
- + octx->pix_fmt = AV_PIX_FMT_NV12;
- + else
- + octx->pix_fmt = PIX_FMT_YUV420P;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
- // Qscale difference between I-frames and P-frames.
- @@ -1113,7 +1117,10 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
- octx->qcompress = 0.6;
- // Default = "medium". We gain more encoding speed compared to the loss of quality when lowering it _slightly_.
- - av_dict_set(&opts, "preset", "faster", 0);
- + if (!strcmp(ocodec->name, "nvenc"))
- + av_dict_set(&opts, "preset", "hq", 0);
- + else
- + av_dict_set(&opts, "preset", "faster", 0);
- // Use main profile instead of the standard "baseline", we are aiming for better quality.
- // Older devices (iPhone <4, Android <4) only supports baseline. Chromecast only supports >=4.1...
- av_dict_set(&opts, "profile", "main", 0); // L3.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement