ES2TS(1)

πŸ’– ES2TS(1) πŸ’–

okay bestie, welcome to the es2ts era β€” she's a General Commands Manual girlie and she is so good at what she does. buckle up, we're turning elementary streams into transport streams and it's gonna be iconic ✨


🌸 NAME 🌸

es2ts β€” convert an ES video stream to H.222 TS. that's it. that's the whole job. and she ate. πŸ’…


✨ SYNOPSIS ✨

es2ts [-err stdout] [-err stderr] [-verbose | -v] [-quiet | -q]
      [-pid pid_no] [-pmt pmt_pid_no] [-host host[:port]]
      [-max max_units | -m max_units] in_file | -stdin out_file |
      [-stdout]

yes the synopsis is giving choose your own adventure and honestly? we love that for her πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

so basically she takes an elementary video stream and converts it into an H.222 transport stream. no cap.

she supports input streams that conform to MPEG-2 (H.262), MPEG-4/AVC (H.264) and AVS. she also supports MPEG-1 input streams, insofar as MPEG-2 is backwards compatible with MPEG-1. (which it is. that's the whole point of backwards compatible. periodt.)

not me about to drop the most important lore: this program works by reading and packaging the elementary stream packages directly β€” it does not parse them as H.262 or H.264 data. she's a packager, not a parser. know the difference, bestie πŸ’€

🌈 Files 🌈

  • in_file β€” is a file containing the Elementary Stream data (but see -stdin below, she has options)
  • out_file β€” is an H.222 Transport Stream file (but see -stdout and -host below, again: options)

🧚 Switches 🧚

  • -err stdout β€” write error messages to standard output. this is the default, lowkey the normie choice and that's fine 🫢
  • -err stderr β€” write error messages to standard error. the Unix traditional one. vintage. old money. highkey valid πŸ’œ
  • -v, -verbose β€” output summary information about each ES packet as it is read. she will not stop talking and honestly? we're listening πŸ‘‘
  • -q, -quiet β€” only output error messages. the "i'm not mad i'm just disappointed" setting πŸŽ€
  • -pid pid_no β€” pid_no is the video PID to use for the data. use -pid 0x<pid> to specify a hex value. [default = 0x68]
  • -pmt pmt_pid_no β€” pmt_pid_no is the PMT PID to use. use -pmt 0x<pid> to specify a hex value. [default = 0x66]
  • -max max_units, -m max_units β€” maximum number of ES data units to read. she'll stop when she's done and she will respect your limits βœ‹
  • -stdin β€” input from standard input, instead of a file. pipe it in, bestie πŸ“
  • -stdout β€” write output to <stdout>, instead of a named file. this forces -quiet and -err stderr. she said "if we're doing stdout we're doing it my way." πŸ™ˆ
  • -host host[:port] β€” writes output (over TCP/IP) to the named host, instead of to a named file. if port is not specified, it defaults to 88. she's networking. she's social. she's booked and busy 🌐

πŸ’… Stream type πŸ’…

when the TS data is being output, it gets flagged to indicate whether it conforms to H.262, H.264 or AVS. it is important to get this right, because it will affect interpretation of the TS data. like, this is not a vibe check you can skip. this one matters πŸ”₯

if input is from a file, then the program will look at the start of the file to determine if the stream is H.264, H.262 or AVS. this process may occasionally come to the wrong conclusion, in which case the user can override the choice using the following switches. she's smart but she's not omniscient, okay? give her a break 😭

if input is from standard input (via -stdin), then it is not possible for the program to make its own decision on the input stream type. instead, it defaults to H.262, and relies on the user indicating if this is wrong. so like... speak up. use your words. tell her what she's working with 🫢

  • -h264, -avc β€” force the program to treat the input as MPEG-4/AVC. πŸ’™
  • -h262 β€” force the program to treat the input as MPEG-2. πŸ’š
  • -avs β€” force the program to treat the input as AVS. πŸ’œ

πŸ‘€ SEE ALSO πŸ‘€

esdots(1)

(yes that's the whole list. she's a one-recommendation girl. loyal.)


πŸ’€ BUGS πŸ’€

for the moment, the video input must be H.264 or AVS, and the audio input ADTS, AC-3 ATSC or MPEG layer 2. also, the audio is assumed to have a constant number of samples per frame. so no funny business with the samples. she's counting. she will notice. πŸ™ˆ

and that's the whole page, bestie β€” every flag, every default, every dramatic caveat, all of it, preserved in amber ✨

this has been ES2TS(1), from the Debian era, dated October 28, 2015. go forth and convert. slay. πŸ’–πŸŽ€πŸ¦‹