FS-8977: Add support for NVENC H264

This commit is contained in:
Anthony Minessale authored and Michael Jerris committed 2016-03-25 11:23:48 -04:00
1 parent ad72c7f56c
commit 77f70e002e
5 files changed
+69 -34

No files matched your search

+9 -2
View File
@@ -282,8 +282,15 @@ static switch_status_t add_stream(MediaStream *mst, AVFormatContext *fc, AVCodec
int buffer_bytes = 2097152; /* 2 mb */
int fps = 15;
/* find the encoder */
*codec = avcodec_find_encoder(codec_id);
if (mm->try_hardware_encoder && codec_id == AV_CODEC_ID_H264) {
*codec = avcodec_find_encoder_by_name("nvenc_h264");
}
if (!*codec) {
/* find the encoder */
*codec = avcodec_find_encoder(codec_id);
}
if (!(*codec)) {
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not find encoder for '%s'\n", avcodec_get_name(codec_id));
return status;