-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffmpeg.pddl
92 lines (85 loc) · 3.57 KB
/
ffmpeg.pddl
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
(define (domain ffmpeg)
(:requirements :equality)
(:constants Libopus Aac Libx264 Libx265)
(:predicates
(file ?f)
(input-file ?f)
(output-file ?f)
(name ?n)
(stream ?s)
(video-stream ?s)
(audio-stream ?s)
(codec ?c)
(video-codec ?c)
(audio-codec ?c)
(have ?a ?b)
(encode ?c ?s)
(opened-file ?f)
(written-file ?f)
(written ?f)
(used-name ?n)
(pending-stream ?s))
(:action OPEN_FILE
:parameters (?in ?if)
:precondition (and (input-file ?if)
(name ?in)
(have ?if ?in))
:effect (and (opened-file ?if) (used-name ?in)))
(:action MARK_STREAM
:parameters (?s)
:precondition (not (or (file ?s) (name ?s) (stream ?s) (codec ?s)))
:effect (stream ?s))
(:action MARK_AUDIO_STREAM
:parameters (?s)
:precondition (and (stream ?s)
(not (or (audio-stream ?s) (video-stream ?s))))
:effect (audio-stream ?s))
(:action MARK_VIDEO_STREAM
:parameters (?s)
:precondition (and (stream ?s)
(not (or (audio-stream ?s) (video-stream ?s))))
:effect (video-stream ?s))
(:action MARK_NAME
:parameters (?n)
:precondition (not (or (file ?n) (name ?n) (stream ?n) (codec ?n)))
:effect (name ?n))
(:action MARK_FILE
:parameters (?f)
:precondition (not (or (file ?f) (name ?f) (stream ?f) (codec ?f)))
:effect (file ?f))
(:action MARK_OUTPUT_FILE
:parameters (?of)
:precondition (and (file ?of) (not (or (output-file ?of) (input-file ?of))))
:effect (output-file ?of))
(:action MAP_AUDIO_STREAM
:parameters (?if ?is ?os)
:precondition (and (opened-file ?if) (audio-stream ?is) (audio-stream ?os)
(have ?if ?is)
(not (or (have ?if ?os) (pending-stream ?os))))
:effect (pending-stream ?os))
(:action MAP_VIDEO_STREAM
:parameters (?if ?is ?os)
:precondition (and (opened-file ?if) (video-stream ?is) (video-stream ?os)
(have ?if ?is)
(not (or (have ?if ?os) (pending-stream ?os))))
:effect (pending-stream ?os))
(:action SET_AUDIO_ENCODER
:parameters (?os ?oc)
:precondition (and (audio-codec ?oc) (audio-stream ?os) (pending-stream ?os))
:effect (encode ?oc ?os))
(:action SET_VIDEO_ENCODER
:parameters (?os ?oc)
:precondition (and (video-codec ?oc) (video-stream ?os) (pending-stream ?os))
:effect (encode ?oc ?os))
(:action WRITE_FILE
:parameters (?on ?of)
:precondition (and (name ?on) (output-file ?of)
(exists (?if) (opened-file ?if))
(not (used-name ?on))
(not (written-file ?of)))
:effect (and (have ?of ?on)
(written-file ?of)
(forall (?s)
(when (pending-stream ?s)
(and (have ?of ?s)
(not (pending-stream ?s))))))))