Advertisement
Guest User

Untitled

a guest
May 13th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c
  2. index a8144f5..ab721fc 100644
  3. --- a/src/plumbing/transcoding.c
  4. +++ b/src/plumbing/transcoding.c
  5. @@ -1099,8 +1099,12 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
  6. break;
  7.  
  8. case SCT_H264:
  9. +
  10. octx->codec_id = AV_CODEC_ID_H264;
  11. - octx->pix_fmt = PIX_FMT_YUV420P;
  12. + if (!strcmp(ocodec->name, "nvenc"))
  13. + octx->pix_fmt = AV_PIX_FMT_NV12;
  14. + else
  15. + octx->pix_fmt = PIX_FMT_YUV420P;
  16. octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
  17.  
  18. // Qscale difference between I-frames and P-frames.
  19. @@ -1113,7 +1117,10 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
  20. octx->qcompress = 0.6;
  21.  
  22. // Default = "medium". We gain more encoding speed compared to the loss of quality when lowering it _slightly_.
  23. - av_dict_set(&opts, "preset", "faster", 0);
  24. + if (!strcmp(ocodec->name, "nvenc"))
  25. + av_dict_set(&opts, "preset", "hq", 0);
  26. + else
  27. + av_dict_set(&opts, "preset", "faster", 0);
  28. // Use main profile instead of the standard "baseline", we are aiming for better quality.
  29. // Older devices (iPhone <4, Android <4) only supports baseline. Chromecast only supports >=4.1...
  30. av_dict_set(&opts, "profile", "main", 0); // L3.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement