On Mon, 2010-09-20 at 18:30 -0400, Michael Chisholm wrote:
> I have a transcoder app which uses libav*.  Video comes in via UDP, and I 
> want 
> to be more robust when the encoding can't keep up with the rate at which 
> video 
> comes in.  So I want to decouple the video demuxing/decoding from the 
> encoding, 
> using multiple threads: one thread decodes frames, another thread encodes 
> frames.  If another frame comes in while a frame is already waiting to be 
> encoded, it is dropped.  As opposed to just letting UDP randomly drop 
> packets, 
> which can seriously mess with the video quality.
> 
> Unfortunately, a decoded frame is coupled to the decoder codec context: the 
> codec context owns the frame data.  That means it can't continue to decode 
> frames without clobbering the one I want to save.  I need a frame which can 
> exist independently of any codec context.
> 
> So what's the best way to duplicate a frame?  The only way I can see is with 
> swscale, but I don't want to scale it, at least not yet.  Just a simple fast 
> memcpy would do.  Is there a function I've overlooked to do this?
> 
> Andy

How about av_picture_copy()? You probably should buffer them a short
time using a small FIFO to avoid dropping frames. Also, you might want
to look up how muxing variable framerate works. I explained how it can
be done in a thread here yesterday.

/Tomas

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to