(self, args, in_plugin=None)
return True
Generate the tsp command

        Args:
            in_plugin : List with input plugin command to be used by tsp.

        Rerturns:
            Boolean indicating whether a valid command was generated.
Generate the tsp command
Generate the tsp command
def gen_cmd(self, args, in_plugin=None):
        """Generate the tsp command

        Args:
            in_plugin : List with input plugin command to be used by tsp.

        Rerturns:
            Boolean indicating whether a valid command was generated.

        """
        # cache the request for TS dumping
        self.ts_dump = args.ts_dump
        self.ts_dump_opts = args.ts_dump_opts

        self.cmd = cmd = [
            "tsp", "--realtime", "--buffer-size-mb",
            str(args.tsp_buffer_size_mb), "--max-flushed-packets",
            str(args.tsp_max_flushed_packets), "--max-input-packets",
            str(args.tsp_max_input_packets)
        ]

        if (in_plugin):
            cmd.extend(in_plugin)

        if (args.ts_analysis):
            logger.info("MPEG-TS analysis will be saved on file {}".format(
                args.ts_analysis))
            if (not util.ask_yes_or_no("Proceed?", default="y")):
                return False
            cmd.extend(["-P", "analyze", "-o", args.ts_analysis])

        if (args.ts_monitor_bitrate):
            cmd.extend([
                "-P", "bitrate_monitor", "-p",
                str(args.ts_monitor_bitrate), "--min", "0"
            ])

        if (args.ts_monitor_sequence):
            cmd.extend(["-P", "continuity"])

        cmd.extend([
            "-P", "mpe", "--pid", "-".join([str(pid) for pid in defs.pids]),
            "--udp-forward", "--local-address", args.local_address
        ])

        # Output the MPEG TS stream to one of the following:
        #   a) a file;
        #   b) stdout (if using --ts-dump);
        #   c) /dev/null (default).
        if (args.ts_file is not None):
            logger.info("MPEG TS output will be saved on file {}".format(
                args.ts_file))
            if (not util.ask_yes_or_no("Proceed?", default="y")):
                return False
            cmd.extend(["-O", "file", args.ts_file])
        elif (not args.ts_dump):
            cmd.extend(["-O", "drop"])

        return True
def gen_cmd ( self , args , in_plugin = None ) : # cache the request for TS dumping self . ts_dump = args . ts_dump self . ts_dump_opts = args . ts_dump_opts self . cmd = cmd = [ "tsp" , "--realtime" , "--buffer-size-mb" , str ( args . tsp_buffer_size_mb ) , "--max-flushed-packets" , str ( args . tsp_max_flushed_packets ) , "--max-input-packets" , str ( args . tsp_max_input_packets ) ] if ( in_plugin ) : cmd . extend ( in_plugin ) if ( args . ts_analysis ) : logger . info ( "MPEG-TS analysis will be saved on file {}" . format ( args . ts_analysis ) ) if ( not util . ask_yes_or_no ( "Proceed?" , default = "y" ) ) : return False cmd . extend ( [ "-P" , "analyze" , "-o" , args . ts_analysis ] ) if ( args . ts_monitor_bitrate ) : cmd . extend ( [ "-P" , "bitrate_monitor" , "-p" , str ( args . ts_monitor_bitrate ) , "--min" , "0" ] ) if ( args . ts_monitor_sequence ) : cmd . extend ( [ "-P" , "continuity" ] ) cmd . extend ( [ "-P" , "mpe" , "--pid" , "-" . join ( [ str ( pid ) for pid in defs . pids ] ) , "--udp-forward" , "--local-address" , args . local_address ] ) # Output the MPEG TS stream to one of the following: #   a) a file; #   b) stdout (if using --ts-dump); #   c) /dev/null (default). if ( args . ts_file is not None ) : logger . info ( "MPEG TS output will be saved on file {}" . format ( args . ts_file ) ) if ( not util . ask_yes_or_no ( "Proceed?" , default = "y" ) ) : return False cmd . extend ( [ "-O" , "file" , args . ts_file ] ) elif ( not args . ts_dump ) : cmd . extend ( [ "-O" , "drop" ] ) return True