change the package "pretty name" to CDimg|tools
[cdimgtools.git] / cssdec.1.txt
blob983a5269a638e20af75bf28988add1f31ef80057
1 // cssdec.1.txt - manual page documenting the program cssdec
2 // Copyright © 2012 Géraud Meyer
3 //   This file is part of cssdec.
4 //
5 //   This file is released under the same licensing terms as the source code of
6 //   the program which it documents; see the header of the file cssdec.c.
8 CSSDEC(1)
9 =========
10 :doctype: manpage
13 NAME
14 ----
15 cssdec - simple CSS descrambler using libdvdcss
18 SYNOPSIS
19 --------
20 [verse]
21 *cssdec* *-V*
22 *cssdec* ['options'] [*--*]  'target' ['start_sector' ['end_sector']]
23 *cssdec* *-k* ['options'] [*--*]  'target' ['start_sector']
26 DESCRIPTION
27 -----------
28 `cssdec` is a command line program to decrypt sectors of CSS scrambled VOB
29 files.  The processed data is output on stdout.
31 `cssdec` uses libdvdcss directly, and passes it 'target' as is.  'target' can
32 be a drive device file or a normal file.
34 The chosen block to be decrypted should be a VOB stream encrypted with a single
35 key; it can be a whole video file copied as is from a mounted DVD disc, or a
36 range of sectors of a DVD disc (or of an image thereof) containing a single
37 title (or menu).  The sector numbers are computed from the command line
38 arguments by the function strtol(3).
40 The title key used to decrypt the VOB stream is obtained by libdvdcss.
43 OPTIONS
44 -------
45 *-V*::
46         Print the version information and exit.
48 *-v*, *-q*::
49         Increase or decrease the level of verbosity of messages printed to stderr.
50         The default level is 1, at which only error messages are printed.  At level
51         0 nothing is printed.  At level 2, a summary as well as some additional
52         messages for noticeable events are printed.  At level 3, information about
53         every processed sector is printed.
55 *-e*::
56         Modify the exit status as if a read error occured when EOF is reached
57         before the end of the given sector range.
59 *-o* 'output_file'::
60         Write to the given file instead of the standard output.
62 *-a*::
63         Open the output file in append mode.
65 *-k*::
66         Key only mode: exit right after libdvdcss has tried to obtain the title key.
69 ENVIRONMENT VARIABLES
70 ---------------------
71 DVDCSS_*::
72         libdvdcss' environment variables.
73         Setting `DVDCSS_VERBOSE=2` in the environment will make libdvdcss print the
74         title key found.
77 FILES
78 -----
79 ~/.dvdcss::
80         libdvdcss' default cache directory for the title keys.  The cache is used
81         only if the input 'target' is a DVD Video disc (or image file).  Setting
82         `DVDCSS_CACHE=off` in the environment disables the use of the cache.
85 EXIT STATUS
86 -----------
87 To be interpreted as a bitmask, where each bit set indicates a failure.
88 Because a usage error always sets all the other bits, the values between 128
89 and 254 remain unused; they constitute a range often used by shells (e.g. bash
90 or older versions of ksh) to indicate an abnormal process termination (killed
91 by a signal).
93 *0*::
94         No errors.
96 *255*::
97         Usage error (invalid option or wrong number of arguments).
99 *127*::
100         Failure while opening the 'target' or the 'output_file'.
102 *64*::
103         I/O error, while reading or writing.
105 *32*::
106         The title key could not be obtained.
108 *1*::
109         Some sectors could be read but not decrypted.  The data corresponding to
110         these sectors is output, but its content is unknown.
113 EXAMPLES
114 --------
115 Decrypt a scrambled video file:
117 [source,sh]
118 cp /media/dvd/VIDEO_TS/VTS_01_1.VOB scrambled.VOB
119 sectors=$( echo $(ls -l scrambled.VOB |cut -d' ' -f5) / 2048 | bc )
120 cssdec -ev scrambled.VOB 0 $sectors >descrambled.VOB
122 Decrypt a DVD Video title:
124 [source,sh]
125 for file in /media/cdrom/VIDEO_TS/VTS_01_[1-9].VOB; do
126         cssdec $file >> title1.vob
127 done
129 Only print the title key:
131 [source,sh]
132 DVDCSS_VERBOSE=2 cssdec -kv scrambled.VOB
135 BUGS
136 ----
137 If the file size is not a multiple of the sector size (2048 bytes), the last
138 partial sector is silently ignored.
140 See also the CDimg|tools distribution file 'BUGS'.
143 AUTHOR
144 ------
145 cssdec was written by G.raud Meyer.
148 SEE ALSO
149 --------
150 efdtt(1), vobcopy(1), dvdbackup(1), linkpage:dvdimgdecss[1], strtol(3)