---
name: "ts2es"
section: "1"
platform: "linux"
package: "tstools"
version: "1.13~git20151030-6"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ts2es"
---

# ts2es(1)

Extract a program stream from a Transport Stream

## NAME

**ts2es** – Extract a program stream from a Transport Stream

## SYNOPSIS

**ts2es** **-pid** *pid* \| **-video** \| **-audio** \[**-err stdout**\] \[**-err stderr**\] \[**-verbose** \| **-v**\] \[**-quiet** \| **-q**\] \[**-max** *max\_pkts* \| **-m** *max\_pkts*\] \[**-pes** \| **-ps**\] *in\_file* \| **-stdin** *out\_file* \| **-stdout**

## DESCRIPTION

Extract a single (elementary) program stream from a Transport Stream (or Program Stream).

### Files

- *in\_file*

  is an H.222 Transport Stream file (but see -stdin and -pes)

- *out\_file*

  is a single elementary stream file (but see -stdout)

### Which stream to extract:

- **-pid** *pid*

  Output data for the stream with the given *pid*. Use **-pid** 0x*pid* to specify a hex value

- **-video**

  Output data for the (first) video stream named in the (first) PMT. This is the default.

- **-audio**

  Output data for the (first) audio stream named in the (first) PMT

### Switches

- **-err stdout**

  Write error messages to standard output (the default)

- **-err stderr**

  Write error messages to standard error (Unix traditional)

- **-stdin**

  Input from standard input, instead of a file

- **-v**, **-verbose**

  Output extra information about packets

- **-q**, **-quiet**

  Only output error messages

- **-max** *max\_pkts*, **-m** *max\_pkts*

  Maximum number of TS packets to read.

- **-pes**, **-ps**

  Use the PES interface to read ES units from the input file. This allows PS data to be read (there is no point in using this for TS data). Does not support **-pid**, **-stdin** or **-stdout.**

## SEE ALSO

[esdots(1)](/esdots/1.md),
