You can’t change this. The encoder needs to start it’s encoding and it needs 
input for this. However, 58 frames seems like a lot.

 

You can try this:

 

av_opt_set(context->priv_data, "tune", "zerolatency", 0);

 

to see if this improves the situation.

 

Also take a look at this:

 

https://trac.ffmpeg.org/wiki/StreamingGuide#Latency

 

 

 

 

 

 

Van: Libav-user <[email protected]> Namens Vittalprasad
Verzonden: donderdag 5 april 2018 11:03
Aan: [email protected]
Onderwerp: [Libav-user] avcodec_receive_packet output for every input frame

 

At the beginning of encoding, the H264 Encoder is accepting multiple input 
frames without returning a encoded stream, in my case it is accepting  58 input 
frames.

what changes are required  at encoder side to get output frame for every input 
frame, i.e o/p frame for i/p frame iteration?

below is encoder code.

ret = avcodec_send_frame(c_enc, frame);

        if (ret < 0)

        {

                fprintf(stderr, "Error sending a frame for encoding\n");

                exit(1);

        }

 while (1) {

 ret = avcodec_receive_packet(c_enc, pkt);

        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)

                break;

       else

     ///dump encoded packet in to file

}



-- 

Thanks & Regards
Vittal Prasad B R





_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to