github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/docs/content/commands/rclone_serve_dlna.md (about) 1 --- 2 date: 2019-06-20T16:09:42+01:00 3 title: "rclone serve dlna" 4 slug: rclone_serve_dlna 5 url: /commands/rclone_serve_dlna/ 6 --- 7 ## rclone serve dlna 8 9 Serve remote:path over DLNA 10 11 ### Synopsis 12 13 rclone serve dlna is a DLNA media server for media stored in a rclone remote. Many 14 devices, such as the Xbox and PlayStation, can automatically discover this server in the LAN 15 and play audio/video from it. VLC is also supported. Service discovery uses UDP multicast 16 packets (SSDP) and will thus only work on LANs. 17 18 Rclone will list all files present in the remote, without filtering based on media formats or 19 file extensions. Additionally, there is no media transcoding support. This means that some 20 players might show files that they are not able to play back correctly. 21 22 23 ### Server options 24 25 Use --addr to specify which IP address and port the server should 26 listen on, eg --addr 1.2.3.4:8000 or --addr :8080 to listen to all 27 IPs. 28 29 Use --name to choose the friendly server name, which is by 30 default "rclone (hostname)". 31 32 Use --log-trace in conjunction with -vv to enable additional debug 33 logging of all UPNP traffic. 34 35 ### Directory Cache 36 37 Using the `--dir-cache-time` flag, you can set how long a 38 directory should be considered up to date and not refreshed from the 39 backend. Changes made locally in the mount may appear immediately or 40 invalidate the cache. However, changes done on the remote will only 41 be picked up once the cache expires. 42 43 Alternatively, you can send a `SIGHUP` signal to rclone for 44 it to flush all directory caches, regardless of how old they are. 45 Assuming only one rclone instance is running, you can reset the cache 46 like this: 47 48 kill -SIGHUP $(pidof rclone) 49 50 If you configure rclone with a [remote control](/rc) then you can use 51 rclone rc to flush the whole directory cache: 52 53 rclone rc vfs/forget 54 55 Or individual files or directories: 56 57 rclone rc vfs/forget file=path/to/file dir=path/to/dir 58 59 ### File Buffering 60 61 The `--buffer-size` flag determines the amount of memory, 62 that will be used to buffer data in advance. 63 64 Each open file descriptor will try to keep the specified amount of 65 data in memory at all times. The buffered data is bound to one file 66 descriptor and won't be shared between multiple open file descriptors 67 of the same file. 68 69 This flag is a upper limit for the used memory per file descriptor. 70 The buffer will only use memory for data that is downloaded but not 71 not yet read. If the buffer is empty, only a small amount of memory 72 will be used. 73 The maximum memory used by rclone for buffering can be up to 74 `--buffer-size * open files`. 75 76 ### File Caching 77 78 These flags control the VFS file caching options. The VFS layer is 79 used by rclone mount to make a cloud storage system work more like a 80 normal file system. 81 82 You'll need to enable VFS caching if you want, for example, to read 83 and write simultaneously to a file. See below for more details. 84 85 Note that the VFS cache works in addition to the cache backend and you 86 may find that you need one or the other or both. 87 88 --cache-dir string Directory rclone will use for caching. 89 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 90 --vfs-cache-mode string Cache mode off|minimal|writes|full (default "off") 91 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 92 --vfs-cache-max-size int Max total size of objects in the cache. (default off) 93 94 If run with `-vv` rclone will print the location of the file cache. The 95 files are stored in the user cache file area which is OS dependent but 96 can be controlled with `--cache-dir` or setting the appropriate 97 environment variable. 98 99 The cache has 4 different modes selected by `--vfs-cache-mode`. 100 The higher the cache mode the more compatible rclone becomes at the 101 cost of using disk space. 102 103 Note that files are written back to the remote only when they are 104 closed so if rclone is quit or dies with open files then these won't 105 get written back to the remote. However they will still be in the on 106 disk cache. 107 108 If using --vfs-cache-max-size note that the cache may exceed this size 109 for two reasons. Firstly because it is only checked every 110 --vfs-cache-poll-interval. Secondly because open files cannot be 111 evicted from the cache. 112 113 #### --vfs-cache-mode off 114 115 In this mode the cache will read directly from the remote and write 116 directly to the remote without caching anything on disk. 117 118 This will mean some operations are not possible 119 120 * Files can't be opened for both read AND write 121 * Files opened for write can't be seeked 122 * Existing files opened for write must have O_TRUNC set 123 * Files open for read with O_TRUNC will be opened write only 124 * Files open for write only will behave as if O_TRUNC was supplied 125 * Open modes O_APPEND, O_TRUNC are ignored 126 * If an upload fails it can't be retried 127 128 #### --vfs-cache-mode minimal 129 130 This is very similar to "off" except that files opened for read AND 131 write will be buffered to disks. This means that files opened for 132 write will be a lot more compatible, but uses the minimal disk space. 133 134 These operations are not possible 135 136 * Files opened for write only can't be seeked 137 * Existing files opened for write must have O_TRUNC set 138 * Files opened for write only will ignore O_APPEND, O_TRUNC 139 * If an upload fails it can't be retried 140 141 #### --vfs-cache-mode writes 142 143 In this mode files opened for read only are still read directly from 144 the remote, write only and read/write files are buffered to disk 145 first. 146 147 This mode should support all normal file system operations. 148 149 If an upload fails it will be retried up to --low-level-retries times. 150 151 #### --vfs-cache-mode full 152 153 In this mode all reads and writes are buffered to and from disk. When 154 a file is opened for read it will be downloaded in its entirety first. 155 156 This may be appropriate for your needs, or you may prefer to look at 157 the cache backend which does a much more sophisticated job of caching, 158 including caching directory hierarchies and chunks of files. 159 160 In this mode, unlike the others, when a file is written to the disk, 161 it will be kept on the disk after it is written to the remote. It 162 will be purged on a schedule according to `--vfs-cache-max-age`. 163 164 This mode should support all normal file system operations. 165 166 If an upload or download fails it will be retried up to 167 --low-level-retries times. 168 169 170 ``` 171 rclone serve dlna remote:path [flags] 172 ``` 173 174 ### Options 175 176 ``` 177 --addr string ip:port or :port to bind the DLNA http server to. (default ":7879") 178 --dir-cache-time duration Time to cache directory entries for. (default 5m0s) 179 --dir-perms FileMode Directory permissions (default 0777) 180 --file-perms FileMode File permissions (default 0666) 181 --gid uint32 Override the gid field set by the filesystem. (default 1000) 182 -h, --help help for dlna 183 --log-trace enable trace logging of SOAP traffic 184 --name string name of DLNA server 185 --no-checksum Don't compare checksums on up/download. 186 --no-modtime Don't read/write the modification time (can speed things up). 187 --no-seek Don't allow seeking in files. 188 --poll-interval duration Time to wait between polling for changes. Must be smaller than dir-cache-time. Only on supported remotes. Set to 0 to disable. (default 1m0s) 189 --read-only Mount read-only. 190 --uid uint32 Override the uid field set by the filesystem. (default 1000) 191 --umask int Override the permission bits set by the filesystem. (default 2) 192 --vfs-cache-max-age duration Max age of objects in the cache. (default 1h0m0s) 193 --vfs-cache-max-size SizeSuffix Max total size of objects in the cache. (default off) 194 --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (default off) 195 --vfs-cache-poll-interval duration Interval to poll the cache for stale objects. (default 1m0s) 196 --vfs-read-chunk-size SizeSuffix Read the source objects in chunks. (default 128M) 197 --vfs-read-chunk-size-limit SizeSuffix If greater than --vfs-read-chunk-size, double the chunk size after each chunk read, until the limit is reached. 'off' is unlimited. (default off) 198 ``` 199 200 See the [global flags page](/flags/) for global options not listed here. 201 202 ### SEE ALSO 203 204 * [rclone serve](/commands/rclone_serve/) - Serve a remote over a protocol. 205