FS-7983 Added param for specifying video encoding speed

With this patch, the param vencspd can be set to slow, medium, or fast to
adjust the speed of video encoding on a per file basis. Currently, this
only has an affect on files recorded using mod_av with H.264 as the video
codec.
This commit is contained in:
Bradley Jokinen committed 2015-08-25 09:02:53 -05:00
1 parent 514cfbd9f5
commit 723e8a1f9a
3 files changed
+35

No files matched your search

+14
View File
@@ -299,6 +299,20 @@ static switch_status_t add_stream(MediaStream *mst, AVFormatContext *fc, AVCodec
if (codec_id == AV_CODEC_ID_H264) {
c->ticks_per_frame = 2;
switch (mm->vencspd) {
case SWITCH_VIDEO_ENCODE_SPEED_SLOW:
av_opt_set(c->priv_data, "preset", "veryslow", 0);
break;
case SWITCH_VIDEO_ENCODE_SPEED_MEDIUM:
av_opt_set(c->priv_data, "preset", "medium", 0);
break;
case SWITCH_VIDEO_ENCODE_SPEED_FAST:
av_opt_set(c->priv_data, "preset", "ultrafast", 0);
break;
default:
break;
}
}
if (codec_id == AV_CODEC_ID_VP8) {