<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p><span style='color:#1F497D'>></span>Somebody know how can i add black frames with some text to obtain a output video.<span style='color:#1F497D'><o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Juan,<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>This is somewhat close to what I’ve been doing – except that I had my images in RGB format. If you can generate the RGB images and put each image data in an array, then you can<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>1) Use sws_scale to convert each rgb image to yuv format.<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>2) Use avcodec_encode_video2/av_packet_rescale_ts to add each frame to your output stream. Make sure to flush everything by passing a NULL frame as many times as necessary at the end.<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Of course, there are a lot more details other than these calls (AVFormatContext, etc.). But if you’re familiar with the general procedure then I suggest that for each black frame with text you want to add just create the RGB image for that (hopefully, this is not too difficult), convert the RGB to YUV, and add the frame.<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Good luck!<o:p></o:p></span></p><p><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>-Arthur<o:p></o:p></span></p></div></body></html>