[Libav-user] Copy Image Data from Decode Frame To Encode Frame

Alex Cohn alexcohn at netvision.net.il
Sun Sep 15 18:02:44 CEST 2013

On Sun, Sep 15, 2013 at 6:33 PM, James Board <jpboard2 at yahoo.com> wrote:
>>Generally speaking, the answer is yes, you can simply copy encoded
>>packets from demuxer to muxer, if you don't change them. I am sure AVI
>>container will not be upset, but out in the wild, there could be some
>>containers for which this trick may be less straightforward to
>>Generally speaking, the prerequisite is that you copy *all* frames
>>from input to output. If you want to "resample" the output (e.g.
>>convert 60 fps to 15 fps), or want to add some more frames (e.g. merge
>>two video streams into one), or otherwise manipulate the stream or the
>>frames in that stream, your mileage may vary.
> Okay, that's useful.  My input frames are all ffvhuff-encoded and the
> output frames will be the same.  I don't change any of the video data.
> I'm ignoring the audio data.  Sounds like copying packets might work.

Yes, sounds so... The best advice would be to try and see if there is
some problem.

> However, what if I only copy a subset of the input frames to the output
> file?  Can I still copy the packet?  If the answer is no, can I do something
> simple to allow me to copy the packet (like modify a timestamp?).

The best advice again would be to try and see if there is some
problem. Yes, you probably want to manipulate the timestamps.

Alex Cohn

More information about the Libav-user mailing list