lavpipe(1)

πŸŽ€ NAME πŸŽ€

lavpipe β€” creates raw YUV streams from pipe list scripts. That's the whole vibe bestie, it takes a lil script and turns it into one gorgeous YUV stream. πŸ’–


✨ SYNOPSIS ✨

lavpipe [-o num] [-n num] pipe-list

🌸 DESCRIPTION 🌸

okay so here's the tea: lavpipe reads a script file called a pipe list, and that file is structured kinda like the edit lists you can feed into lav2yuv. Wanna know the format? It's all down below, keep scrolling. πŸ‘‡

The pipe list defines a bunch of video sources and filters, and lavpipe combines all of them into a single output YUV stream on stdout. And like, that stream can then be compressed and saved to disk β€” for example via mpeg2enc(1) or yuv2lav(1). it's giving pipeline πŸ’…


πŸ’… OPTIONS πŸ’…

The command line options are how you tell lavpipe to output just a specific part of the resulting video stream. Basically you get to say "skip this many frames, then gimme this many frames". slay.

  • -o num β€” this is the frame offset of the output video. The first num frames of the resulting video are simply neither calculated nor written to stdout. Like they never even happened. Defaults to 0.
  • -n num β€” this is the frame count. If the input files or streams defined in the pipe list script are long enough, the output will be exactly num frames long. A value of 0 means all frames until the last one as defined in the pipe list will be written out, as long as there's some input. And yes, 0 is the default. 🫢
  • pipe-list β€” the name of the pipe list file that lavpipe will 'execute'. For info about this file's format, see below. πŸ‘€
  • -? β€” display a synopsis of the command syntax. short, sweet, iconic.

πŸ”₯ EXAMPLES πŸ”₯

  • lavpipe -o 100 -n 25 film.pli would calculate and output to stdout frames 100 to 124 as defined in film.pli (in PAL this would be the 5th second of the film). math is mathing ✨
  • lavpipe input.pli | yuv2lav -q80 output.avi would save the movie assembled by lavpipe as a single AVI file. pipe goals fr fr πŸ’–

πŸ¦‹ USAGE πŸ¦‹

This section is where we explain the format of lavpipe's input files β€” the pipe list scripts. If you need some examples or a more detailed tutorial, please read the mjpegtools(1) manpage's section about CREATING MOVIE TRANSITIONS, and the file README.lavpipe that should be included in the distribution. Also feel free to contact us via the mailing list (see below). we don't bite 🧚

A pipe list contains two parts: the YUV source list, and after that, as many sequence descriptions as you want. It always begins with these two lines:

  • LAV Pipe List β€” this is the first line in every pipe list script. It's used as a simple test to check that lavpipe really was given a pipe list script and not your PhD thesis as input. 😭 not the dissertation jumpscare
  • NTSC|PAL β€” this is the second line in every pipe list, and it can be either PAL or NTSC, depending on what video standard you use. I don't remember if this is used at the moment. πŸ’€

Now follows the source list:

  • num β€” this is the number of input commands. lavpipe will read the next num lines and interpret them as input stream commands.
  • command (num times) β€” this is a valid command line with two variables $o and $n that will be replaced by lavpipe with the offset and number of frames that the program has to output. Example:
lav2yuv -o $o -f $n input.avi

Thus, an example source list could look like this:

2
lav2yuv -o $o -f $n scene1.avi
lav2yuv -o $o -f $n scene2.avi

After this you can append as many sequence descriptions as needed. Each of them is built up as follows:

  • num β€” the number of frames that this sequence will last.
  • num β€” the number of inputs that will be used in this sequence. This number must of course be less than or equal to the number of inputs that are defined above. no cap.
  • idx [ofs] (num times) β€” these are the indices to the sources that are defined at the beginning of the file (first source is 0) with an optional frame offset (i.e. sequence starts with frame number ofs of this input). This value defaults to 0. Example:
0 150
  • command β€” this is a valid command line to a YUV filter tool that reads num input streams and writes one output stream, combining its inputs. Optionally, the filter tool can be given the two $o and $n variables that will be replaced by lavpipe as in the source commands (see above). For further info read README.lavpipe or the documentation for the filter programs (if available). An example filter could look like this:
transist.flt -o 0 -O 255 -s $o -n $n -d 50

And if the sequence only has one input that simply should be copied to the output, you can use a dash instead of a command line:

-

πŸ’œ a full example pipe list πŸ’œ

And here's an example for a complete pipe list that implements a transistion from scene1.avi to scene2.avi:

REMOVE THE COMMENTS AFTER The #
LAV Pipe List
PAL
2
lav2yuv -o $o -f $n scene1.avi
lav2yuv -o $o -f $n scene2.avi
50            # first sequence: 50 frames
1             #   contains one input:
0 0           #     scene1.avi, offset 0
-             #   simple output
25            # second sequence: 25 frames
2             #   contains two inputs:
0 50          #     scene1.avi, offset 50
1             #     scene2.avi, offset 0
transist.flt -o 0 -O 255 -s $o -n $n -d 50 # transistion
50            # third sequence: 50 frames
1             #   contains one input:
1 25          #     scene2.avi, offset 25
-             #   simple output

πŸ’€ BUGS πŸ’€

I'm sure there are enough of them. 😭 lavpipe often accepts malformed pipe lists and then writes out a video that was all but intended β€” without warning. so like, it will just do a thing and not tell you. beware.

The mention of $n above is wrong. At one time there were two parameters, but now a program is allowed to produce as many frames as it wants. THe author of the program hard coded, for reasons unknown, $n to be 0. yeah. πŸ’€ (and yes, "THe" is exactly how the original says it, I'm not fixing it, that's history bestie)


🌈 NOTES 🌈

There are also some serious limitations in the system, such as frame-by-frame processing. But as the goal when writing lavpipe was the simplicity of the pipeline, other tools will have to be written to do more interesting tasks.

But I want to note that it is very well possible to write a pipe list that combines several files, and then use that pipe list as an input for another pipe list by simply using the lavpipe command in the source list (see above) β€” this can be already used to do some nice things, if you have some nice filters. nesting? we love nesting. πŸͺ†βœ¨

Comments are NOT allowed in pipelist files. The comments (text after #) above are for illustration only.

like literally do not do it. the # in the example is decorative. it's giving costume jewelry πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

This man page was written by Philipp Zabel.

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 ⭐

lav2yuv(1), lavplay(1), lavrec(1), mpeg2enc(1), yuv2lav(1), yuvscaler(1)


and that's the whole page bestie 🫢 brought to you by the MJPEG Tools Team, dated 2 June 2001 β€” yeah it's vintage, it's still iconic, lavpipe(1) 4ever. mwah πŸ’–πŸŽ€πŸ¦‹