MiroTalk SFU: Recording not possible?
-
Previously, I was using a relative path, but now I’ll switch to an absolute path. This means the recordings can also be stored directly on the server in
/root/rec.The
.envfile would look like this:RECORDING_ENABLED=true RECORDING_DIR='/root/rec' # Absolute path for recordingsSimilarly, for RTMP stream read from file:
RTMP_DIR='/root/rtmp' # Absolute path for RTMP file streamsBut agree, this needs to be tested well.
-
There are some cons to consider

Absolute Path:
Cons:- Less portable, if you move the project to another server or directory, the path may break.
- Hard-coded paths can be less flexible.
Relative Path:
Pros:- Portable, works anywhere as long as the folder structure relative to your project stays the same.
- Easier for development and version control.
I’m not entirely sure if switching to an absolute path is the best approach, maybe this could be handled on the Cloudron side instead?
By default, both paths are located in the /mirotalksfu/
app/recor/app/rtmpfolders. On Cloudron, they appear to be located at/app/code/app/recor/app/code/app/rtmpas per your previous messages? -
When i try to enable Recording via the env file, the app errors out. Main error:
{ Nov 13 19:11:04 errno: -2, Nov 13 19:11:04 code: 'ENOENT', Nov 13 19:11:04 syscall: 'mkdir', Nov 13 19:11:04 path: '/app/code/app/rec/' Nov 13 19:11:04 }So, is it not currently possible to enable Recording at all (Local/S3) ?
@shrey said in MiroTalk SFU: Recording not possible?:
{
Nov 13 19:11:04 errno: -2,
Nov 13 19:11:04 code: 'ENOENT',
Nov 13 19:11:04 syscall: 'mkdir',
Nov 13 19:11:04 path: '/app/code/app/rec/'
Nov 13 19:11:04 }I think the main issue is a missing volume mount:
- The container is trying to create
/app/code/app/rec/, but this path doesn’t exist inside the container and isn’t mapped to any mounted volume. - Since Docker containers are isolated, any folder that isn’t part of a volume or explicitly created inside the container won’t persist and may fail to be created due to permissions.
Something like:
volumes: - /mirotalksfu-path-on-cloudron/app/rec:/app/code/app/rec - /mirotalksfu-path-on-cloudron/app/rtmp:/app/code/app/rtmpThis way, both
/recand/rtmpdirectories are properly mounted and writable. - The container is trying to create
-
Thanks for all the insights here. So I think the folder to store recordings should then default to
/app/data/recor so with an option to configure that to use a different volume (not sure how large those recordings are)For
RTMP_DIRis this some kind of temporary directory and thus maybe should be configured as/tmp/...or maybe even/run/...? -
Yeah, setting the recordings directory
RECORDING_DIRto/app/data/recmakes sense. This keeps all generated recordings inside the application’s persistent data area, which is consistent and easy to manage.Regarding
RTMP_DIR, it is not a temporary directory.
This directory is used to store the media files that will be streamed via RTMP. Since these files may need to remain available for repeated or scheduled streaming, it’s better to keep them in a persistent and organized location. Can be also in/app/data/rtmpas consistent with the rest of the project’s data layout.So in summary:
-
RECORDING_DIR→/app/data/rec
Stores recordings generated by the application. -
RTMP_DIR→/app/data/rtmp
Stores video files intended for RTMP streaming, not temporary, should persist.
-
-
Implemented in MiroTalk SFU v2.0.14 —
Docker image is building now (available in ~1 hour).For Cloudron deployments, server-side recording should now work using the following configuration:
Recording
RECORDING_ENABLED=true RECORDING_DIR='../data/rec' # Path relative to /app/code → resolves to /app/data/rec RECORDING_MAX_FILE_SIZE=1073741824 # Max file size in bytes (default: 1GB)RTMP
RTMP_DIR='../data/rtmp' # Path relative to /app/code → resolves to /app/data/rtmpNote
If the target directories do not exist, MiroTalk SFU will automatically create them at runtime, just like before.
Cloudron automatically mounts
/app/data, so using../data/...ensures the app writes to the persistent, writable directory.
