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:
-vnum β set the verbosity level. (default:0) π£οΈ-hβ print a usage summary and exit. the classic cry-for-help flag π«Ά-it|b|pβ set the interlacing mode: top field first (t), bottom field first (b) or progressive/none (p). (default:t) π§-asar β set the sample aspect ratio. (default:10:11) π-rframe 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 π ππ
π¦ where this page comes from
- arch rolling: mjpegtools 2.2.1-4 Β· GPL-2.0-or-later
- debian bookworm: mjpegtools 1:2.1.0+debian-7
- debian trixie: mjpegtools 1:2.1.0+debian-8.1+b1
- fedora 43: mjpegtools 2.2.1-11.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-or-later
- fedora 44: mjpegtools 2.2.1-12.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-or-later
- nixos 26.05: mjpegtools 2.2.1
- nixpkgs unstable: mjpegtools 2.2.1
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: mjpegtools 2.2.1-160000.2.2 Β· GPL-2.0-only
- ubuntu jammy: mjpegtools 1:2.1.0+debian-6build1
- ubuntu noble: mjpegtools 1:2.1.0+debian-8.1build1
- ubuntu questing: mjpegtools 1:2.1.0+debian-8.1build1
- ubuntu resolute: mjpegtools 1:2.2.1-3
- ubuntu stonking: mjpegtools 1:2.2.1-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms