<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>I'm writing a simple libAV program that reads an AVI file, decodes each<br>frame, then writes that frame data to another AVI file as output.  The output<br>file should be pretty much the same as the input file.<br><br>I'm using the examples in the ffmpeg source as a start.  This is how<br>each frame from the input file gets decoded.<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">    avcodec_decode_video2(tmpCodecContextForInputFile, myFrameDecode, got_frame, &pktDecode);<br><br>Then, in another subroutine, this is how each frame gets encoded for the<br>output file:<br>    avcodec_encode_video2(tmpCodecContextForOutputFile, &pktEncode, myFrameEncode,
 &got_packet);<br><br>In between the two calls above, I have to convert the image data from<br>myFrameDecode to image data in myFrameEncode.  That's what I'm having trouble<br>with.  Right now I have lots of row/col loops and they do things differently<br>for different pixel formats.  Is there a single subroutine I can that can<br>convert the image data from myFrameDecode to the image data in myFrameEncode?<br><br>Also, if the input and output file have the same pixel format, is there a<br>simple way to copy the data from one to the other?<br><br>Thanks</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div></div></body></html>