>I understand that MJPEG is (more or perhaps less) a concatenation of JPEG
>files; hence I'd thought that extracting the JPEG files, rotating them
>lossless and then bringing them back together should be a lossless
>operation.
>You've already guessed, this is not the result I come to. The result is
>not bad, but the film becomes with each rotation always more noisy and
>muddy.
>
>My current sequence looks like this:
>
>1# /usr/bin/transcode -y jpg -o '.tmpmjpg/'   -i '0755_MVI.AVI'
>--print_status 10,0

     This, at least, will cause reduction of quality.  The current
transcode infrastructure is not capable of passing through encoded data
in this sense (except in the special case of MPEG2 video); each frame
will be decompressed to raw data, then lossily recompressed.  Work is
underway to redesign the infrastructure to allow this sort of lossless
transcoding, but unfortunately it has a ways to go.

>2# /usr/bin/transcode -i 0755_MVI.AVI -o .tmpmjpg/film.wav  -y null,wav
>3# (for each jpg file) jpegtran -rotate 90 -copy all nnnnn.jpg
>4# /usr/bin/mencoder mf://.tmpmjpg/\*.jpg -mf
>w=480:h=640:type=jpeg:fps=30.000 -o .tmpmjpg/0755_MVI.AVI -ovc lavc
>-lavcopts vcodec=mjpeg:vhq

     Again, I don't know whether mencoder is capable of losslessly
copying JPEG images into an MJPEG video file.  If it isn't, you'll
suffer further degradation in this step.

     What I'd suggest for now is to use PPM rather than JPEG files as
your intermediate image format, using "-y ppm" rather than "-y jpg" and
the jpegtran command by "pamflip -cw".  This will at least allow you to
avoid one decompression/recompression pair, though it does have the
potential for causing slight (usually unnoticeable) color alterations
due to the different color spaces used in JPEG and PPM files.

  --Andrew Church
    [EMAIL PROTECTED]
    http://achurch.org/

Reply via email to