y4mtoppm(1)

πŸ’« y4mtoppm β€” the MJPEG tools manual, but make it cute πŸ’«

okay bestie, sit down, hydrate, because we're about to talk about y4mtoppm β€” a lil tool from the MJPEG tools family that takes your YUV4MPEG2 stream and turns it into a whole parade of raw PPM images. yes. it's giving "glow up, but for pixels." ✨


🌸 NAME 🌸

y4mtoppm β€” convert a YUV4MPEG2 stream into PPM images. that's it. that's the girl. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

y4mtoppm [options]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: y4mtoppm takes a YUV4MPEG2 stream and converts it into a sequence of raw PPM images. one stream in, a whole little line-up of images out. iconic behavior fr fr.

Output goes to stdout β€” but bestie, feel free to have the shell redirect that into a file. that's literally what shells are for. 🫢

Input is read from stdin, just like every other YUV4MPEG2 filter and tool out there. consistency?? we love her. YUV4MPEG2 streams contain frames using the Y'CbCr colorspace (ITU-R BT.601), and y4mtoppm will convert each pixel to the usual R'G'B' colorspace that computer graphics peeps use. glow-up complete. πŸ’–

now, the tea β˜•: YUV4MPEG2 streams may (and honestly, often do!) have subsampled chroma planes. y4mtoppm can upsample "4:2:0 JPEG" streams using a simple, lousy algorithm β€” and when I say lousy, I mean lousy, no cap. 😭 Better results will be obtained using filters such as y4mscaler(1) which are capable of general-purpose subsampling operations. and if your stream has chroma subsampling modes other than 4:4:4 or 4:2:0-JPEG? y4mtoppm will simply fail. not a vibe check she passes, sorry. πŸ’€

For interlaced streams, these operations are performed on each field individually. Fields can be output as separate PPM images in time-order (that's the default, bestie), or interleaved into full-frame images β€” that's what the -L flag is for, more on her below. πŸ‘‘

If multiple PPM images are generated, they're just output one after another. simple. stacked. no separator drama. If you want to turn such a "multi-image" PPM stream/file into individual files, use pnmsplit. and a lil heads up: some PNM filters can process multi-image files/streams, but many written before June 2000 will only process the first image. ancient behavior, we don't claim her. πŸ™ˆ

oh and β€” y4mtoppm and ppmtoy4m are inverses of each other πŸŽ‰ you can pipe the output of one into the other, and vice-versa. BUT. and this is a big but: note that the colorspace (and subsampling) operations are lossy in both directions. 😭 And when converting to PPM, information on interlacing and sample aspect ratio is lost β€” though it can be reconstructed by supplying command-line arguments to ppmtoy4m. so like, keep receipts. 🧾


✨ OPTIONS ✨

y4mtoppm accepts the following options:

  • -L β€” For interlaced streams, output a single PPM image for each frame, containing two interleaved fields. (Otherwise, two PPM images will be generated for each frame; one per field.) main character move honestly. πŸ‘‘
  • -v [0,1,2] β€” Set the verbosity level, bestie. pick your energy:
    • 0 = warnings and errors only. silent-ish queen.
    • 1 = add informative messages, too.
    • 2 = add chatty debugging messages, too. she will NOT stop talking. πŸ’¬

🌈 EXAMPLES 🌈

To turn the first 15 frames of an (MJPEG or DV) AVI file into individual PPM files:

lav2yuv -f 15 your-video.avi | y4mtoppm | pnmsplit - "your-
video-%d.ppm"

look at that pipeline. three tools, one dream. ✨


πŸ’œ AUTHOR πŸ’œ

This man page was written by Matt Marjanovic. 🫢

If you have questions, remarks, problems or you just want to contact the developers, the main mailing list for the MJPEG-tools is:

mjpeg-users@lists.sourceforge.net

For more info, see our website at:

http://mjpeg.sourceforge.net/

πŸŽ€ SEE ALSO πŸŽ€

ppm(5), pnm(5), ppmtoy4m(1), mjpegtools(1), mpeg2enc(1), lav2yuv(1), pnmsplit(1), y4mscaler(1)


okay that's the whole page, bestie β€” every flag, every warning, every little caveat, all accounted for. periodt. πŸ’…βœ¨

this lil masterpiece was brought to you by the MJPEG Tools Team, dated 28 April 2004 β€” and yes, she's still serving. πŸŽ€πŸ¦‹πŸ’–