开发者

How to reset FFmpeg static global variables?

开发者 https://www.devze.com 2023-01-31 06:37 出处:网络
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 p

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消