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

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

Reply via email to