diff --git a/recording/server.conf.in b/recording/server.conf.in index 0e27413fe91..46b5be7628b 100644 --- a/recording/server.conf.in +++ b/recording/server.conf.in @@ -94,3 +94,18 @@ # This must be the same value as configured in the signaling server # configuration file. #internalsecret = the-shared-secret-for-internal-clients + +[ffmpeg] +# The options given to FFmpeg to encode the audio output. The options given here +# fully override the default options for the audio output. +#outputaudio = -c:a libopus + +# The options given to FFmpeg to encode the video output. The options given here +# fully override the default options for the video output. +#outputvideo = -c:v libvpx -deadline:v realtime -crf 10 -b:v 1M + +# The extension of the file for audio only recordings. +#extensionaudio = .ogg + +# The extension of the file for audio and video recordings. +#extensionvideo = .webm diff --git a/recording/src/nextcloud/talk/recording/Config.py b/recording/src/nextcloud/talk/recording/Config.py index 6ce01bd5061..e0e85beb8d1 100644 --- a/recording/src/nextcloud/talk/recording/Config.py +++ b/recording/src/nextcloud/talk/recording/Config.py @@ -204,4 +204,36 @@ def getSignalingSecret(self, signalingUrl): return self._configParser.get('signaling', 'internalsecret', fallback=None) + def getFfmpegOutputAudio(self): + """ + Returns the options given to FFmpeg to encode the audio output. + + Defaults to ['-c:a', 'libopus']. + """ + return self._configParser.get('ffmpeg', 'outputaudio', fallback='-c:a libopus').split() + + def getFfmpegOutputVideo(self): + """ + Returns the options given to FFmpeg to encode the video output. + + Defaults to ['-c:v', 'libvpx', '-deadline:v', 'realtime', '-crf', '10', '-b:v', '1M']. + """ + return self._configParser.get('ffmpeg', 'outputvideo', fallback='-c:v libvpx -deadline:v realtime -crf 10 -b:v 1M').split() + + def getFfmpegExtensionAudio(self): + """ + Returns the extension of the output file for audio recordings. + + Defaults to ".ogg". + """ + return self._configParser.get('ffmpeg', 'extensionaudio', fallback='.ogg') + + def getFfmpegExtensionVideo(self): + """ + Returns the extension of the output file for video recordings. + + Defaults to ".webm". + """ + return self._configParser.get('ffmpeg', 'extensionvideo', fallback='.webm') + config = Config() diff --git a/recording/src/nextcloud/talk/recording/Service.py b/recording/src/nextcloud/talk/recording/Service.py index 706afb68291..a3b72b33436 100644 --- a/recording/src/nextcloud/talk/recording/Service.py +++ b/recording/src/nextcloud/talk/recording/Service.py @@ -54,12 +54,12 @@ def getRecorderArgs(status, displayId, audioSinkIndex, width, height, extensionl ffmpegCommon = ['ffmpeg', '-loglevel', 'level+warning', '-n'] ffmpegInputAudio = ['-f', 'pulse', '-i', audioSinkIndex] ffmpegInputVideo = ['-f', 'x11grab', '-draw_mouse', '0', '-video_size', f'{width}x{height}', '-i', displayId] - ffmpegOutputAudio = ['-c:a', 'libopus'] - ffmpegOutputVideo = ['-c:v', 'libvpx', '-quality:v', 'realtime'] + ffmpegOutputAudio = config.getFfmpegOutputAudio() + ffmpegOutputVideo = config.getFfmpegOutputVideo() - extension = '.ogg' + extension = config.getFfmpegExtensionAudio() if status == RECORDING_STATUS_AUDIO_AND_VIDEO: - extension = '.webm' + extension = config.getFfmpegExtensionVideo() outputFileName = extensionlessOutputFileName + extension