[Libav-user] Black frames
muller at vki.com
Thu Feb 11 01:39:27 CET 2016
>Somebody know how can i add black frames with some text to obtain a output video.
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
1) Use sws_scale to convert each rgb image to yuv format.
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user