.TH TSDECRYPT "1" "February 2012" "tsdecrypt 6.0" "User Commands" .SH NAME tsdecrypt - Decrypt mpeg transport stream. .SH SYNOPSIS .B tsdecrypt [\fIoptions\fR] .SH DESCRIPTION tsdecrypt reads incoming mpeg transport stream over UDP/RTP or file and then decrypts it using libdvbcsa and keys obtained from OSCAM or similar CAMD server. tsdecrypt communicates with CAM server using cs378x (camd35 over tcp) protocol or newcamd protocol. .SH OPTIONS .TP .SH MAIN OPTIONS .PP .TP \fB\-i\fR, \fB\-\-ident\fR Set ident that will be used when logging to syslog. The prefered format for the ident is PROVIDER/CHANNEL. .TP \fB\-d\fR, \fB\-\-daemon\fR When started become a daemon and write pid file to . .TP \fB\-N\fR, \fB\-\-notify\-program\fR Execute \fB\fR when predefined events happen. In order for this option to work \fB\-\-ident\fR should also be used. You can use \fBnotify-script.example\fR file as notification program and an example on how to create your own notification script. See \fBEVENTS\fR section for detailed description of the events. .TP \fB\-S\fR, \fB\-\-syslog\fR Write log messages to local syslog. .TP \fB\-l\fR, \fB\-\-syslog\-host\fR Set syslog host. tsdecrypt sends messages to this host over tcp in syslog compatible format. syslog-ng was tested as receiving syslog server. .TP \fB\-L\fR, \fB\-\-syslog\-port\fR Syslog server port. The default value is \fB514\fR. .TP \fB\-F\fR, \fB\-\-log\-file\fR Write logging data to . This option can be used along with syslog. .TP \fB\-D\fR, \fB\-\-debug\fR Set message debug level. Currently there are five message levels. 0 = default messages, 1 = show PSI tables, 2 = show EMMs 3 = show duplicate ECMs, 4 = packet debug. 5 = packet debug + mpeg ts packet dump. Setting higher level enables the levels bellow. .TP \fB\-j\fR, \fB\-\-pid\-report\fR When this option is used, tsdecrypt on exit reports how much packets were received on each PID. .TP \fB\-b\fR, \fB\-\-bench\fR Bechmark libdvbcsa decryption. The benchmark is single threaded. If you want to fully test your CPU, run couple of tsdecrypts in parallel. .TP \fB\-V\fR, \fB\-\-version\fR Show program version. .TP \fB\-h\fR, \fB\-\-help\fR Show program help. .TP .SH INPUT OPTIONS .PP .TP \fB\-I\fR, \fB\-\-input\fR Where to read from. tsdecrypt supports input from files (-I file.ts or -I -) or multicast (-I 224.0.0.1:5000). By default tsdecrypt reads from \fBstdin\fR. .TP \fB\-R\fR, \fB\-\-input\-rtp\fR When reading from multicast assume the input is RTP stream. NOTE: No RTP processing/reordering of packets is done. The 12 byte RTP header is just stripped out and the stream is then processed as normal mpeg transport stream over UDP multicast. .TP \fB\-z\fR, \fB\-\-input\-ignore\-disc\fR Do not report input discontinuity or RTP discontinuity errors. .TP \fB\-M\fR, \fB\-\-input\-service\fR Choose the service id. This option must be used when the input is MPTS in order to select the correct service (program). If the input is MPTS and \fB\-\-input\-service\fR is not used, tsdecrypt chooses the last service listed in PAT. .TP \fB\-T\fR, \fB\-\-input\-buffer\fR Using this option delays the decoding for given amount of milliseconds. This allows tsdecrypt to decode services even if OSCAM returns code word too late. For example SkyUK sends code words ~700 ms before it starts using them. This means that if OSCAM is unable to return code word in less than 700 ms the decryption will fail for a small amount of time. Setting --input-buffer 1000 will solve the problem in this case. .TP \fB\-W\fR, \fB\-\-input\-dump\fR Save input stream in . If the input is RTP, the file will contain the data without RTP headers (pure mpeg transport stream). Easiest way to save the input is using command line like the following: tsdecrypt -I 239.78.78.78:5000 -O /dev/null -s 0.0.0.0 -W file.ts .TP .SH OUTPUT OPTIONS .PP .TP \fB\-O\fR, \fB\-\-output\fR Output decrypted stream to . Destination can be multicast address (-O 239.0.0.1:5000) or a file (-O file.ts). The default output is \fBstdout\fR. .TP \fB\-o\fR, \fB\-\-output\-intf\fR Set multicast output interface. .TP \fB\-t\fR, \fB\-\-output\-ttl\fR Set multicast ttl. The default value is \fB1\fR. .TP \fB\-g\fR, \fB\-\-output\-tos\fR Set TOS value of output packets. The default is not to set any specific TOS. .TP \fB\-r\fR, \fB\-\-output\-rtp\fR Enable RTP output. The default output is standart MPEG TS over UDP, this option enables tsdecrypt to output RTP packets. .TP \fB\-k\fR, \fB\-\-output\-rtp\-ssrc\fR Set RTP SSRC field to . By default is is set to \fB0\fR. .TP \fB\-p\fR, \fB\-\-no\-output\-filter\fR Disable output filtering. By default the output filter is enabled and only PAT/PMT/SDT and data packets are left in the output. Everything else not mentioned in PMT like NIT, EIT, TDT tables and unknown pids is removed. .TP \fB\-y\fR, \fB\-\-output\-nit\-pass\fR Pass throught NIT packets when output filtering is enabled. .TP \fB\-w\fR, \fB\-\-output\-eit\-pass\fR Pass throught EIT (EPG) packets when output filtering is enabled. .TP \fB\-x\fR, \fB\-\-output\-tdt\-pass\fR Pass throught TDT/TOT packets when output filtering is enabled. .TP .SH CA OPTIONS .PP .TP \fB\-c\fR, \fB\-\-ca\-system\fR Process input EMM/ECM from . Currently tested and working CA systems are \fBCONAX\fR, \fBCRYPTOWORKS\fR, \fBIRDETO\fR, \fBVIACCESS\fR, \fBMEDIAGUARD\fR (\fBSECA\fR) and \fBVIDEOGUARD\fR (\fBNDS\fR). Other supported CA systems that you can choose but are not tested are \fBNAGRA\fR and \fBDRECRYPT\fR. The default is \fBCONAX\fR. .TP \fB\-C\fR, \fB\-\-caid\fR Directly set CAID. This is useful if you have couple of CA streams from one CA but with different CAIDs. .TP .SH CAMD OPTIONS .PP .TP \fB\-A\fR, \fB\-\-camd\-proto\fR Set CAMD server protocol. Valid protocols are \fBCS378X\fR and \fBNEWCAMD\fR. If this option is not used the default protocol is \fBCS378X\fR (camd35 over tcp). .TP \fB\-s\fR, \fB\-\-camd\-server\fR Set CAMD server ip and port (10.0.1.1:2233). Is not set default port is \fB2233\fR. 2233 is the default port CS378X protocol, for NEWCAMD protocol you probably should choose other port. .TP \fB\-U\fR, \fB\-\-camd\-user\fR Set CAMD user name. The default is \fBuser\fR. .TP \fB\-P\fR, \fB\-\-camd\-pass\fR Set CAMD user password. The default is \fBpass\fR. .TP \fB\-B\fR, \fB\-\-camd\-des\-key\fR Set DES key used by NEWCAMD protocol. The default is \fB0102030405060708091011121314\fR. .TP .SH EMM OPTIONS .PP .TP \fB\-e\fR, \fB\-\-emm\fR Enable sending EMM's to CAMD for processing. By default EMM processing is \fBdisabled\fR and only ECM are processed. .TP \fB\-Z\fR, \fB\-\-emm\-pid\fR Set EMM pid manually. This option is useful for services that have couple of EMM streams from one CA system. Without this option tsdecrypt always chooses the first stream from the chosen CA system. .TP \fB\-E\fR, \fB\-\-emm\-only\fR Disable ECM processing and stream output. This option is useful if the EMM stream has very high rate and is interfering with ECM processing. Using --emm-only you can run special tsdecrypt dedicated only to card auto update. .TP \fB\-f\fR, \fB\-\-emm\-report\-time\fR Set interval for EMM reports. The default is \fB60\fR seconds. Set to \fB0\fR to disable EMM reports. .TP .SH ECM OPTIONS .PP .TP \fB\-X\fR, \fB\-\-ecm\-pid\fR Set ECM pid manually. This option is useful for services that have couple of ECM streams from one CA system. Without this option tsdecrypt always chooses the first stream from the chosen CA system. Run tsdecrypt with --debug 2 and look at CA descriptors in PMT to see what CA streams are available. .TP \fB\-H\fR, \fB\-\-ecm\-report\-time\fR Set interval for ECM reports. The default is \fB60\fR seconds. Set to \fB0\fR to disable ECM reports. .TP \fB\-G\fR, \fB\-\-ecm\-irdeto\-type\fR Set ECM IRDETO type. IRDETO CA send ECMs with different id mixed into one stream. Only one of the IDs are valid in given time. This option lets you choose which stream to process. The default stream type is \fB0\fR. .TP \fB\-K\fR, \fB\-\-ecm\-no\-log\fR Disable logging of ECMs and code words. Code word errors and stats reports are not affected by this option. .TP \fB\-J\fR, \fB\-\-cw\-warn\-time\fR After how much seconds to warn if valid code word was not received. The default is \fB60\fR seconds. Set to \fB0\fR to disable the warning. .SH EVENTS Notification events are sent when \fB\-\-notify\-program\fR and \fB\-\-ident\fR options are used. The event parameters are set as environmental variables before executing the external notification program. The variables are: \fB_TS\fR Unix timestamp of the event. \fB_IDENT\fR tsdecrypt ident parameter with "/" replaced by "-". \fB_MESSAGE_ID\fR Event message id (for example START, STOP, etc...). \fB_MESSAGE_MSG\fR Event message id with "_" replaced by " ". \fB_MESSAGE_TEXT\fR Event message text. Human readable event message. currently defined events are: \fBSTART\fR tsdecrypt was started. \fBCODE_WORD_OK\fR Valid code word was received and decryption is working ok. \fBNO_CODE_WORD\fR No valid code word was received for X seconds. The decryption process have been suspended until valid code word is received. \fBINPUT_TIMEOUT\fR There was no data on the input. \fBINPUT_OK\fR The data have appeared on the input. \fBSTOP\fR tsdecrypt was stopped. See \fBnotify-script.example\fR for an example on how to create external notification program. .SH SEE ALSO See the README file for more information. If you have questions, remarks, problems or you just want to contact the developer, write to: \fIgeorgi@unixsol.org\fP .TP For more info, see the website at .I http://georgi.unixsol.org/programs/tsdecrypt/ .SH AUTHORS Written by Georgi Chorbadzhiyski <\fBgeorgi@unixsol.org\fR> .SH LICENSE This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.