anyone got any information about how to convert a jpg to a mpg? in c# would be nice
-
-
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.
-
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 $$ -
cool ill have a look at that.
thanks -
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.
-
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 -
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. -
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! -
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?
-
Mplayer's mencoder will probably do this, it's not exactly trivial to use though.
-
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.
-
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. -
Yea I was just talking from the free aspect of it.
-
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 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...
-
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.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.