ppm2raw (1)
NAME
ppm2raw - Convert a PPM pipe to a Raw DV stream
SYNOPSIS
ppm2raw [ options ]
DESCRIPTION
ppm2raw converts a PPM to a Raw DV stream.
OPTIONS
-n NTSC output required.
-a Maintain aspect ratio on images following.
-s Scale following images to the full frame size, regardless of
aspect ratio
-k Keep the image unscaled - centre and crop output as necessary
(default).
-w Wide screen output (default: off).
-p number
Number of encoder passes (default is 3 and afiact, other values
are ignored - not sure if this is a bug in smil utils or libdv).
-q qno Another funky encoder related param which doesn't seem to do
anything.
-q number
Number of encoder passes.
-b colour
Use the colour triple for backgrounds - default is 000000. For-
mat must be a hex string representing red, green, blue. For
example, ffffff would be white.
-A wav Use the wav to dub the output. The wav file must contain stereo,
16 bit samples at a frequency of 32khz, 44.1khz or 48khz.
-2 Two pass encoding (default: off).
Help Options
--help Show help message.
EXAMPLES
ppm2raw needs a PPM input provided on stdin. Fortunately, many tools
generate PPM on stdout.
For example, to re-encode any ffmpeg compatible file or stream format
to a PAL Raw DV stream which rescales the images according to the
aspect ratio of the input using the following command:
ffmpeg -i 'some-file' -f ppmpipe - |
rawmutiltiply command:
ffmpeg -i 'some-file' -f ppmpipe - |
rawmultiply 1.666 |
ppm2raw -a > file.dv
This then gives us our 25 frames per second (assuming the original
input was a 25 fps PAL video which was encoded using 3:2 dropdown).
Knowing when to do this is not always easy, but you will find that
issues in this area come to the fore when you add audio into the mix...
So, lets assume we have an mpeg which has a high quality audio track,
3:2 dropdown for images and we want to encode that to DV:
ffmpeg -i 'some-file' -f ppmpipe - output.wav |
rawmultiply 1.666 -A output.wav |
ppm2raw -a > file.dv
Now, the audio from the input is added to our output.
This works, assuming the audio extracted by ffmpeg is a compatible for-
mat for DV (or more specifically, libdv). Currently, smilutils simply
rejects incompatible audio. So if you have problems there, extract the
wav separately (via ffmpeg or some other tool) and sox or some other
tool to resample to something DV compatible (stereo, 16 bit samples of
32khz, 44.1khz or 48khz). For example:
ffmpeg -i 'some-file' input.wav
sox input.wav -r 44100 output.wav
ffmpeg -i 'some-file' -f ppmpipe - |
rawmultiply 1.666 -A output.wav |
ppm2raw -a > file.dv
Many, many tools have adopted the highly sensible mjpeg tools yuv for-
mat for output, and mjpeg tools themselves have provided a highly sen-
sible y4mtoppm utility, so you can use a pipe like this to encode mjpeg
yuv streams:
lav2wav -o output.wav
lav2yuv 'lav-input' |
y4mtoppm |
ppm2raw -a -A output.wav > file.dv
Obviously, any of the yuv tools (yuvscaler, yuvdenoise, yuvcorrect etc)
can be placed prior to the y4mtoppm command.
Note that the -A switch is used on the ppm2raw tool this time, and raw-
multiply isn't shown.
SEE ALSO
smilutils(1)
AVAILABILITY
See http://kino.schirmacher.de/ for the latest version.
AUTHORS
ppm2raw was written by Charles Yates <charles.yates@pandora.be>.