-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.sql
executable file
·332 lines (217 loc) · 8.29 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
BEGIN;
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: encode_formats_id_seq1; Type: SEQUENCE; Schema: public
--
CREATE SEQUENCE encode_formats_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: encode_formats; Type: TABLE; Schema: public; Tablespace:
--
CREATE TABLE encode_formats (
id integer DEFAULT nextval('encode_formats_id_seq'::regclass) NOT NULL,
format_name text NOT NULL,
container text NOT NULL,
video_bitrate integer NOT NULL,
video_bitrate_tolerance integer NOT NULL,
video_codec text NOT NULL,
video_resolution text NOT NULL,
audio_bitrate integer NOT NULL,
audio_samplerate integer NOT NULL,
audio_codec text NOT NULL,
vpre_string text,
aspect_ratio text NOT NULL,
args_beginning text,
args_video text,
args_audio text,
args_end text,
apply_mp4box boolean DEFAULT false NOT NULL,
file_extension character varying(5) DEFAULT 'mp4'::character varying NOT NULL,
preset_string character varying DEFAULT '-preset slow'::character varying,
normalise_level integer,
ef_priority integer NOT NULL,
pass integer DEFAULT 2
);
--
-- Name: TABLE encode_formats; Type: COMMENT; Schema: public
--
COMMENT ON TABLE encode_formats IS 'Stores ffmpeg options for the Encode Formats for EncodeSrv';
--
-- Name: COLUMN encode_formats.format_name; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.format_name IS 'Name of the format (e.g. ipod)';
--
-- Name: COLUMN encode_formats.container; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.container IS 'name of the container (e.g. mp4)';
--
-- Name: COLUMN encode_formats.video_bitrate; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.video_bitrate IS 'video bitrate (in b/sec)';
--
-- Name: COLUMN encode_formats.video_bitrate_tolerance; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.video_bitrate_tolerance IS 'video bitrate tolerance (in b/sec)';
--
-- Name: COLUMN encode_formats.video_codec; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.video_codec IS 'video codec (e.g. libx264)';
--
-- Name: COLUMN encode_formats.video_resolution; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.video_resolution IS 'Video resolution (e.g. 320x180)';
--
-- Name: COLUMN encode_formats.audio_bitrate; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.audio_bitrate IS 'audio bitrate (in b/sec)';
--
-- Name: COLUMN encode_formats.audio_samplerate; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.audio_samplerate IS 'audio samplerate (in Hz)';
--
-- Name: COLUMN encode_formats.audio_codec; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.audio_codec IS 'audio codec (e.g libfaac)';
--
-- Name: COLUMN encode_formats.vpre_string; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.vpre_string IS 'optional list of -vpre args (e.g. -vpre hq -vpre normal -vpre ipod320)';
--
-- Name: COLUMN encode_formats.aspect_ratio; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.aspect_ratio IS 'aspect ratio (e.g. 16:9)';
--
-- Name: COLUMN encode_formats.args_beginning; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.args_beginning IS 'optional extra args to put at beginning of command';
--
-- Name: COLUMN encode_formats.args_video; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.args_video IS 'optional extra args to put after video options';
--
-- Name: COLUMN encode_formats.args_audio; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.args_audio IS 'optional extra args to put after audio options';
--
-- Name: COLUMN encode_formats.args_end; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.args_end IS 'optional extra args to put at the end';
--
-- Name: COLUMN encode_formats.apply_mp4box; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.apply_mp4box IS 'Indicates whether the output file should be run through MP4Box. Note this should only be applied to MP4 formats.';
--
-- Name: COLUMN encode_formats.file_extension; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.file_extension IS 'Extension of the resulting file. (e.g. mp4, avi, mov etc). Note this can be different from the container value';
--
-- Name: COLUMN encode_formats.ef_priority; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.ef_priority IS 'Default priority for this format';
--
-- Name: COLUMN encode_formats.pass; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_formats.pass IS 'Whether the format is 1 or 2 pass';
--
-- Name: encode_formats_id_seq; Type: SEQUENCE OWNED BY; Schema: public
--
ALTER SEQUENCE encode_formats_id_seq OWNED BY encode_formats.id;
--
-- Name: encode_formats_pkey; Type: CONSTRAINT; Schema: public; Tablespace:
--
ALTER TABLE ONLY encode_formats
ADD CONSTRAINT encode_formats_pkey PRIMARY KEY (id);
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: encode_jobs_id_seq; Type: SEQUENCE; Schema: public
--
CREATE SEQUENCE encode_jobs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: encode_jobs; Type: TABLE; Schema: public; Tablespace:
--
CREATE TABLE encode_jobs (
id integer DEFAULT nextval('encode_jobs_id_seq'::regclass) NOT NULL,
source_file text NOT NULL,
destination_file text NOT NULL,
format_id integer NOT NULL,
status character varying(64) NOT NULL,
video_id integer,
working_directory text,
user_id integer,
priority numeric DEFAULT 5 NOT NULL
);
--
-- Name: TABLE encode_jobs; Type: COMMENT; Schema: public
--
COMMENT ON TABLE encode_jobs IS 'Stores the Encode Jobs for EncodeSrv';
--
-- Name: COLUMN encode_jobs.source_file; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.source_file IS 'Path to source file (e.g. /mnt/UserData/Shows/ManMan/Ep1/10_Man-Man-episode1_sum06.avi)';
--
-- Name: COLUMN encode_jobs.destination_file; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.destination_file IS 'Path to destination file (e.g. /mnt/videos/web/ipod/10_Man-Man-episode1_sum06.mp4) ';
--
-- Name: COLUMN encode_jobs.format_id; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.format_id IS 'ID to identify format type';
--
-- Name: COLUMN encode_jobs.status; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.status IS 'Indicates progress of the encode job. ';
--
-- Name: COLUMN encode_jobs.video_id; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.video_id IS 'ID of the relevant video_id. These entires are filled in before the video actaully exists. ';
--
-- Name: COLUMN encode_jobs.working_directory; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.working_directory IS 'Stores the working directory once a job has started';
--
-- Name: COLUMN encode_jobs.user_id; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.user_id IS 'ID of the user that requested the job';
--
-- Name: COLUMN encode_jobs.priority; Type: COMMENT; Schema: public
--
COMMENT ON COLUMN encode_jobs.priority IS 'Mainly for batch encode jobs like re-encodes. Could be used for giving certain events higher priority. Defaults to 5. Higher numbers = higher priority';
--
-- Name: encode_jobs_pkey; Type: CONSTRAINT; Schema: public; Tablespace:
--
ALTER TABLE ONLY encode_jobs
ADD CONSTRAINT encode_jobs_pkey PRIMARY KEY (id);
--
-- Name: encode_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public
--
ALTER SEQUENCE encode_jobs_id_seq OWNED BY encode_jobs.id;
--
-- Name: encode_jobs_format_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: robert
--
ALTER TABLE ONLY encode_jobs
ADD CONSTRAINT encode_jobs_format_id_fkey FOREIGN KEY (format_id) REFERENCES encode_formats(id) ON UPDATE CASCADE;
COMMIT;