pgmtoy4m(1)

πŸ’– pgmtoy4m β€” the MJPEG tools manual, but make it cute πŸ’–

okay bestie, so this one's from the MJPEG tools manual and it's called pgmtoy4m β€” say that five times fast, I dare you 🫢


✨ NAME ✨

pgmtoy4m β€” literally just here to convert mpeg2dec pgm and pgmpipe output into YUV4MPEG2. that's it. that's the job. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

pgmtoy4m [options]

no positional args, no drama, just vibes and options ✨


🌸 DESCRIPTION 🌸

so here's the tea β˜• β€” pgmtoy4m repacks the PGM output from mpeg2dec into YUV4MPEG2 4:2:0p.

and the important part, bestie: no actual changes to the data are made. none. zero. the data just gets unpacked from that quasi-PGM format and plopped into YUV4MPEG2 format, using whatever sample aspect, frame rate and field order you specified. it's giving repackaging, not remixing πŸ’…

heads up though 😭 output must be either to a pipe or a file. if you leave stdout as a terminal, it will elicit an error and the program will exit. no terminal output for you, bestie. it said no. πŸ™ˆ

πŸ‘‘ OPTIONS πŸ‘‘

pgmtoy4m accepts the following options:

  • -v num β€” set the verbosity level. (default: 0) πŸ—£οΈ
  • -h β€” print a usage summary and exit. the classic cry-for-help flag 🫢
  • -i t|b|p β€” set the interlacing mode: top field first (t), bottom field first (b) or progressive/none (p). (default: t) 🧚
  • -a sar β€” set the sample aspect ratio. (default: 10:11) πŸ“
  • -r frame rate β€” set the frame rate. (default: 30000:1001) ⏱️

🌈 EXAMPLES 🌈

piping it straight through like the main character you are:

mpeg2dec -s -o pgmpipe file.mpg | pgmtoy4m -a 10:11 -r 24000:1001 -i b | yuvplay

or the two-step version, where you make a whole pile of .pgm files and then cat them all in:

mpeg2dec -s -o pgm file.mpg
cat *.pgm | pgmtoy4m -r 30000:1001 -i t | yuvplay

πŸ’œ NOTES πŸ’œ

okay so this is highkey important: this program is specifically designed to work with the output of mpeg2dec, and it is NOT a general PGM (NetPBM) tool! do not bring it your regular PGM files, it will not know what to do with them, bestie 😭

and from the introduction in the source file, the actual words, verbatim, no cap:

 * Note: mpeg2dec uses a variation of the PGM format - they're really not
 * "Grey Maps" but rather a catenation of the 420P data (commonly called
 * "YUV").    The type is P5 ("raw") and the number of rows is really
 * the total of the Y', Cb and Cr heights.   The Cb and Cr data is "joined"
 * together.  After the Y' rows you have 1 row of Cb and 1 row of Cr per
 * "row" of PGM data.

 * NOTE: You MAY need to know the field order (top/bottom field first),
 *      sample aspect ratio and frame rate because the PGM format makes
 *      none of that information available!

like, read that again. the PGM format tells you nothing about field order, sample aspect ratio or frame rate. so you better know them, or pass them in yourself. iykyk πŸ’…


πŸŽ€ AUTHOR πŸŽ€

this manpage was written by Steven Schultz (sms at 2bsd dot com). thank you steven, iconic behavior πŸ™βœ¨


πŸ’€ BUGS πŸ’€

possible but none known at the present time. we love a flawless queen πŸ‘‘


and that's the whole page, bestie!! πŸ¦‹βœ¨ this one's from y4mutils, dated 16 December 2003 β€” yeah she's vintage, she's a classic, she ate and left no crumbs. periodt πŸ’…πŸ’–πŸŽ€