Thanks, Edwin.

Not quite what I'm trying to do, as I actually need to save arbitrary
frames rather than the whole lot. The story behind it is that I've
written a small utility program using the FFMPEG libraries that reads a
video file and then does OCR on the frames to look for discontinuities
in time codes that are overlaid on the original video.

It's only a utility, because someone else has written the video display
program that this project is a part of, and he was unable to do the
character recognition stuff. Now he tells me that he needs to get small
single or multiple frame captures from the video and save them as JPEGs.

That's my new task. I'm already using libavformat, etc in my code to
read the frames, and I've adapted the frame accurate seek library code,
too. The whole lot is running under Windows, but Linux and OS/X versions
are needed.

I thought the really hard part was solved until I tried to work out how
to save a single frame as a JPEG.

Regards,

Clive

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Edwin van der
Horst
Sent: 30 March 2009 20:01
To: Libav* user questions and discussions
Subject: Re: [libav-user] Writing single frames to JPEG

Clive,

Maybe this is not what you mean,
But why don't you just decode the movie and encode using MJPEG codec.
 This will generate seperate JPEG files.
Hth

Edwin

On Mon, Mar 30, 2009 at 7:21 PM, Clive Taylor <[email protected]>
wrote:
> OK. I admit it. I'm being thick.
>
>
>
> How do I write a single frame from any video source to a jpeg file.
The
> command line version of FFMPEG will obviously do it, and the
libavcodec
> source file mjepgenc.c will write the JFIF header, so I would guess
that
> getting the library to do all the tedious DCT stuff for me should be
> fairly obvious, it's just that I can't quite see how at the moment.
>
>
>
> Is it as simple as using img_convert to set the output format to one
of
> the PIX_FMT_YUVJ4xxP formats and writing the resulting AVPicture data
to
> disk (as I would if it were a PPM/PGM file that I needed to create)?
>
>
>
> Sorry if the answer's obvious and I've just missed something.
>
>
>
> Clive
>
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user


_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to