How to reset FFmpeg static global variables?
Im trying to create a movie from set of PNG
images using FFmpeg
in iPhone
. Later merging the video created with audio which is recorded separat开发者_StackOverflow中文版ely. I can call this as a two phases of my first pass. But when I start my second pass, FFmpeg
crashes in first phase. I know that this because the global variables set in first pass are not reset during the second pass. Is there any way to reset the static global variables set to the FFmpeg
?
In my case I am getting error like "frame size changed to 320x400, bgra", even though the images are set to PNG
before I start my second pass.
This issue got resolved now. After debugging the FFmpeg code, I found that the pixel format was not reset and it was retaining the previously set value. Fix is to reset the "frame_pix_fmt = PIX_FMT_NONE" before you start actual encoding. "frame_pix_fmt" is declared as a static global variable in ffmpeg.c.
精彩评论