How to encode a video from several images generated in a C++ program without writing the separate frame images to disk?

后端 未结 4 761
北海茫月
北海茫月 2020-12-07 15:51

I am writing a C++ code where a sequence of N different frames is generated after performing some operations implemented therein. After each frame is completed, I write it o

4条回答
  •  旧时难觅i
    2020-12-07 16:32

    Thanks for your excellent work, @ksb496 !

    One minor improvement:

    c=avcodec_alloc_context3(codec);
    

    should be better written as:

    c = stream->codec;
    

    to avoid a memory leak.

    If you don't mind, I've uploaded the complete ready-to-deploy library onto GitHub: https://github.com/apc-llc/moviemaker-cpp.git

提交回复
热议问题