apc-llc / moviemaker-cpp

Encode video frame by frame in C++ using FFmpeg
MIT License
88 stars 14 forks source link

Too many deprecated warning #1

Open arinkverma opened 6 years ago

arinkverma commented 6 years ago

Hi @apc-llc

Against which FFmpeg version should I compiled code?

dmikushin commented 6 years ago

I'm using ffmpeg from standard Ubuntu 16.04 repositories.

On Mon, Aug 13, 2018, 22:13 Arink Verma notifications@github.com wrote:

Hi @apc-llc https://github.com/apc-llc

Against which FFmpeg version should I compiled code?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apc-llc/moviemaker-cpp/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AFaPqpafIcvlHz5eTpPPD5l0v7DrnCrXks5uQd3rgaJpZM4V7J2- .

AndreiCherniaev commented 1 year ago

As you know, avcodec_encode_video2 & avcodec_encode_audio2 seems to be deprecated. FFmpeg of Current Version (4.2) has new API: avcodec_send_frame & avcodec_receive_packet.

I suggest rewrite code base on this description. But I need help.

dmikushin commented 1 year ago

But I need help.

Is there any specific difficulty or a question?

AndreiCherniaev commented 1 year ago

specific difficulty

For example I try rewrite this way, but it is a mistake... For me still not clear how use avcodec_send_frame() and avcodec_receive_packet().

    //int got_output;
    //int ret = avcodec_encode_video2(c, &pkt, yuvpic, &got_output);
    int ret = avcodec_send_frame(c, yuvpic);
    if (ret) {
        fprintf(stderr, "err avcodec_send_frame()\n");
        exit(1);
    }
    ret = avcodec_receive_packet(c, &pkt); //SIGABRT here
    if (ret) {
        fprintf(stderr, "err avcodec_receive_packet()\n");
        exit(1);
    }else
    //if (got_output)
    {
        fflush(stdout);