<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-03-05 8:43 GMT-05:00 Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:ceffmpeg@gmail.com" target="_blank">ceffmpeg@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2017-03-05 2:52 GMT+01:00 Gustav González <<a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a>>:<br>
<br>
> QImage img = image.convertToFormat(Format_R<wbr>GB888);<br>
<br>
Not necessarily related: Why are you not using libswscale or<br>
the scale filter?<br></blockquote><div><br></div><div>In fact, I tried it using different parameters for a week. That was my first approach to the problem, but always I got an error message from the encoder, telling me that the AVFrame format was wrong. <br></div><div>Looking for a solution, I found this alternative that only requires two lines to get an accurate AVFrame. All I can say about it, is that it's working. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> avpicture_fill((AVPicture *)frame, img.bits(), AV_PIX_FMT_RGB24, w, h);<br>
<br>
</span>FFmpeg's git encoder does not support RGB24, so whatever you are<br>
doing is unfortunately not supported here.<br></blockquote><br clear="all"></div>Someone told me the same. So I started to use the format AV_FIX_FMT_RGB8. The funny thing was that while I was running my program, I got a (red) warning message from the libav API, asking me to use RGB24. I already checked the gif.c code, and effectively there is NOT support for RGB24. I can't explain it.<br><br></div><div class="gmail_extra">Counting on I have been researching about this topic for around a month, testing all the logic suggestions and the crazy ones, I decided to change the format to RGB24, following the libav warning advice. Crazy or not, the warning message disappeared and the code works, I mean, I got an animated GIF from a sequence of QImage objects.<br><br></div><div class="gmail_extra">About the pending issue, I thought it was related to the FPS variable of the files but I was wrong, the problem is the size of them, they are giants! (MBs for every second) So large, that the browser only can play them slowly. I ran other tests using mplayer and the speed of the animations is right.<br><br></div><div class="gmail_extra">So, my next challenge is to low the size of the frames to finish my implementation. Any hint? <br></div><br><div class="gmail_extra">-- <br><div class="m_2452827514829651599gmail_signature" data-smartmail="gmail_signature">============================<br> Gustav Gonzalez<br> <a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a><br>============================</div>
</div></div>