added PRIORITIZE_H264 env
while recording, mirotalk selects vp9,vp8 then goes to h264. most of the modern browsers support vp9/vp8, but vp9/vp8 becomes issue when postprocessing, hardware accelerated decoding is limited for vp9/vp8, so this env will prioritize h264/aac before moving to other possibilities.
This commit is contained in:
+5
-1
@@ -107,4 +107,8 @@ CHATGPT_BASE_PATH=https://api.openai.com/v1/
|
||||
CHATGTP_APIKEY=YourOpenAiApiKey
|
||||
CHATGPT_MODEL=text-davinci-003
|
||||
CHATGPT_MAX_TOKENS=1000
|
||||
CHATGPT_TEMPERATURE=0
|
||||
CHATGPT_TEMPERATURE=0
|
||||
|
||||
# give priority to h264/aac when
|
||||
# recording screen
|
||||
PRIORITIZE_H264=false # true or false
|
||||
@@ -206,6 +206,9 @@ if (configChatGPT.enabled) {
|
||||
}
|
||||
}
|
||||
|
||||
// make sure we prioritize h264/aac when recording screen
|
||||
const isPrioritizeH264 = getEnvBoolean(process.env.PRIORITIZE_H264)
|
||||
|
||||
// directory
|
||||
const dir = {
|
||||
public: path.join(__dirname, '../../', 'public'),
|
||||
@@ -835,6 +838,7 @@ io.sockets.on('connect', async (socket) => {
|
||||
active: redirectEnabled,
|
||||
url: redirectURL,
|
||||
},
|
||||
is_prioritize_h264: isPrioritizeH264,
|
||||
//...
|
||||
});
|
||||
});
|
||||
|
||||
+11
-3
@@ -496,6 +496,7 @@ let swBg = 'rgba(0, 0, 0, 0.7)'; // swAlert background color
|
||||
let callElapsedTime; // count time
|
||||
let mySessionTime; // conference session time
|
||||
let isDocumentOnFullScreen = false;
|
||||
let isPrioritizeH264 = false;
|
||||
|
||||
// peer
|
||||
let myPeerId; // This socket.id
|
||||
@@ -1126,7 +1127,7 @@ async function handleConnect() {
|
||||
function handleServerInfo(config) {
|
||||
console.log('13. Server info', config);
|
||||
|
||||
const { peers_count, host_protected, user_auth, is_presenter, survey, redirect } = config;
|
||||
const { peers_count, host_protected, user_auth, is_presenter, survey, redirect, is_prioritize_h264 } = config;
|
||||
|
||||
isHostProtected = host_protected;
|
||||
isPeerAuthEnabled = user_auth;
|
||||
@@ -1147,6 +1148,9 @@ function handleServerInfo(config) {
|
||||
isPresenter = isPeerReconnected ? isPresenter : is_presenter;
|
||||
isPeerPresenter.innerText = isPresenter;
|
||||
|
||||
// prioritize h264
|
||||
isPrioritizeH264 = is_prioritize_h264;
|
||||
|
||||
if (isRulesActive) {
|
||||
handleRules(isPresenter);
|
||||
}
|
||||
@@ -5745,10 +5749,14 @@ function getSupportedMimeTypes() {
|
||||
const possibleTypes = [
|
||||
'video/webm;codecs=vp9,opus',
|
||||
'video/webm;codecs=vp8,opus',
|
||||
'video/webm;codecs=h264,opus',
|
||||
'video/mp4;codecs=h264,aac',
|
||||
'video/mp4',
|
||||
];
|
||||
possibleTypes.splice(
|
||||
isPrioritizeH264 ? 0 : 2,
|
||||
0,
|
||||
'video/mp4;codecs=h264,aac',
|
||||
'video/webm;codecs=h264,opus'
|
||||
);
|
||||
return possibleTypes.filter((mimeType) => {
|
||||
return MediaRecorder.isTypeSupported(mimeType);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user