Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions recording/server.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 32 additions & 0 deletions recording/src/nextcloud/talk/recording/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 4 additions & 4 deletions recording/src/nextcloud/talk/recording/Service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down