[Ffmpeg-devel] Re: img_convert crashes

Anders Moden ffmpeg
Wed Aug 23 21:58:42 CEST 2006


Hi !

23 aug 2006 kl. 09.10 skrev Mohnhaupt, Denis:

> Hi,
>
>
>
> this is the code I used to decode the video, where the error occurs
>
>
>
> global Variables are
>
>
>
> AVFormatContext *pFormatCtx;
>
> int             i, videoStream;
>
> AVCodecContext  *pCodecCtx;
>
> AVCodec         *pCodec;
>
> AVFrame         *pFrame;
>
> AVFrame         *pFrameRGB;

etc..

Create a buffer for the pFrameRGB Frame first. I use my texture  
buffer directly. The pframeRGB member data points to the buffer .
Use av_fill_frame (or something like that. Hvn't got the code here)  
where you supply your texture buffer pointer and dimensions of the  
buffer.

Next step is to set the linesize to a negative value wich gives a  
negative stride in the conversion and the last step is to set the  
actual buffer pointer to the last line instead.

This trick gives you a swapped texture in the img_convert call  
directly without the need of your copy.

I can show you some code if you are interested. Have integrated  
stereo sourround sound and video into my scene graf with very good  
performance.

You can take a close look at npot extensions and pixel_buffer to get  
extreme upload performance

/Anders Mod?n
www.gizmosdk.se





More information about the ffmpeg-devel mailing list