README.md 2.8 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
* viewer

Juergen Enge's avatar
Juergen Enge committed
39
40
41
   Displays viewer which is iFrame embeddable  
   Signature of Poster Image for Video/Audio-Player: `<signature>-poster`
      
Juergen Enge's avatar
Juergen Enge committed
42
    
Juergen Enge's avatar
Juergen Enge committed
43
44
45
46
47
* resize
  
  Default command for image retrieval. Needs obligatory size parameter.
  
        http://localhost:88/memo/sig-5005/resize/size800x200/stretch/formatJPEG      
Juergen Enge's avatar
Juergen Enge committed
48
        http://localhost:88/memo/sig-5005/resize/size800x200/stretch/formatJPEG/fallbacksig-5006      
Juergen Enge's avatar
Juergen Enge committed
49
50
51
52
53
54
55
56
57
* 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
58
### Notational Conventions and Generic Grammar
Juergen Enge's avatar
Juergen Enge committed
59
60
61
62
63
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
64
65
   serverCommand = command-Base "/" (clearcache) token
   command-Base = TEXT
Juergen Enge's avatar
Juergen Enge committed
66
67
68
69
   clearcache = "clearcache"
   dataRequest = data-Base "/" signature "/" media-Command [token]
   data-Base = TEXT
   signature = TEXT
Juergen Enge's avatar
Juergen Enge committed
70
   media-Command = master | resize | iiif | viewer
Juergen Enge's avatar
Juergen Enge committed
71
72
73
74
   viewer = "viewer" ["/" fallback] 
   master = "master" ["/" fallback]
   resize = "resize" "/" size ["/" (stretch | crop)] ["/" flip] ["/" format] ["/" fallback]
   manifest = "manifest" ["/" fallback]
Juergen Enge's avatar
Juergen Enge committed
75
76
77
78
79
80
   size = "size" width "x" height
   width = 1*DIGIT
   height = 1*DIGIT
   stretch = "stretch"
   crop = "crop"
   flip = "flip"
Juergen Enge's avatar
Juergen Enge committed
81
82
   format = "format" ("PNG" | "JPEG")
   fallback = "fallback" signature
Juergen Enge's avatar
Juergen Enge committed
83
84
85
86
87
88
89
   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
90
    
91
### Docker
Sebastian Schüpbach's avatar
Sebastian Schüpbach committed
92
93

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