avcodec YUV to RGB

后端 未结 1 1438
野趣味
野趣味 2021-01-14 02:00

I\'m trying to convert an YUV frame to RGB using libswscale.

Here is my code :

AVFrame *RGBFrame;
SwsContext *ConversionContext;

ConversionContext =         


        
相关标签:
1条回答
  • 2021-01-14 02:17

    av_frame_alloc only allocates memory for the frame object itself, it does not allocate memory to store the image data. Have you done:

    FillVect.resize( avpicture_get_size( PIX_FMT_RGB24, FrameWidth, FrameHeight ) );

    somewhere in your code before calling avpicture_fill? Or some other way to make sure FillVect allocates enough memory to keep the whole decoded picture?

    Did you try to run it under valgrind to see what exactly trigges SEGFAULT?

    0 讨论(0)
提交回复
热议问题