[Ffmpeg-devel] Motion Jpeg to mpeg2
Behrbaum, Jeffrey S
Thu Aug 11 16:35:23 CEST 2005
Hi again to all. I apologize but in my original email I didn't give enough information. The reason I can't use the ffmpeg command itself is because I need to have this capability within my program and I can't use the system command to kick off another executable. So I am trying to mimic the command "ffmpeg -i mypics%d.jpg -vcodec mpeg2video myvideo.mpg" So can someone tell me if my concept is correct? All I should need to do is pull in an unsigned char * which holds an individual jpeg, get that into an AVPicture* and then pass that into the img_convert and then onto the avcodec_encode_video function.
1) How do you get the jpeg buffer into an AVPicture
2) If avcodec_encode_video takes an AVFrame, is my AVPicture from img_convert automatically cast?
Thank you again to any and all for your help.
From: Martin Boehme [mailto:boehme at inb.uni-luebeck.de]
Sent: Wednesday, August 10, 2005 3:32 AM
To: FFMpeg development discussions and patches
Subject: Re: [Ffmpeg-devel] Motion Jpeg to mpeg2
Behrbaum, Jeffrey S wrote:
> Hi all. I'm trying to take a bunch of jpeg's (not jfif's) and put them into
> an mpeg2 stream My question is how do you do this.
If this is really all you want to do, you don't have to write your own
program... just do
ffmpeg -i mypics%d.jpg -vcodec mpeg2video myvideo.mpg
(assuming your JPEGs are called mypics1.jpg, mypics2.jpg...)
> I have everything setup
> but am having trouble figuring out exactly what to do with the images I have.
> There is a segment of ffmpeg sample code where a dummy frame is being set up,
> see below (from apiexample.c line 235) Now, I have a mono color jpeg (see
> attached if you'd like) and I'm not sure what to do with it before passing
> it into avcodec_encode_video.
You don't say what you're using to read the JPEG into memory, but if
it's libjpeg or similar, you probably have that JPEG in RGB format, so
you'll have to convert it to planar YUV using img_convert().
There's a sample program in an article I wrote
that does the reverse conversion (i.e. YUV-to-RGB)... hope you'll be
able to figure it out from there.
Inst. f. Neuro- and Bioinformatics
Ratzeburger Allee 160, D-23538 Luebeck
Phone: +49 451 500 5514
Fax: +49 451 500 5502
boehme at inb.uni-luebeck.de
ffmpeg-devel mailing list
ffmpeg-devel at mplayerhq.hu
More information about the ffmpeg-devel