jitsi / jibri

Jitsi BRoadcasting Infrastructure
Apache License 2.0
600 stars 315 forks source link

Record audio only #501

Open rafael2k opened 1 year ago

rafael2k commented 1 year ago

Is there a way to make an audio-only recording?

(of course I could just change ffmpeg paramets in Command.kt ...)

saghul commented 1 year ago

No, there currently is no way to do an audio only recording.

rafael2k commented 1 year ago

I was thinking how to implement it. With correct audio routing through alsa loopback, I think it would be possible to run N recordings with the same jibri instance, by firing different chrome drivers outputting audio to different loopback devices.

rafael2k commented 1 year ago

I implemented it as hardcoded in ffmpeg command call. I wonder which names would be appropriate to make a PR? audio-only=[true,false] audio-codec=[mp3,weba(opus),oga(opus)] audio-bitrate=[in kbps] ? https://github.com/ColmenaDev/jibri/

rafael2k commented 1 year ago

As a start we could only have "audio-only" and thing. I also added streaming support, but the could be in a latter stage.

emrahcom commented 1 year ago

I do this by using a fake ffmpeg

/usr/local/bin/ffmpeg

#!/bin/bash

ARGS=$@

[[ "$(whoami)" != "jibri" ]] && exec /usr/bin/ffmpeg $ARGS

DEST=$(echo $ARGS | egrep -o "\S*mp4$")

if [[ -n "$DEST" ]]; then
    exec /usr/bin/ffmpeg -y -v info -f alsa -thread_queue_size 4096 -i plug:bsnoop \
         -acodec aac -strict -2 -ar 44100 -b:a 128k -af aresample=async=1 \
         -vn -f mp4 $DEST
else
    exec /usr/bin/ffmpeg $ARGS
fi