Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. MiroTalk
  3. MiroTalk SFU: Recording not possible?

MiroTalk SFU: Recording not possible?

Scheduled Pinned Locked Moved Unsolved MiroTalk
17 Posts 4 Posters 81 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MiroTalkM Away
    MiroTalkM Away
    MiroTalk
    wrote last edited by MiroTalk
    #4

    MiroTalk SFU – Recording Options

    MiroTalk SFU offers 4 ways to record sessions:


    1. Client-Side Recording (Default)

    • Recording happens in the browser.
    • Stored temporarily in a Blob.
    • Once the session ends, the recording can be saved locally by the user.

    2. Server-Side Recording (Local Storage)

    • Recording is saved directly to the server at app/rec/.
    • Enable it by setting in your .env:
    RECORDING_ENABLED=true
    

    Note:
    If using Docker, make sure to mount the volume and ensure the directory exists:

    volumes:
      - ./app/rec:/src/app/rec
    

    server-rec.png


    3. Upload Recording to AWS S3

    • Recordings can be automatically uploaded to an AWS S3 bucket.
    • Enable S3 upload in your .env:
    RECORDING_UPLOAD_TO_S3=true
    
    • S3 Configuration:
    AWS_S3_ENABLED=true                  # Enable AWS S3 storage (true|false)  
    AWS_S3_BUCKET_NAME=mirotalk          # Name of your existing S3 bucket  
    AWS_ACCESS_KEY_ID=                   # AWS Access Key ID (optional if using IAM roles)  
    AWS_SECRET_ACCESS_KEY=               # AWS Secret Access Key (optional if using IAM roles)  
    AWS_REGION=                          # AWS region (e.g., us-east-2, eu-west-2)  
    

    4. Custom Endpoint for Recording Sync

    • You can send recordings to a custom endpoint of your choice.
    • Configure in .env:
    RECORDING_ENDPOINT=http://localhost:8080
    

    Check out: https://github.com/miroslavpejic85/mirotalksfu/tree/main/cloud

    1 Reply Last reply
    2
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote last edited by james
      #5

      I was just writing @mirotalk-57bab571 and wanted to ask you, so good that you are already here.

      Seems like dir is static:
      https://github.com/miroslavpejic85/mirotalksfu/blob/ddb451e7e1ce715120ae47d1fe9b172211602334/app/src/config.template.js#L180-L186

              recording: {
                  enabled: process.env.RECORDING_ENABLED === 'true',
                  uploadToS3: process.env.RECORDING_UPLOAD_TO_S3 === 'true',
                  endpoint: process.env.RECORDING_ENDPOINT || '',
                  dir: 'rec',
                  maxFileSize: 1 * 1024 * 1024 * 1024, // 1GB
              }
      

      Should I create a feature request to make dir also configurable? I can also change the cloudron app to change the dir to /app/data/rec/.

      1 Reply Last reply
      0
      • MiroTalkM Away
        MiroTalkM Away
        MiroTalk
        wrote last edited by
        #6

        Should I create a feature request to make dir also configurable? I can also change the cloudron app to change the dir to /app/data/rec/.

        Thanks for the suggestion! The recording directory will be configurable in the next release.

        1 Reply Last reply
        1
        • jamesJ Offline
          jamesJ Offline
          james
          Staff
          wrote last edited by james
          #7

          Hello @mirotalk-57bab571
          Very nice, thanks for that.
          Just as a cautious note, currently when setting dir to /app/data/rec it tries to store into /app/code/app/app/data/rec/ so it does not handle a full path but instead appends it to /app/code/app/.
          Also, what needs to be configurable is the path of dir of rtmp:

                  rtmp: {
                      enabled: process.env.RTMP_ENABLED === 'true',
                      fromFile: process.env.RTMP_FROM_FILE !== 'false',
                      fromUrl: process.env.RTMP_FROM_URL !== 'false',
                      fromStream: process.env.RTMP_FROM_STREAM !== 'false',
                      maxStreams: parseInt(process.env.RTMP_MAX_STREAMS) || 1,
                      useNodeMediaServer: process.env.RTMP_USE_NODE_MEDIA_SERVER !== 'false',
                      server: process.env.RTMP_SERVER || 'rtmp://localhost:1935',
                      appName: process.env.RTMP_APP_NAME || 'live',
                      streamKey: process.env.RTMP_STREAM_KEY || '',
                      secret: process.env.RTMP_SECRET || 'mirotalkRtmpSecret',
                      apiSecret: process.env.RTMP_API_SECRET || 'mirotalkRtmpApiSecret',
                      expirationHours: parseInt(process.env.RTMP_EXPIRATION_HOURS) || 4,
                      dir: 'rtmp',
                      ffmpegPath: RTMP_FFMPEG_PATH,
                      platform: PLATFORM,
                  }
          

          @shrey this means currently server-side recording is somewhat broken for the Cloudron app since the dir can't be configured.

          1 Reply Last reply
          0
          • MiroTalkM Away
            MiroTalkM Away
            MiroTalk
            wrote last edited by MiroTalk
            #8

            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 .env file would look like this:

            RECORDING_ENABLED=true
            RECORDING_DIR='/root/rec'   # Absolute path for recordings
            

            Similarly, for RTMP stream read from file:

            RTMP_DIR='/root/rtmp'       # Absolute path for RTMP file streams
            

            But agree, this needs to be tested well.

            1 Reply Last reply
            1
            • MiroTalkM Away
              MiroTalkM Away
              MiroTalk
              wrote last edited by MiroTalk
              #9

              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/rec or /app/rtmp folders. On Cloudron, they appear to be located at /app/code/app/rec or /app/code/app/rtmp as per your previous messages?

              1 Reply Last reply
              1
              • S shrey

                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) ?

                MiroTalkM Away
                MiroTalkM Away
                MiroTalk
                wrote last edited by
                #10

                @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/rtmp
                

                This way, both /rec and /rtmp directories are properly mounted and writable.

                1 Reply Last reply
                0
                • MiroTalkM Away
                  MiroTalkM Away
                  MiroTalk
                  wrote last edited by
                  #11

                  Ok from what understand: Cloudron allows writing only to /app/data, while /app/code is read-only, so all dynamic folders (rec, rtmp, uploads, etc.) must be moved into /app/data.

                  1 Reply Last reply
                  0
                  • nebulonN Offline
                    nebulonN Offline
                    nebulon
                    Staff
                    wrote last edited by
                    #12

                    Thanks for all the insights here. So I think the folder to store recordings should then default to /app/data/rec or so with an option to configure that to use a different volume (not sure how large those recordings are)

                    For RTMP_DIR is this some kind of temporary directory and thus maybe should be configured as /tmp/... or maybe even /run/... ?

                    1 Reply Last reply
                    0
                    • MiroTalkM Away
                      MiroTalkM Away
                      MiroTalk
                      wrote last edited by MiroTalk
                      #13

                      Yeah, setting the recordings directory RECORDING_DIR to /app/data/rec makes 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/rtmp as 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.

                      1 Reply Last reply
                      0
                      • nebulonN Offline
                        nebulonN Offline
                        nebulon
                        Staff
                        wrote last edited by
                        #14

                        perfect, I will prepare a package update then. So just to double check, this only applies to the SFU flavor of mirotalk?

                        1 Reply Last reply
                        0
                        • MiroTalkM Away
                          MiroTalkM Away
                          MiroTalk
                          wrote last edited by
                          #15

                          perfect, I will prepare a package update then. So just to double check, this only applies to the SFU flavor of mirotalk?

                          WIP on MiroTalk SFU: Let me fix this first, then I’ll ping you when done 🙂

                          1 Reply Last reply
                          1
                          • nebulonN Offline
                            nebulonN Offline
                            nebulon
                            Staff
                            wrote last edited by
                            #16

                            in case your code would ensure the paths via "mkdirp()" it would make the package code easier 🙂

                            1 Reply Last reply
                            1
                            • MiroTalkM Away
                              MiroTalkM Away
                              MiroTalk
                              wrote last edited by MiroTalk
                              #17

                              @nebulon @James @shrey

                              Implemented in MiroTalk SFU v2.0.14 — Docker image is building now (available in ~1 hour).

                              • Commit
                              • Build

                              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/rtmp
                              

                              Note

                              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.

                              1 Reply Last reply
                              6
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Bookmarks
                              • Search