README.md 2.5 KB
Newer Older
Jürgen Enge's avatar
Jürgen Enge committed
1
2
# Streaming Server

Jürgen Enge's avatar
Jürgen Enge committed
3
Memoriav Media Streaming Server
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
4

Jürgen Enge's avatar
Jürgen Enge committed
5
## Installation
6
7
    go get gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server
    go build gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server/cmd/server
8
9

## Test
10
    go test gitlab.switch.ch/memoriav/memobase-2020/services/streaming-server/cmd/server
Jürgen Enge's avatar
Jürgen Enge committed
11
12
13
    
## Prerequsites

Jürgen Enge's avatar
Jürgen Enge committed
14
MariaDB/MySQL Server with table structure of [table.sql](tables.sql) 
15
  
Juergen Enge's avatar
Juergen Enge committed
16
## Server Commands
Jürgen Enge's avatar
Jürgen Enge committed
17

Juergen Enge's avatar
Juergen Enge committed
18
19
20
21
22
23
24
### clearcache    
    https://media.memobase.k8s.unibas.ch/command/clearcache?token=XXX

Token Subject: ```cmd:clearcache```
        
Clears the internal media cache of the server. 
should be done after changeing database contents.
25
    
Juergen Enge's avatar
Juergen Enge committed
26
27
28
29
30
31
32
33
34
35
### media query

    https://media.memobase.k8s.unibas.ch/memo/<signature>/<command>
  
Token Subject: ```<signature>```
  
* master
   
   Delivers the mediaserver's master object without any transformation.
   Mainly used for audio and video objects.
Jürgen Enge's avatar
Jürgen Enge committed
36
    
Juergen Enge's avatar
Juergen Enge committed
37
38
39
40
* viewer

   Displays viewer which is iFrame embeddable     
    
Juergen Enge's avatar
Juergen Enge committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
* resize
  
  Default command for image retrieval. Needs obligatory size parameter.
  
        http://localhost:88/memo/sig-5005/resize/size800x200/stretch/formatJPEG      
* iiif

  sends parameters directly to iiif image server
  
        http://localhost:88/memo/sig-5005/iiif/full/800,200/0/default.jpg
        http://localhost:88/memo/sig-5005/iiif/info.json
           
## Syntax

Juergen Enge's avatar
Juergen Enge committed
55
### Notational Conventions and Generic Grammar
Juergen Enge's avatar
Juergen Enge committed
56
57
58
59
60
Grammar is based on the Grammar used in RFC1616
https://tools.ietf.org/html/rfc2616#page-14

~~~~   
   memo_Url = serverBase "/" (dataReqest | serverCommand) 
Juergen Enge's avatar
Juergen Enge committed
61
62
   serverCommand = command-Base "/" (clearcache) token
   command-Base = TEXT
Juergen Enge's avatar
Juergen Enge committed
63
64
65
66
   clearcache = "clearcache"
   dataRequest = data-Base "/" signature "/" media-Command [token]
   data-Base = TEXT
   signature = TEXT
Juergen Enge's avatar
Juergen Enge committed
67
68
   media-Command = master | resize | iiif | viewer
   viewer = "viewer"
Juergen Enge's avatar
Juergen Enge committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
   master = "master"
   resize = "resize" "/" size ["/" (stretch | crop)] ["/" flip] ["/" format]
   size = "size" width "x" height
   width = 1*DIGIT
   height = 1*DIGIT
   stretch = "stretch"
   crop = "crop"
   flip = "flip"
   format = "format" ("PNG" ¦ "JPEG")
   iiif = "iiif" "/" (iiif-ImageRequest | iiif-InformationRequest)
   iiif-InformationRequest = "info.json"
   iiif-ImageRequest = iiifregion "/" iiifsize "/" iiifrotation "/" iiifquality "." iiifformat
      ; please refer to iiif api - https://iiif.io/api/image/2.0/#uri-syntax
   token = "?token=" HEX
~~~~    

Jürgen Enge's avatar
Jürgen Enge committed
85
    
86
### Docker
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
87
88

```sh
89
90
docker run -v<path_to_config>:/app/memostream.toml <image_name>
```