Add support for vp9 and av1 encoding

pull/3456/head
Exuvo 2022-03-11 13:37:27 +01:00
parent 550693af10
commit 9fd0a94c9f
3 changed files with 18 additions and 0 deletions

View File

@ -56,6 +56,8 @@ VideoStore::CodecData VideoStore::codec_data[] = {
{ AV_CODEC_ID_H264, "h264", "libx264", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P },
{ AV_CODEC_ID_MJPEG, "mjpeg", "mjpeg", AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ422P },
#endif
{ AV_CODEC_ID_VP9, "vp9", "libvpx-vp9", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
{ AV_CODEC_ID_AV1, "av1", "libsvtav1", AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P, AV_HWDEVICE_TYPE_NONE },
};
VideoStore::VideoStore(

View File

@ -189,12 +189,24 @@ function initPage() {
encoder_dropdown[0].options[0].selected = 1;
option.selected = false;
}
} else if ( this.value == 167 /* vp9 */ ) {
option.disabled = !(option.value.includes('vp9'));
if ( option.disabled && option.selected ) {
encoder_dropdown[0].options[0].selected = 1;
option.selected = false;
}
} else if ( this.value == 173 /* hevc */ ) {
option.disabled = !(option.value.includes('hevc') || option.value.includes('265') );
if ( option.disabled && option.selected ) {
encoder_dropdown[0].options[0].selected = 1;
option.selected = false;
}
} else if ( this.value == 226 /* av1 */ ) {
option.disabled = !(option.value.includes('av1'));
if ( option.disabled && option.selected ) {
encoder_dropdown[0].options[0].selected = 1;
option.selected = false;
}
} else {
option.disabled = false;
}

View File

@ -1039,6 +1039,8 @@ $videowriter_codecs = array(
'0' => translate('Auto'),
'27' => 'h264',
'173' => 'h265/hevc',
'167' => 'vp9',
'226' => 'av1',
);
echo htmlSelect('newMonitor[OutputCodec]', $videowriter_codecs, $monitor->OutputCodec());
?>
@ -1058,6 +1060,8 @@ $videowriter_encoders = array(
'libx265' => 'libx265',
'hevc_nvenc' => 'hevc_nvenc',
'hevc_vaapi' => 'hevc_vaapi',
'libvpx-vp9' => 'libvpx-vp9',
'libsvtav1' => 'libsvtav1',
);
echo htmlSelect('newMonitor[Encoder]', $videowriter_encoders, $monitor->Encoder());?></td></tr>
<tr class="OutputContainer">