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
  • 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. PeerTube
  3. Unusably Slow Playback on Peertube??

Unusably Slow Playback on Peertube??

Scheduled Pinned Locked Moved Solved PeerTube
24 Posts 4 Posters 2.6k 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.
  • subvenS subven

    @tshirt-chihuahu yeah you might be right. Just thought it could be relevant because Peertube uses a lot of federation and even torrent like downloading of videos. Normal browser playback should just work fine.

    I did something nasty...installed a Peertube on the Cloudron demo server and uploaded a video 🤡 Download speed is around 51-61KB and it does not play play well at all (30 second 18mb file). Okay after some minutes passed I got 1mbit download speed with Chrome after a page refresh but this might be because of caching. You can check it out here until someone purges the instance ^^ I know this deployment is the worst case scenario but at least I have a fresh instance that somehow behaves the same like you described.

    subvenS Offline
    subvenS Offline
    subven
    wrote on last edited by subven
    #11

    @subven said in Unusably Slow Playback on Peertube??:

    Download speed is around 51-61KB and it does not play play well at all (30 second 18mb file).

    Got it working on the Cloudron demo instance! Go into file manager and edit production.yaml. This is what I changed:

    - line 123 --> accept_from: 'nobody'
    - line 201 --> enabled: false
    - line 238 --> enabled: false

    line 130:

    tracker:
      # If you disable the tracker, you disable the P2P aspect of PeerTube
      enabled: false
    

    After disabling the tracker (and peertubes P2P function), download speed was instant and every video played just fine. If this works for you, this might be the solution! Ressource usage was standard - app memory at 512mb and redis at 150mb. No other changes made.

    girishG tshirt-chihuahuT 2 Replies Last reply
    3
    • subvenS subven

      @subven said in Unusably Slow Playback on Peertube??:

      Download speed is around 51-61KB and it does not play play well at all (30 second 18mb file).

      Got it working on the Cloudron demo instance! Go into file manager and edit production.yaml. This is what I changed:

      - line 123 --> accept_from: 'nobody'
      - line 201 --> enabled: false
      - line 238 --> enabled: false

      line 130:

      tracker:
        # If you disable the tracker, you disable the P2P aspect of PeerTube
        enabled: false
      

      After disabling the tracker (and peertubes P2P function), download speed was instant and every video played just fine. If this works for you, this might be the solution! Ressource usage was standard - app memory at 512mb and redis at 150mb. No other changes made.

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #12

      @subven Ah, good find. I had no idea P2P aspect could be disabled!

      subvenS 1 Reply Last reply
      2
      • girishG girish

        @subven Ah, good find. I had no idea P2P aspect could be disabled!

        subvenS Offline
        subvenS Offline
        subven
        wrote on last edited by
        #13

        @girish I think disabling P2P should be the standard for new Cloudron installations. Could save you lots of trouble and federation publication is off by default too.

        tshirt-chihuahuT 1 Reply Last reply
        3
        • subvenS subven

          @subven said in Unusably Slow Playback on Peertube??:

          Download speed is around 51-61KB and it does not play play well at all (30 second 18mb file).

          Got it working on the Cloudron demo instance! Go into file manager and edit production.yaml. This is what I changed:

          - line 123 --> accept_from: 'nobody'
          - line 201 --> enabled: false
          - line 238 --> enabled: false

          line 130:

          tracker:
            # If you disable the tracker, you disable the P2P aspect of PeerTube
            enabled: false
          

          After disabling the tracker (and peertubes P2P function), download speed was instant and every video played just fine. If this works for you, this might be the solution! Ressource usage was standard - app memory at 512mb and redis at 150mb. No other changes made.

          tshirt-chihuahuT Offline
          tshirt-chihuahuT Offline
          tshirt-chihuahu
          wrote on last edited by
          #14

          @subven 🔥 🔥 🔥 🔥 it worked! My test video plays instantly and smoothly now!

          🤦 face palm on my part for not looking directly for a config file to turn off federation....

          Thanks for the lift @subven This came up big!

          1 Reply Last reply
          4
          • nebulonN nebulon marked this topic as a question on
          • nebulonN nebulon has marked this topic as solved on
          • subvenS subven

            @girish I think disabling P2P should be the standard for new Cloudron installations. Could save you lots of trouble and federation publication is off by default too.

            tshirt-chihuahuT Offline
            tshirt-chihuahuT Offline
            tshirt-chihuahu
            wrote on last edited by
            #15

            @subven @girish An alternative suggestion to disabling by default: calling this setting out in the cloudron app documentation. (🤔 I'm kind of surprised this hadn't come up in the forum yet.)

            1 Reply Last reply
            1
            • jdaviescoatesJ Offline
              jdaviescoatesJ Offline
              jdaviescoates
              wrote on last edited by
              #16

              Hmm, interesting, I don't think I ever edited any config to turn any p2p or federation stuff off.

              I use Cloudron with Gandi & Hetzner

              1 Reply Last reply
              0
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #17

                Thing is we don't generally touch upstream defaults - https://github.com/Chocobozzz/PeerTube/blob/develop/config/default.yaml#L282 and https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L280 .

                I will put this in our docs.

                subvenS 1 Reply Last reply
                2
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #18

                  Added a note in https://docs.cloudron.io/apps/peertube/#disable-p2p

                  1 Reply Last reply
                  1
                  • girishG girish

                    Thing is we don't generally touch upstream defaults - https://github.com/Chocobozzz/PeerTube/blob/develop/config/default.yaml#L282 and https://github.com/Chocobozzz/PeerTube/blob/develop/config/production.yaml.example#L280 .

                    I will put this in our docs.

                    subvenS Offline
                    subvenS Offline
                    subven
                    wrote on last edited by subven
                    #19

                    @girish said in Unusably Slow Playback on Peertube??:

                    Thing is we don't generally touch upstream defaults

                    Thats a fair position. Though, I have installed a fresh peertube on my private Cloudron server, gave it enough ressources and was able to reproduce the problem. Normal playback is not possible out of the box and the P2P Webtorrent functionality seems to be the culpid. P2P works within your browser and my public (client/browser) IP is displayed correctly but I still think it has something to do with the way Cloudrons setup works.

                    Since I as a user assume that every app in the Cloudron store works without further configuration, I see a problem here. I wonder why this wasn't noticed earlier, since the P2P defaults have been in peertube for over 3 1/2 years and the app is not new at Cloudron. To make my point: Just because it works upstream as a default, does not necessarily mean it works for us ^^

                    jdaviescoatesJ 1 Reply Last reply
                    0
                    • subvenS subven

                      @girish said in Unusably Slow Playback on Peertube??:

                      Thing is we don't generally touch upstream defaults

                      Thats a fair position. Though, I have installed a fresh peertube on my private Cloudron server, gave it enough ressources and was able to reproduce the problem. Normal playback is not possible out of the box and the P2P Webtorrent functionality seems to be the culpid. P2P works within your browser and my public (client/browser) IP is displayed correctly but I still think it has something to do with the way Cloudrons setup works.

                      Since I as a user assume that every app in the Cloudron store works without further configuration, I see a problem here. I wonder why this wasn't noticed earlier, since the P2P defaults have been in peertube for over 3 1/2 years and the app is not new at Cloudron. To make my point: Just because it works upstream as a default, does not necessarily mean it works for us ^^

                      jdaviescoatesJ Offline
                      jdaviescoatesJ Offline
                      jdaviescoates
                      wrote on last edited by
                      #20

                      @subven said in Unusably Slow Playback on Peertube??:

                      @girish said in Unusably Slow Playback on Peertube??:

                      Thing is we don't generally touch upstream defaults

                      Thats a fair position. Though, I have installed a fresh peertube on my private Cloudron server, gave it enough ressources and was able to reproduce the problem. Normal playback is not possible out of the box and the P2P functionality seems to be the culpid. P2P works within your browser and my public (client/browser) IP is displayed correctly but I still think it has something to do with the way Cloudrons setup works.

                      Since I as a user assume that every app in the Cloudron store works without further configuration, I see a problem here. I wonder why this wasn't noticed earlier, since the P2P defaults have been in peertube for over 3 1/2 years and the app is not new at Cloudron. To make my point: Just because it works upstream as a default, does not necessarily mean it works for us ^^

                      I wonder why I haven't hit this issue then? Pretty sure I've not done anything to turn P2P stuff off on https://video.uniteddiversity.coop

                      I use Cloudron with Gandi & Hetzner

                      subvenS 1 Reply Last reply
                      1
                      • jdaviescoatesJ jdaviescoates

                        @subven said in Unusably Slow Playback on Peertube??:

                        @girish said in Unusably Slow Playback on Peertube??:

                        Thing is we don't generally touch upstream defaults

                        Thats a fair position. Though, I have installed a fresh peertube on my private Cloudron server, gave it enough ressources and was able to reproduce the problem. Normal playback is not possible out of the box and the P2P functionality seems to be the culpid. P2P works within your browser and my public (client/browser) IP is displayed correctly but I still think it has something to do with the way Cloudrons setup works.

                        Since I as a user assume that every app in the Cloudron store works without further configuration, I see a problem here. I wonder why this wasn't noticed earlier, since the P2P defaults have been in peertube for over 3 1/2 years and the app is not new at Cloudron. To make my point: Just because it works upstream as a default, does not necessarily mean it works for us ^^

                        I wonder why I haven't hit this issue then? Pretty sure I've not done anything to turn P2P stuff off on https://video.uniteddiversity.coop

                        subvenS Offline
                        subvenS Offline
                        subven
                        wrote on last edited by subven
                        #21

                        @jdaviescoates said in Unusably Slow Playback on Peertube??:

                        I wonder why I haven't hit this issue then?

                        P2P and Webtorrent is on by default. If I open up your video it plays nice even if it does not have direct/instant download speed but you seem to have Webtorrent disabled and use HLS instead. Try something with more bitrate like a 4K or FullHD file with 10-25mbit. Does it still work well? (I would assume yes)

                        There are different player modes depending on the P2P/Webtorrent/HLS settings (right click a playing video and choose stats for nerds to see player modes):

                        Player-Mode: HTTP
                        P2P: deactivated
                        --> Plays instant and nice but does not follow the approach of Peertube because of no P2P. This is what I considered as a workaround or "stable" default but it is not really desirable.

                        Player-Mode: p2p-media-loader
                        P2P: activated (or disabled in some cases?)
                        --> @jdaviescoates this is what your instance does. Seems to work and supports P2P so if there are no other peers, the video is downloaded just from your server. This should work for everyone and I would consider it as a good default option.

                        2022-11-25 05_17_59-Edit custom configuration - Ultratech - Peertube.png

                        Player-Mode: webtorrent
                        P2P: activated
                        --> This is the default configuration and it does not work well. Slow download and unplayable. There is also a difference if you're logged in or not. I opened a video in 5 different browser windows --> got 5 peers --> video started to download/play nicer for "everyone" but still really slow. Without another peer connected, the download is terrible (20-150kbs) so the feature works but heavily relies on federation and multiple peers which is not suitable for starters or stand alone instances.

                        2022-11-25 04_56_31-Edit custom configuration - PeerTube.png

                        Explanation at the offical documentation about webtorrent/HLS streaming.

                        You can find the UI configuration for the features here:

                        2022-11-25 04_07_19-Window.png

                        I would recommend to turn webtorrent off unless you have a huge federation and a lot of peers. Not sure if it would be okay to enable HFS as default since it requires ffmpeg but it is recommended.

                        @girish I think the docs (Disable P2P) should be adjusted since we now know that it is webtorrent and not P2P (also possible through WebRTC) in general. You can turn off webtorrent within the UI but you need to restart the app afterwards (or at least it did not switch instantly for me). The biggest problem with webtorrent on as default is that files that were uploaded with "webtorrent on / HLS off" still are "unplayable" after switching the settings. They need to be reencoded and I'm not sure if this triggers automacially or at all. I tested the behavior with two files and different settings enabled.

                        Another hurdle: From this point, all the following keys can be overridden by the web interface ~~ the modification of the following keys will have no effect starts at L360 in the example yaml. However in my production.yaml (Cloudron app) it is at L162 so you could end up doing configuration that gets ignored.

                        tshirt-chihuahuT girishG 2 Replies Last reply
                        3
                        • subvenS subven

                          @jdaviescoates said in Unusably Slow Playback on Peertube??:

                          I wonder why I haven't hit this issue then?

                          P2P and Webtorrent is on by default. If I open up your video it plays nice even if it does not have direct/instant download speed but you seem to have Webtorrent disabled and use HLS instead. Try something with more bitrate like a 4K or FullHD file with 10-25mbit. Does it still work well? (I would assume yes)

                          There are different player modes depending on the P2P/Webtorrent/HLS settings (right click a playing video and choose stats for nerds to see player modes):

                          Player-Mode: HTTP
                          P2P: deactivated
                          --> Plays instant and nice but does not follow the approach of Peertube because of no P2P. This is what I considered as a workaround or "stable" default but it is not really desirable.

                          Player-Mode: p2p-media-loader
                          P2P: activated (or disabled in some cases?)
                          --> @jdaviescoates this is what your instance does. Seems to work and supports P2P so if there are no other peers, the video is downloaded just from your server. This should work for everyone and I would consider it as a good default option.

                          2022-11-25 05_17_59-Edit custom configuration - Ultratech - Peertube.png

                          Player-Mode: webtorrent
                          P2P: activated
                          --> This is the default configuration and it does not work well. Slow download and unplayable. There is also a difference if you're logged in or not. I opened a video in 5 different browser windows --> got 5 peers --> video started to download/play nicer for "everyone" but still really slow. Without another peer connected, the download is terrible (20-150kbs) so the feature works but heavily relies on federation and multiple peers which is not suitable for starters or stand alone instances.

                          2022-11-25 04_56_31-Edit custom configuration - PeerTube.png

                          Explanation at the offical documentation about webtorrent/HLS streaming.

                          You can find the UI configuration for the features here:

                          2022-11-25 04_07_19-Window.png

                          I would recommend to turn webtorrent off unless you have a huge federation and a lot of peers. Not sure if it would be okay to enable HFS as default since it requires ffmpeg but it is recommended.

                          @girish I think the docs (Disable P2P) should be adjusted since we now know that it is webtorrent and not P2P (also possible through WebRTC) in general. You can turn off webtorrent within the UI but you need to restart the app afterwards (or at least it did not switch instantly for me). The biggest problem with webtorrent on as default is that files that were uploaded with "webtorrent on / HLS off" still are "unplayable" after switching the settings. They need to be reencoded and I'm not sure if this triggers automacially or at all. I tested the behavior with two files and different settings enabled.

                          Another hurdle: From this point, all the following keys can be overridden by the web interface ~~ the modification of the following keys will have no effect starts at L360 in the example yaml. However in my production.yaml (Cloudron app) it is at L162 so you could end up doing configuration that gets ignored.

                          tshirt-chihuahuT Offline
                          tshirt-chihuahuT Offline
                          tshirt-chihuahu
                          wrote on last edited by tshirt-chihuahu
                          #22

                          @subven thanks a lot for helping us get to the bottom of this.

                          The webtorrent selection UI in the settings is a bit odd (and the peertube documentation has no search functionality), so your writeup should hopefully help any future travelers figure it out.

                          🔥 I was able to find the the relevant section in the Peertube Docs now that explains these options a bit. HLS is actually the recommended setting by them as well:

                          We recommend you to enable HLS (and disable WebTorrent if you don't want to store 2 different versions of the same video resolution) because video playback is really better

                          https://docs.joinpeertube.org/admin-configuration?id=webtorrent-transcoding-or-hls-transcoding

                          1 Reply Last reply
                          2
                          • subvenS subven

                            @jdaviescoates said in Unusably Slow Playback on Peertube??:

                            I wonder why I haven't hit this issue then?

                            P2P and Webtorrent is on by default. If I open up your video it plays nice even if it does not have direct/instant download speed but you seem to have Webtorrent disabled and use HLS instead. Try something with more bitrate like a 4K or FullHD file with 10-25mbit. Does it still work well? (I would assume yes)

                            There are different player modes depending on the P2P/Webtorrent/HLS settings (right click a playing video and choose stats for nerds to see player modes):

                            Player-Mode: HTTP
                            P2P: deactivated
                            --> Plays instant and nice but does not follow the approach of Peertube because of no P2P. This is what I considered as a workaround or "stable" default but it is not really desirable.

                            Player-Mode: p2p-media-loader
                            P2P: activated (or disabled in some cases?)
                            --> @jdaviescoates this is what your instance does. Seems to work and supports P2P so if there are no other peers, the video is downloaded just from your server. This should work for everyone and I would consider it as a good default option.

                            2022-11-25 05_17_59-Edit custom configuration - Ultratech - Peertube.png

                            Player-Mode: webtorrent
                            P2P: activated
                            --> This is the default configuration and it does not work well. Slow download and unplayable. There is also a difference if you're logged in or not. I opened a video in 5 different browser windows --> got 5 peers --> video started to download/play nicer for "everyone" but still really slow. Without another peer connected, the download is terrible (20-150kbs) so the feature works but heavily relies on federation and multiple peers which is not suitable for starters or stand alone instances.

                            2022-11-25 04_56_31-Edit custom configuration - PeerTube.png

                            Explanation at the offical documentation about webtorrent/HLS streaming.

                            You can find the UI configuration for the features here:

                            2022-11-25 04_07_19-Window.png

                            I would recommend to turn webtorrent off unless you have a huge federation and a lot of peers. Not sure if it would be okay to enable HFS as default since it requires ffmpeg but it is recommended.

                            @girish I think the docs (Disable P2P) should be adjusted since we now know that it is webtorrent and not P2P (also possible through WebRTC) in general. You can turn off webtorrent within the UI but you need to restart the app afterwards (or at least it did not switch instantly for me). The biggest problem with webtorrent on as default is that files that were uploaded with "webtorrent on / HLS off" still are "unplayable" after switching the settings. They need to be reencoded and I'm not sure if this triggers automacially or at all. I tested the behavior with two files and different settings enabled.

                            Another hurdle: From this point, all the following keys can be overridden by the web interface ~~ the modification of the following keys will have no effect starts at L360 in the example yaml. However in my production.yaml (Cloudron app) it is at L162 so you could end up doing configuration that gets ignored.

                            girishG Offline
                            girishG Offline
                            girish
                            Staff
                            wrote on last edited by
                            #23

                            @subven Oh, I forgot to act on your suggestion. I will go ahead and disable webtorrent in the next package release.

                            1 Reply Last reply
                            3
                            • tshirt-chihuahuT Offline
                              tshirt-chihuahuT Offline
                              tshirt-chihuahu
                              wrote on last edited by
                              #24

                              Also, for those that don't know what HLS is (I didn't prior to running into this issue), here's a link to get you started with "HTTP Live Streaming":

                              **Adaptability **
                              To enable a player to adapt to the bandwidth of the network, the original video is encoded in several distinct quality levels. The server serves an index, called a "master playlist", of these encodings, called "variant streams". The player can then choose between the variant streams during playback, changing back and forth seamlessly as network conditions change.

                              https://en.wikipedia.org/wiki/HTTP_Live_Streaming#Adaptability

                              1 Reply Last reply
                              1
                              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