#2124: Adding H.264 NVENC & HEVC (H.265) NVENC screen recording support

This commit is contained in:
Jaex 2016-12-02 17:30:42 +03:00
parent b74d1085f0
commit 17629d3d5d
4 changed files with 14 additions and 2 deletions

View file

@ -96,7 +96,11 @@ public enum FFmpegVideoCodec
[Description("Animated GIF (gif)")]
gif,
[Description("x265 (mp4)")]
libx265
libx265,
[Description("H.264 NVENC (mp4)")]
h264_nvenc,
[Description("HEVC NVENC (mp4)")]
hevc_nvenc
}
public enum FFmpegPreset

View file

@ -92,6 +92,8 @@ public string Extension
{
case FFmpegVideoCodec.libx264:
case FFmpegVideoCodec.libx265:
case FFmpegVideoCodec.h264_nvenc:
case FFmpegVideoCodec.hevc_nvenc:
case FFmpegVideoCodec.gif:
return "mp4";
case FFmpegVideoCodec.libvpx:

View file

@ -455,7 +455,7 @@ Otherwise it can't keep up with recording and a lot of frame drops will happen.<
<value>120, 20</value>
</data>
<data name="cboVideoCodec.Size" type="System.Drawing.Size, System.Drawing">
<value>104, 21</value>
<value>160, 21</value>
</data>
<data name="cboVideoCodec.TabIndex" type="System.Int32, mscorlib">
<value>1</value>

View file

@ -179,6 +179,12 @@ public string GetFFmpegArgs(bool isCustom = false)
case FFmpegVideoCodec.libxvid: // https://trac.ffmpeg.org/wiki/Encode/MPEG-4
args.AppendFormat("-qscale:v {0} ", FFmpeg.XviD_qscale);
break;
case FFmpegVideoCodec.h264_nvenc: // https://trac.ffmpeg.org/wiki/HWAccelIntro#NVENC
case FFmpegVideoCodec.hevc_nvenc:
args.AppendFormat("-preset {0} ", "default"); // TODO: Add preset option
args.AppendFormat("-b:v {0}k ", "10000"); // TODO: Add bitrate option
args.AppendFormat("-pix_fmt {0} ", "yuv420p");
break;
case FFmpegVideoCodec.gif:
args.AppendFormat("-preset {0} ", FFmpegPreset.ultrafast);
args.AppendFormat("-tune {0} ", FFmpegTune.zerolatency);