Tech Off Thread

16 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

jpg to mpg

Back to Forum: Tech Off
  • User profile image
    devnull

    anyone got any information about how to convert a jpg to a mpg? in c# would be nice

  • User profile image
    Manip

    A JPG image is a single frame, a MPG image is an animated movie with sound... There is absolutely no value in converting a still image into a movie.

  • User profile image
    PerfectPhase

    On a slightly more helpful note, but not very, if you have a jpg sequence (i.e. each jpg represents a frame for example a rotoscoped overlay) have a look at virtual dub, that will let you convert it to an uncompressed avi and then you can use any mpg encoder to convert it to mpeg.

    Adobe Premier also supports this but that costs $$

  • User profile image
    devnull

    cool ill have a look at that.

    thanks

  • User profile image
    matt0210

    Quicktime Pro opens any multimedia file and saves it to almost any other. Since you're not doing a WMV or WMA conversion, QT is the best tool. And the cheapest.

  • User profile image
    dentaku

    devnull wrote:
    anyone got any information about how to convert a jpg to a mpg? in c# would be nice


    I'm interested to knonw why you're converting a .jpg into a video file in the first place.

    Another way to do it would be to just drag a .JPG into the Windows Movie Maker 2 timeline, drag the right side of the thumbnial to the right until the clip is as long as you want, then save it as a DV-AVI file.
    This will create a large uncompressed .AVI file that you can then convert to .MPG with something like TMPEGEnc.
    http://www.tmpgenc.net/e_main.html

  • User profile image
    devnull

    backward compatibility for an old system that expects something like this

    [5 sec delay] [ small mpeg ] [ 5 sec delay ] [ full mpeg ]

    new system takes

    [ 5 sec delay ] [ jpg ] [ 5 sec delay ] [ full mpeg ]

    this has to be automated, so unless windows movie maker 2 has some sort of sdk or command line im stuck.

    thanks for the suggestions, i will have a closer look.

  • User profile image
    bdorman

    I know this post is old but for anyone who runs across it looking to do a similar task I thought I'd post a something slightly more helpful.  While there is no use in converting one jpeg image to a mpeg movie, I'm sure this is referring to converting a sequence of jpegs into one mpeg.  Anyway, you can do this with DirectShow and there is a DirectShow Class Library available for C#.  There are many examples available.  You can convert a seqence of images into a video or break a video stream apart into seperate images.  The DirectShow Class Library is free and you can download it from sourceforge at this address:

    http://sourceforge.net/projects/directshownet/

    Hope this helps someone out!

  • User profile image
    devnull

    using MediaDetClass you can extract bitmaps from a video i cant find how to combine a sequence of image(s) into a video in the docs/samples.

    where did you see it bdorman?

    at the moment i use jpg2yuv with mpeg2enc to generate a 4:2:0 mpeg1 video, but i need a 4:2:2 mpeg2, y4mscaler/berkly mpeg tools for *nix does it but need something for windows.

    any ideas?

  • User profile image
    DigitalDud

    Mplayer's mencoder will probably do this, it's not exactly trivial to use though.

  • User profile image
    odujosh

    XP movie maker can get you a sequence of JPEGs into a WMV. Not sure if the support MPG. But you could always encode from there.

  • User profile image
    dentaku

    odujosh wrote:
    XP movie maker can get you a sequence of JPEGs into a WMV. Not sure if the support MPG. But you could always encode from there.


    Considering it needs to be an mpeg file it would be better to save it as DV-AVI instead of WMV then convert it to MPG .

    From the previous points I'm assuming he's trying to find a way to automate the whole process so MovieMaker probably isn't the bet route anyway.

  • User profile image
    odujosh

    Yea I was just talking from the free aspect of it.

  • User profile image
    devnull

    after messing around with ffmpeg i found the correct switches to do this.

    for anyone else wanting to do the same here are the command line args:

    single jpg:
    ffmpeg.exe -y -i <source.jpg> -vcodec mpeg2video -pix_fmt yuv422p -aspect 4:3 output.m2v

    sequence of jpgs:
    ffmpeg.exe -y -i <source%d.jpg> -vcodec mpeg2video -pix_fmt yuv422p -aspect 4:3 output.m2v

  • User profile image
    barkha

    devnull wrote:
    after messing around with ffmpeg i found the correct switches to do this.

    for anyone else wanting to do the same here are the command line args:

    single jpg:
    ffmpeg.exe -y -i <source.jpg> -vcodec mpeg2video -pix_fmt yuv422p -aspect 4:3 output.m2v

    sequence of jpgs:
    ffmpeg.exe -y -i <source%d.jpg> -vcodec mpeg2video -pix_fmt yuv422p -aspect 4:3 output.m2v



    Devnull -

    is there any way to add a dely between the Jpegs -itsoffset and -r <rate> do not seem to be working very well for me...

  • User profile image
    wisemx

    Some interesting command line parameters posted here:
    http://iaudiophile.net/forums/showthread.php?t=15172

    btw, I use Camtasia Studio to do this...V5.1 does a great job.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.