[Libav-user] avcodec_receive_packet output for every input frame

Vittalprasad vittalprasad.br at gmail.com
Thu Apr 5 13:35:29 EEST 2018


Hi Henri,

Thank you for valuable suggestion.


Best Regards,
vittal

On Thu, Apr 5, 2018 at 3:27 PM, Henri Zikken <zikken at xs4all.nl> wrote:

> 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 <libav-user-bounces at ffmpeg.org> *Namens *Vittalprasad
> *Verzonden:* donderdag 5 april 2018 11:03
> *Aan:* libav-user at ffmpeg.org
> *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
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>


-- 
Thanks & Regards
Vittal Prasad B R
9066662597
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180405/ab6bdda6/attachment.html>


More information about the Libav-user mailing list