MJPEG Tools

What is it ?

I wrote small utilities that work with the MJPEG Tools http://mjpeg.sf.net. They perform the frames->fields and fields->frames operation on a yuv4mpeg stream

yuvframestofields doubles the frame rate by making frames out of each field

yuvfieldstoframes halves the frame rate by making fields out of each frame

yuvntscframetopalfield takes an ntsc-rate stream (at 29.97fps) and makes it a pal-field-rate stream (at 50fps).

yuvflip takes an yuv4mpeg stream and flips it horizontally or vertically (originally written by Steven Boswell)

By the way, they now handle top and bottom field dominance ! You can run the tools with -h to see the available options.

Update: Sept 28th 2006

Con Kolivas rewrote yuvntscframetopalfield to pick a better frame to duplicate, resulting in a smoother operation.
Thank you very much !!! Version 1.5 is out

Update: Apr 19th 2005

I added a command line option to interpolate the missing field in yuvframestofield instead of duplicating it.
And doing this, I noticed a bug I introduced in the last version where one frame out of two was out of whack... It's fixed, so update now !

By the way, this version adds support for any chroma subsampling mode (3 planes only), so you can use it to deinterlace 4:1:1 NTSC DV or 4:4:4 streams if you like.

Here's the README
and you can find the package here

Since I added yuvflip, the package is now named yuvtools, the latest version is yuvtools-1.5 (updated Sept 28th 2006). It also comes with autoconf scripts ;-)

Why did you write this ?

If you are wondering why I wrote those tools, here's the answer: I use them for standards conversion. I often have to convert NTSC videos to PAL videos, and it's a pretty hard problem.
So I use the MJPEG Tools this way:
cat my_input_file.yuv | yuvscaler -O SIZE_720x576 | yuvntscframetopalfield | yuvfieldstoframes > my_output_file.yuv

For progressive streams (films), check out this other tool I wrote : yuvmotionfps

And by the way, don't try to transcode NTSC Films with that, they are interlaced using a process called telecine (or 3:2 pulldown) and there's a way better way to do that, and google is your friend:

Google



Jerome Cornet
Last modified: Thu Sep 28 11:00:34 EDT 2005 Valid XHTML 1.0!