The new way of converting JPEGs to MPEGs

    I wrote the JPEG to MPEG howto a while ago, and used the best tools that I could find at the time. It was a complicated, evil process, but people still email me a couple of times a month and thank me for it. I think they'll like this way even more.

    For my PhD, I'm taking large numbers of images and displaying them one after another on a monitor so that I can capture the images with a webcam. The reason is a little convoluted, so let's settle for I'm trying to see what sort of image distortion the webcam will impose. I figured that the best way to do this was to simply have a MPEG2 movie that was the images, play it on the machine, and then point the webcam at the monitor. At about this time in a twist of wonderful fate I discovered I could do this in a simple command line with ImageMagick. Let's see how (all of these instructions are based on Debian unstable, but should work anywhere):

    Install ImageMagick

      apt-get install imagemagick
      


    Install mpeg2vidcodec

    This isn't packaged for Debian, but I've put a request for package bug in. Do this:

      wget ftp://ftp.mpegtv.com/pub/mpeg/mssg/mpeg2vidcodec_v12.tar.gz
      tar xvzf mpeg2vidcodec_v12.tar.gz
      cd mpeg2
      make
      cd src/mpeg2dec
      cp mpeg2decode /usr/local/bin
      cd ../mpeg2enc
      cp mpeg2encode /usr/local/bin
      


    Do the thing

    So, now we can do the thing. In this instance we have a bunch of TIFF files we want to turn into an MPEG2 video.

      convert *.tif foobar.mpg
      


    And we're done. Nice, isn't it?

    Technorati tags for this post:

posted at: 17:20 | path: /jpeg2mpeg | permanent link to this entry





    #1 Andrew Thall

    Hey, thanks! My computer graphics class is doing some image-morphing experiments, and I've been searching for a while online for good jpg2mpg
    conversion software. I've shown them ImageMagick already, and this is very excellent---works fine under Fedora Core 3.



    #2 Mattbot

    Yay, thanks! This works on Mac OS X 10.4.5.



    #3 Basil

    Thanks! I have thousands of JPGs to convert to usable MPGs and this should be it. I was hoping to do the conversion under the linux platform!



    #4 chriwi

    Hello,

    I allso tried convert like it is decribed here, but it did not work:
    I compiled the mpeg2videocodec as described under my Debian(testing) and tried to convert a jpeg from my digital-camera, I also got a test.mpeg-file, but in every player I tried only a blck screen was shown, nothing to see of the original jpeg, not even for a short time.

    beye

    chriwi



    #36 Willard

    Mpeg2vidcodec isn't available at the mpegtv ftp repository, but you can get it at ftp://ftp.imagemagick.org/pub/ImageMagick/delegates/



    #39 JavaDewd

    This worked for me, except how do you make the JPEG stay up longer than 1 frame? I need them to be 10 minute MPEGs if possible...

    Add a comment to this post:

    Your name:

    Your email: Email me new comments on this post
      (Your email will not be published on this site, and will only be used to contact you directly with a reply to your comment if needed. Oh, and we'll use it to send you new comments on this post it you selected that checkbox.)


    Your website:

    Comments:


    Because of excessive load, this site is generated statically every several hours. Therefore, your comment may take some time to appear here. Unless you get an error message when you click the select button below, then all is normal and the comment will appear in due course. If you want you can checkout all recently approved comments while your waiting.