Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
transcoding: added patch from lekma to do proper pixel format support…
… for nvenc and intel's qsv
- Loading branch information
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1250,7 +1250,11 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) | |
|
|
||
| switch (ts->ts_type) { | ||
| case SCT_MPEG2VIDEO: | ||
| octx->pix_fmt = AV_PIX_FMT_YUV420P; | ||
| if (!strcmp(ocodec->name, "nvenc") || !strcmp(ocodec->name, "mpeg2_qsv")) | ||
| octx->pix_fmt = AV_PIX_FMT_NV12; | ||
| else | ||
| octx->pix_fmt = AV_PIX_FMT_YUV420P; | ||
|
|
||
| octx->flags |= CODEC_FLAG_GLOBAL_HEADER; | ||
|
|
||
| if (t->t_props.tp_vbitrate < 64) { | ||
|
|
@@ -1297,11 +1301,20 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt) | |
| break; | ||
|
|
||
| case SCT_H264: | ||
| octx->pix_fmt = AV_PIX_FMT_YUV420P; | ||
| if (!strcmp(ocodec->name, "nvenc") || !strcmp(ocodec->name, "h264_qsv")) | ||
| octx->pix_fmt = AV_PIX_FMT_NV12; | ||
| else | ||
| octx->pix_fmt = AV_PIX_FMT_YUV420P; | ||
|
|
||
| octx->flags |= CODEC_FLAG_GLOBAL_HEADER; | ||
|
|
||
| // 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")) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Jalle19
Contributor
|
||
| av_dict_set(&opts, "preset", "hq", 0); | ||
| else if (!strcmp(ocodec->name, "h264_qsv")) | ||
| av_dict_set(&opts, "preset", "medium", 0); | ||
| else | ||
| av_dict_set(&opts, "preset", "faster", 0); | ||
|
|
||
| // All modern devices should support "high" profile | ||
| av_dict_set(&opts, "profile", "high", 0); | ||
|
|
||
2 comments
on commit 0785258
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never submited this! did I?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lekma: oops.. sorry - lsd wrote it. I'm lost between issue tracker / IRC nicknames.
Should probably be strcmp() == 0, same below.