08ef90af96f5deadb08121cc73c69d049511df82
[dcpomatic.git] / doc / design / vob.tex
1 \documentclass{article}
2 \title{VOBs}
3 \author{}
4 \date{}
5 \begin{document}
6 \maketitle
7
8 VOB files are tricky.  They appear to be components of a complete
9 media file which have been chopped up with no regard for packets.
10 Therefore they must be interpreted as if they had been joined together
11 with \texttt{cat}.
12
13 This is true, at least, with one test (``The Blues Brothers'' DVD)
14 which has its first VOB-to-VOB transition when Elwood looks at the
15 `Murph and the Magictones' business card.
16
17 Solutions:
18 \begin{enumerate}
19 \item Fiddle the decoders so that they pass on bits of packets
20   to the next decoder in line; this appears to be difficult.
21 \item Coalesce VOB files into one big `file' (or virtual file)
22   for feeding to FFmpeg.
23 \end{enumerate}
24
25 The second solution is easy enough to do, but the UI is tricky.  As
26 far as I can see the user has explicitly to request this behaviour, as
27 coalescing two normal video files will cause problems.  If they do
28 request it, how should it be represented?
29
30 \begin{enumerate}
31 \item In the UI?
32 \begin{enumerate}
33 \item Select VOBs and coalesce or
34 \item Coalese all files by some switch?
35 \end{enumerate}
36 \item In the back-end?
37 \begin{enumerate}
38 \item A single \texttt{Content} has multiple files or
39 \item A single \texttt{Decoder} has multiple \texttt{Content}s.
40 \end{enumerate}
41 \end{enumerate}
42
43 UI-wise, there will have to be some heuristic or nudging to get the
44 user to do the right thing.  It probably does not matter.
45
46 The back-end is trickier.  There is currently a 1:1 map of back-end
47 content to UI content.  To preserve that, we would have to:
48
49 \begin{enumerate}
50 \item Have some hierarchy to enable grouped content (so that 1:1
51   decoder--content is preserved).  This removes the 1:1 between
52   content and file, which is nice for everything except this
53   special (nasty) VOB case.
54 \item Allow a single decoder to manage multiple pieces of content.
55   The problem with this is that the \texttt{Player} has
56   \texttt{Piece}s, which are 1:1 decoder--content maps.  1--many for
57   decoder--content screws anything done with \texttt{Piece}s --- seek
58   (at least).
59 \end{enumerate}
60
61 Probably have to think about this from the UI point of view; first,
62 the user adds 4 VOB files (1 by 1) which should eventually be
63 coalesced.  Either:
64
65 \begin{enumerate}
66 \item They are coalesced magically with a switch, or
67 \item The user must specifically coalesce them, and then the result
68   must be reflected in the UI.
69 \end{enumerate}
70
71 The first option could be done in the \texttt{Player} if it created
72 whatever it wanted in the back-end.  It would either coalesce content
73 or make the decoder handle multiple content; the former would preserve
74 the \texttt{Piece} stuff.
75
76 \end{document}