On 09/04/2016 10:52 AM, M N wrote:
Gonzalo then how should I continue to read packets from input format context 
and write them to output format context?

04.09.2016, 05:14, "Charles" <[email protected]>:
On 09/03/2016 08:34 PM, Gonzalo Garramuño wrote:
 El 03/09/2016 a las 17:55, M J escribió:
 Hi

MJ,
I probably wasn't clear, each call is dependent on the return value of the 
previous call.
i.e. if you did not get return 0 or EAGIN from send_packet you should probably 
not call receive_frame


 while(av_read_frame(input_ctx, pkts) == 0)
 {
          //decoding
          int ret1 = avcodec_send_packet(input_codecCtx, pkts);
          int ret2 = avcodec_receive_frame(input_codecCtx, rawFrame);

Why don't you just print the return values. SEE av_strerror
https://ffmpeg.org/doxygen/3.1/group__lavu__error.html#ga5792b4a2d18d7d9cb0efbcfc335dce24


          //encoding
          avcodec_send_frame(output_codecCtx, rawFrame);
          avcodec_receive_packet(output_codecCtx, pktr);

These have return values also.


          int ret = av_interleaved_write_frame(output_ctx, pktr);
 }
 *************************************************
 Hi, MJ.

Assuming everything is setup correctly, and 1 frame -> 1 packet && 1 packet -> 
1 frame

while ( av_read_frame == 0 )
   if avcodec_send_packet == 0
      if avcodec_receive_frame == 0
         if avcodec_send_frame == 0
            if avcodec_receive_packet == 0
               av_interleaved_write_frame

But, each of those IF's have multiple return values
What are you going to do if the return is AVERROR(EAGAIN) or AVERROR_EOF
What about the frame delay on the encoder?

Thanks
cco


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

Reply via email to