Hi all,

I'm really a bit lost and I was hoping that somebody could help me out by 
explaining a couple of things. With the code attached I can generate a .mp4 
file and it shows the correct image if I play it in VLC, but the length of the 
movie is not correct. I have a camera stream that I want to capture (no sound). 
The first captured image is very important for my algorithm. I want to know

  1.  Because my first 13 frame were not written to the .mp4 file, I ended up 
sending the first frame to the encoder (addBufferFrames) until EAGAIN is not 
returned anymore. Is this good practice or not? and why does the encoder need 
those frames, I'm using intra frame compression so each frame should be encoded 
without any other frame, right?
  2.  Since the frame rate is 24 fps and I save 120 frames (see log.txt) I 
should end up with 5 secs of movie but instead it's only 4 secs if I play it in 
VLC


I would really appreciate it if someone could help me with this.
#ifndef IMAGE_H
#define IMAGE_H

#include <mat.hpp> 

class Image 
{
public:

    Image();

    Image( const cv::Mat& mat );

    Image(const Image& other) = default;

    Image(Image&& other) = default;

    ~Image();


    inline const cv::Mat& matrix() const{ return m_matrix; }

    inline const int uniqueImageNumber() const{ return m_uniqueId; }

    inline const int timeStamp() const { return m_timeStamp; }

        inline const int width() const { return m_matrix.cols(); }
        
        inline const int height() const { return m_matrix.rows(); }

private:

    cv::Mat   m_matrix;

    int       m_timeStamp;

        int       m_uniqueId;

};

#endif
#pragma once

#include "xmoviecodec.h"

#include <QDebug>


#define STREAM_PIX_FMT  AV_PIX_FMT_YUV420P /* default pix_fmt */
#define OUTPUT_CODEC AV_CODEC_ID_H264

const double streamDuration( 5.0 );
const int streamFrameRate( 24 );
const int streamNumberOfFrames ((int)(streamDuration * streamFrameRate));

int XMovieCodec::s_frameCount = 0;

XMovieCodec::XMovieCodec( const char* filename ) :
    m_filename( filename ),
    m_encoder( avcodec_find_encoder( OUTPUT_CODEC ))
{
    av_log_set_level(AV_LOG_VERBOSE);

    int ret(0);

   /** Allocate the output media context */
    ret = avformat_alloc_output_context2( &m_formatCtx, m_outputFormat, "mp4", 
m_filename.c_str());

    if (!m_formatCtx)
        return;

    m_outputFormat = m_formatCtx->oformat;

    /** Allocate the codec context */
    m_codecCtx = avcodec_alloc_context3( m_encoder);

    /** Add the video stream using H264 codec */
    addStream();

    if( !m_streamOut )
        return;

    configureEncoder();

    /** Open the output media file, if needed */
    if (!( m_outputFormat->flags & AVFMT_NOFILE))
    {
        ret = avio_open( &m_formatCtx->pb, m_filename.c_str(), AVIO_FLAG_WRITE);

        checkError( ret, "Could not open file : " );
    }
    else
    {
        return;
    }


    /** Write media header */
    ret = avformat_write_header( m_formatCtx, NULL );

    checkError( ret,"Error occurred when opening output file: ");
}



XMovieCodec::~XMovieCodec()
{
}

/* Add an output stream. */
void XMovieCodec::addStream()
{
    if (!( m_encoder ))
    {
        fprintf(stderr, "Could not find encoder for '%s'\n",
            avcodec_get_name( OUTPUT_CODEC ));
        return;
    }

    /** Get the stream for codec */
    m_streamOut = avformat_new_stream(m_formatCtx, m_encoder);

    if (!m_streamOut) {
        fprintf(stderr, "Could not allocate stream\n");
        return;
    }

    m_streamOut->id = m_formatCtx->nb_streams - 1;


    if( m_encoder->type == AVMEDIA_TYPE_VIDEO )
    {
        m_streamOut->codecpar->codec_id = OUTPUT_CODEC;
        m_streamOut->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
        m_streamOut->codecpar->bit_rate = 4 * 1000 * 1000;
        m_streamOut->codecpar->width = 800;
        m_streamOut->codecpar->height = 640;
        m_streamOut->codecpar->format = STREAM_PIX_FMT;
        m_streamOut->r_frame_rate = { streamFrameRate, 1 };
        m_streamOut->avg_frame_rate = { streamFrameRate, 1 };
        m_streamOut->time_base = { 1, streamFrameRate  };
    }
}


void XMovieCodec::configureEncoder()
{
    m_codecCtx->gop_size = 0;
    m_codecCtx->max_b_frames = 0;
    m_codecCtx->time_base = { 1, streamFrameRate };
    m_codecCtx->framerate = { streamFrameRate, 1 };
    m_codecCtx->pix_fmt = STREAM_PIX_FMT;

    m_codecCtx->width = 800;
    m_codecCtx->height = 640;
    m_codecCtx->codec_id = OUTPUT_CODEC;


    if (m_streamOut->codecpar->codec_id == OUTPUT_CODEC)
      av_opt_set( m_codecCtx->priv_data, "preset", "ultrafast", 0 );


    /* open the codec */
    int ret = avcodec_open2(m_codecCtx, m_encoder, 0 );

    checkError( ret, "Could not open video codec: ");
}



void XMovieCodec::encodeImage(const Image &image)
{
    if( m_setStartTime )
    {
        m_startTime = image.timeStamp();
        m_setStartTime = false;
        m_storeInBuffer = true;
    }


    if (!m_streamOut )
       return;

    AVFrame* frame = av_frame_alloc();

    createFrame( image, frame );

        /**
         * fill the encoding buffer with the first image repeatably
         */
    addBufferFrames( frame );

    /**
     * Add a video frame
     */
    writeFrame( frame );

    if( frame )
    {
        av_free( frame->data[0]);
        av_frame_free( &frame );
    }
}



void XMovieCodec::writeFrame( AVFrame* frame )
{
    int ret;


    if ( s_frameCount >= streamNumberOfFrames)
    {
        /* No more frames to compress.*/
        s_frameCount = streamNumberOfFrames;
    }

    frame->pts = s_frameCount;

    if (m_formatCtx->oformat->flags & 0x0020 )
    {
        /* Raw video case - directly store the picture in the packet */
        AVPacket pkt;
        av_init_packet(&pkt);

        pkt.flags |= AV_PKT_FLAG_KEY;
        pkt.stream_index = m_streamOut->index;
        pkt.data = frame->data[0];
        pkt.size = sizeof(AVPicture);

        ret = av_write_frame( m_formatCtx, &pkt );
    }
    else
    {
        AVPacket pkt;
        av_init_packet(&pkt);

        /* encode the image */
        ret = avcodec_send_frame(m_codecCtx, frame);
qDebug() << "send unique " << frame->display_picture_number << " s_frame " << 
s_frameCount << " pts " << frame->pts ;

        checkError( ret, "Error encoding video frame: ");

        while( ret >= 0 )
        {
            ret = avcodec_receive_packet(m_codecCtx, &pkt);

            if (ret == AVERROR(EAGAIN) /*|| ret == AVERROR_EOF*/)
            { 
qDebug() << "return EAGAIN" ;
                return;
            }
            else if (ret < 0)
            {
                  return;
            }

            m_storeInBuffer = false;

            /** only the video stream index is available */
            pkt.stream_index = m_streamOut->index;

            pkt.pts = av_rescale_q( pkt.pts, m_codecCtx->time_base, 
m_streamOut->time_base );
            pkt.dts = av_rescale_q( pkt.dts, m_codecCtx->time_base, 
m_streamOut->time_base );
qDebug() << "codec time " << m_codecCtx->pkt_timebase.den << " stream time " << 
m_streamOut->time_base.den;

//            pkt.duration = av_rescale_q( pkt.duration, 
m_codecCtx->pkt_timebase, m_streamOut->time_base );

            ret = av_write_frame( m_formatCtx, &pkt );
qDebug() << "write packet : pts " << pkt.pts << " dts " << pkt.dts << " 
duration " << pkt.duration;

            s_frameCount++;
        }
    }

}


void XMovieCodec::createFrame( const Image& image, AVFrame* frame )
{
/**
 * Save the raw image to disk
 */
//image.saveToFile("c:\\tmp\\RGBoriginal.png");

    frame->format = STREAM_PIX_FMT;
    frame->width = image.width();
    frame->height = image.height();
    frame->pict_type = AV_PICTURE_TYPE_I;
    frame->display_picture_number = image.uniqueImageNumber();

    int ret = av_image_alloc( frame->data, frame->linesize, frame->width,  
frame->height, STREAM_PIX_FMT, 1);

    if (ret < 0)
    {
        return;
    }

    struct SwsContext* sws_ctx = sws_getContext((int)image.width(), 
(int)image.height(), AV_PIX_FMT_BGR24,
                                                (int)image.width(), 
(int)image.height(), STREAM_PIX_FMT, 0, NULL, NULL, NULL);

    const uint8_t* rgbData[1] = { (uint8_t* )image.getData() };
    int rgbLineSize[1] = { 3 * image.width() };

    sws_scale(sws_ctx, rgbData, rgbLineSize, 0, image.height(), frame->data, 
frame->linesize);

/**
 * save frame to disk
 */
//    saveFrameToDisk( frame );
}


void XMovieCodec::close()
{
    /** reset the framecount */
    s_frameCount = 0 ;

    int ret( 0 );

    /** flush the encoder */
    while( ret >= 0 )
        ret = avcodec_send_frame(m_codecCtx, NULL);

    // Write media trailer
    if( m_formatCtx )
        ret = av_write_trailer( m_formatCtx );

    /* Close the output file. */
    if (!( m_outputFormat->flags & AVFMT_NOFILE))
        ret = avio_close( m_formatCtx->pb);


    /* free the stream */
    avformat_free_context( m_formatCtx );

    fflush( stdout );
}



void XMovieCodec::checkError( const int errID, const std::string& message )
{
    if( errID != 0 )
    {
        char error[255];
        av_strerror( errID, error, 255);
        std::string err( message );
        err.append( error );
        Log::printLine( err );
qDebug() << err.c_str();
        return;
    }
}


void XMovieCodec::saveFrameToDisk( const AVFrame* frame  )
{
    cv::Mat yuv420p( frame->height + frame->height/2, frame->width, CV_8UC1, 
frame->data[0]);
    cv::Mat cvmIm;
    cv::cvtColor(yuv420p,cvmIm,CV_YUV420p2BGR);
    std::ostringstream ss;
    ss << "c:\\tmp\\YUVoriginal_" << frame->display_picture_number << ".png";
    cv::imwrite( ss.str().c_str(), cvmIm);
}


void XMovieCodec::addBufferFrames( AVFrame* frame )
{
    if( m_storeInBuffer)
        while( m_storeInBuffer )
        {
            writeFrame( frame );
        }
}
#ifndef MOVIECODEC_H
#define MOVIECODEC_H

#include "image/Image.h"

extern "C"
{
    #include "Codec/include/libavcodec/avcodec.h"
    #include "Codec/include/libavdevice/avdevice.h"
    #include "Codec/include/libavformat/avformat.h"
    #include "Codec/include/libavutil/avutil.h"
    #include "Codec/include/libavformat/avio.h"
    #include "Codec/include/libavutil/imgutils.h"
    #include "Codec/include/libavutil/opt.h"
    #include "Codec/include/libswscale/swscale.h"
}

class MovieCodec
{
public:

    MovieCodec(const char *filename);

    ~MovieCodec();

    void encodeImage( const Image& image );

    void close();

private:

    void encode( AVFrame *frame, AVPacket *pkt );

    void addStream();

    void configureEncoder();

    void writeFrame(AVFrame *frame );

    void createFrame(const Image& image , AVFrame *frame);

    void checkError( const int errID, const std::string& message );

    void saveFrameToDisk(const AVFrame* frame );

    void addBufferFrames(AVFrame *frame);

private:

    static int s_frameCount;

    bool m_setStartTime = true;

    bool m_storeInBuffer = true;

    int m_startTime;

    std::string m_filename;

    AVCodec* m_encoder = NULL;

    AVOutputFormat* m_outputFormat = NULL;

    AVFormatContext* m_formatCtx = NULL;

    AVCodecContext* m_codecCtx = NULL;

    AVStream* m_streamOut = NULL;

    AVDictionary* m_opts = NULL;
};


#endif // MOVIECODEC_H
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 return EAGAIN
 send unique  371  s_frame  0  pts  0
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  371  s_frame  1  pts  1
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  373  s_frame  2  pts  2
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  375  s_frame  3  pts  3
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  377  s_frame  4  pts  4
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  379  s_frame  5  pts  5
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  380  s_frame  6  pts  6
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  382  s_frame  7  pts  7
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  384  s_frame  8  pts  8
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  386  s_frame  9  pts  9
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  388  s_frame  10  pts  10
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  390  s_frame  11  pts  11
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  392  s_frame  12  pts  12
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  394  s_frame  13  pts  13
 codec time  1  stream time  12288
 pts  0  dts  0  duration  0
 return EAGAIN
 send unique  396  s_frame  14  pts  14
 codec time  1  stream time  12288
 pts  512  dts  512  duration  0
 return EAGAIN
 send unique  398  s_frame  15  pts  15
 codec time  1  stream time  12288
 pts  1024  dts  1024  duration  0
 return EAGAIN
 send unique  399  s_frame  16  pts  16
 codec time  1  stream time  12288
 pts  1536  dts  1536  duration  0
 return EAGAIN
 send unique  401  s_frame  17  pts  17
 codec time  1  stream time  12288
 pts  2048  dts  2048  duration  0
 return EAGAIN
 send unique  403  s_frame  18  pts  18
 codec time  1  stream time  12288
 pts  2560  dts  2560  duration  0
 return EAGAIN
 send unique  405  s_frame  19  pts  19
 codec time  1  stream time  12288
 pts  3072  dts  3072  duration  0
 return EAGAIN
 send unique  407  s_frame  20  pts  20
 codec time  1  stream time  12288
 pts  3584  dts  3584  duration  0
 return EAGAIN
 send unique  409  s_frame  21  pts  21
 codec time  1  stream time  12288
 pts  4096  dts  4096  duration  0
 return EAGAIN
 send unique  411  s_frame  22  pts  22
 codec time  1  stream time  12288
 pts  4608  dts  4608  duration  0
 return EAGAIN
 send unique  413  s_frame  23  pts  23
 codec time  1  stream time  12288
 pts  5120  dts  5120  duration  0
 return EAGAIN
 send unique  415  s_frame  24  pts  24
 codec time  1  stream time  12288
 pts  5632  dts  5632  duration  0
 return EAGAIN
 send unique  417  s_frame  25  pts  25
 codec time  1  stream time  12288
 pts  6144  dts  6144  duration  0
 return EAGAIN
 send unique  418  s_frame  26  pts  26
 codec time  1  stream time  12288
 pts  6656  dts  6656  duration  0
 return EAGAIN
 send unique  420  s_frame  27  pts  27
 codec time  1  stream time  12288
 pts  7168  dts  7168  duration  0
 return EAGAIN
 send unique  422  s_frame  28  pts  28
 codec time  1  stream time  12288
 pts  7680  dts  7680  duration  0
 return EAGAIN
 send unique  424  s_frame  29  pts  29
 codec time  1  stream time  12288
 pts  8192  dts  8192  duration  0
 return EAGAIN
 send unique  426  s_frame  30  pts  30
 codec time  1  stream time  12288
 pts  8704  dts  8704  duration  0
 return EAGAIN
 send unique  428  s_frame  31  pts  31
 codec time  1  stream time  12288
 pts  9216  dts  9216  duration  0
 return EAGAIN
 send unique  430  s_frame  32  pts  32
 codec time  1  stream time  12288
 pts  9728  dts  9728  duration  0
 return EAGAIN
 send unique  432  s_frame  33  pts  33
 codec time  1  stream time  12288
 pts  10240  dts  10240  duration  0
 return EAGAIN
 send unique  434  s_frame  34  pts  34
 codec time  1  stream time  12288
 pts  10752  dts  10752  duration  0
 return EAGAIN
 send unique  436  s_frame  35  pts  35
 codec time  1  stream time  12288
 pts  11264  dts  11264  duration  0
 return EAGAIN
 send unique  438  s_frame  36  pts  36
 codec time  1  stream time  12288
 pts  11776  dts  11776  duration  0
 return EAGAIN
 send unique  439  s_frame  37  pts  37
 codec time  1  stream time  12288
 pts  12288  dts  12288  duration  0
 return EAGAIN
 send unique  441  s_frame  38  pts  38
 codec time  1  stream time  12288
 pts  12800  dts  12800  duration  0
 return EAGAIN
 send unique  443  s_frame  39  pts  39
 codec time  1  stream time  12288
 pts  13312  dts  13312  duration  0
 return EAGAIN
 send unique  445  s_frame  40  pts  40
 codec time  1  stream time  12288
 pts  13824  dts  13824  duration  0
 return EAGAIN
 send unique  447  s_frame  41  pts  41
 codec time  1  stream time  12288
 pts  14336  dts  14336  duration  0
 return EAGAIN
 send unique  449  s_frame  42  pts  42
 codec time  1  stream time  12288
 pts  14848  dts  14848  duration  0
 return EAGAIN
 send unique  451  s_frame  43  pts  43
 codec time  1  stream time  12288
 pts  15360  dts  15360  duration  0
 return EAGAIN
 send unique  453  s_frame  44  pts  44
 codec time  1  stream time  12288
 pts  15872  dts  15872  duration  0
 return EAGAIN
 send unique  455  s_frame  45  pts  45
 codec time  1  stream time  12288
 pts  16384  dts  16384  duration  0
 return EAGAIN
 send unique  457  s_frame  46  pts  46
 codec time  1  stream time  12288
 pts  16896  dts  16896  duration  0
 return EAGAIN
 send unique  458  s_frame  47  pts  47
 codec time  1  stream time  12288
 pts  17408  dts  17408  duration  0
 return EAGAIN
 send unique  460  s_frame  48  pts  48
 codec time  1  stream time  12288
 pts  17920  dts  17920  duration  0
 return EAGAIN
 send unique  462  s_frame  49  pts  49
 codec time  1  stream time  12288
 pts  18432  dts  18432  duration  0
 return EAGAIN
 send unique  464  s_frame  50  pts  50
 codec time  1  stream time  12288
 pts  18944  dts  18944  duration  0
 return EAGAIN
 send unique  466  s_frame  51  pts  51
 codec time  1  stream time  12288
 pts  19456  dts  19456  duration  0
 return EAGAIN
 send unique  468  s_frame  52  pts  52
 codec time  1  stream time  12288
 pts  19968  dts  19968  duration  0
 return EAGAIN
 send unique  470  s_frame  53  pts  53
 codec time  1  stream time  12288
 pts  20480  dts  20480  duration  0
 return EAGAIN
 send unique  472  s_frame  54  pts  54
 codec time  1  stream time  12288
 pts  20992  dts  20992  duration  0
 return EAGAIN
 send unique  474  s_frame  55  pts  55
 codec time  1  stream time  12288
 pts  21504  dts  21504  duration  0
 return EAGAIN
 send unique  476  s_frame  56  pts  56
 codec time  1  stream time  12288
 pts  22016  dts  22016  duration  0
 return EAGAIN
 send unique  477  s_frame  57  pts  57
 codec time  1  stream time  12288
 pts  22528  dts  22528  duration  0
 return EAGAIN
 send unique  479  s_frame  58  pts  58
 codec time  1  stream time  12288
 pts  23040  dts  23040  duration  0
 return EAGAIN
 send unique  481  s_frame  59  pts  59
 codec time  1  stream time  12288
 pts  23552  dts  23552  duration  0
 return EAGAIN
 send unique  483  s_frame  60  pts  60
 codec time  1  stream time  12288
 pts  24064  dts  24064  duration  0
 return EAGAIN
 send unique  485  s_frame  61  pts  61
 codec time  1  stream time  12288
 pts  24576  dts  24576  duration  0
 return EAGAIN
 send unique  487  s_frame  62  pts  62
 codec time  1  stream time  12288
 pts  25088  dts  25088  duration  0
 return EAGAIN
 send unique  489  s_frame  63  pts  63
 codec time  1  stream time  12288
 pts  25600  dts  25600  duration  0
 return EAGAIN
 send unique  491  s_frame  64  pts  64
 codec time  1  stream time  12288
 pts  26112  dts  26112  duration  0
 return EAGAIN
 send unique  493  s_frame  65  pts  65
 codec time  1  stream time  12288
 pts  26624  dts  26624  duration  0
 return EAGAIN
 send unique  494  s_frame  66  pts  66
 codec time  1  stream time  12288
 pts  27136  dts  27136  duration  0
 return EAGAIN
 send unique  496  s_frame  67  pts  67
 codec time  1  stream time  12288
 pts  27648  dts  27648  duration  0
 return EAGAIN
 send unique  498  s_frame  68  pts  68
 codec time  1  stream time  12288
 pts  28160  dts  28160  duration  0
 return EAGAIN
 send unique  500  s_frame  69  pts  69
 codec time  1  stream time  12288
 pts  28672  dts  28672  duration  0
 return EAGAIN
 send unique  502  s_frame  70  pts  70
 codec time  1  stream time  12288
 pts  29184  dts  29184  duration  0
 return EAGAIN
 send unique  504  s_frame  71  pts  71
 codec time  1  stream time  12288
 pts  29696  dts  29696  duration  0
 return EAGAIN
 send unique  506  s_frame  72  pts  72
 codec time  1  stream time  12288
 pts  30208  dts  30208  duration  0
 return EAGAIN
 send unique  508  s_frame  73  pts  73
 codec time  1  stream time  12288
 pts  30720  dts  30720  duration  0
 return EAGAIN
 send unique  510  s_frame  74  pts  74
 codec time  1  stream time  12288
 pts  31232  dts  31232  duration  0
 return EAGAIN
 send unique  512  s_frame  75  pts  75
 codec time  1  stream time  12288
 pts  31744  dts  31744  duration  0
 return EAGAIN
 send unique  513  s_frame  76  pts  76
 codec time  1  stream time  12288
 pts  32256  dts  32256  duration  0
 return EAGAIN
 send unique  515  s_frame  77  pts  77
 codec time  1  stream time  12288
 pts  32768  dts  32768  duration  0
 return EAGAIN
 send unique  517  s_frame  78  pts  78
 codec time  1  stream time  12288
 pts  33280  dts  33280  duration  0
 return EAGAIN
 send unique  519  s_frame  79  pts  79
 codec time  1  stream time  12288
 pts  33792  dts  33792  duration  0
 return EAGAIN
 send unique  521  s_frame  80  pts  80
 codec time  1  stream time  12288
 pts  34304  dts  34304  duration  0
 return EAGAIN
 send unique  523  s_frame  81  pts  81
 codec time  1  stream time  12288
 pts  34816  dts  34816  duration  0
 return EAGAIN
 send unique  525  s_frame  82  pts  82
 codec time  1  stream time  12288
 pts  35328  dts  35328  duration  0
 return EAGAIN
 send unique  527  s_frame  83  pts  83
 codec time  1  stream time  12288
 pts  35840  dts  35840  duration  0
 return EAGAIN
 send unique  529  s_frame  84  pts  84
 codec time  1  stream time  12288
 pts  36352  dts  36352  duration  0
 return EAGAIN
 send unique  531  s_frame  85  pts  85
 codec time  1  stream time  12288
 pts  36864  dts  36864  duration  0
 return EAGAIN
 send unique  532  s_frame  86  pts  86
 codec time  1  stream time  12288
 pts  37376  dts  37376  duration  0
 return EAGAIN
 send unique  534  s_frame  87  pts  87
 codec time  1  stream time  12288
 pts  37888  dts  37888  duration  0
 return EAGAIN
 send unique  536  s_frame  88  pts  88
 codec time  1  stream time  12288
 pts  38400  dts  38400  duration  0
 return EAGAIN
 send unique  538  s_frame  89  pts  89
 codec time  1  stream time  12288
 pts  38912  dts  38912  duration  0
 return EAGAIN
 send unique  540  s_frame  90  pts  90
 codec time  1  stream time  12288
 pts  39424  dts  39424  duration  0
 return EAGAIN
 send unique  542  s_frame  91  pts  91
 codec time  1  stream time  12288
 pts  39936  dts  39936  duration  0
 return EAGAIN
 send unique  544  s_frame  92  pts  92
 codec time  1  stream time  12288
 pts  40448  dts  40448  duration  0
 return EAGAIN
 send unique  546  s_frame  93  pts  93
 codec time  1  stream time  12288
 pts  40960  dts  40960  duration  0
 return EAGAIN
 send unique  548  s_frame  94  pts  94
 codec time  1  stream time  12288
 pts  41472  dts  41472  duration  0
 return EAGAIN
 send unique  550  s_frame  95  pts  95
 codec time  1  stream time  12288
 pts  41984  dts  41984  duration  0
 return EAGAIN
 send unique  551  s_frame  96  pts  96
 codec time  1  stream time  12288
 pts  42496  dts  42496  duration  0
 return EAGAIN
 send unique  553  s_frame  97  pts  97
 codec time  1  stream time  12288
 pts  43008  dts  43008  duration  0
 return EAGAIN
 send unique  555  s_frame  98  pts  98
 codec time  1  stream time  12288
 pts  43520  dts  43520  duration  0
 return EAGAIN
 send unique  557  s_frame  99  pts  99
 codec time  1  stream time  12288
 pts  44032  dts  44032  duration  0
 return EAGAIN
 send unique  559  s_frame  100  pts  100
 codec time  1  stream time  12288
 pts  44544  dts  44544  duration  0
 return EAGAIN
 send unique  561  s_frame  101  pts  101
 codec time  1  stream time  12288
 pts  45056  dts  45056  duration  0
 return EAGAIN
 send unique  563  s_frame  102  pts  102
 codec time  1  stream time  12288
 pts  45568  dts  45568  duration  0
 return EAGAIN
 send unique  565  s_frame  103  pts  103
 codec time  1  stream time  12288
 pts  46080  dts  46080  duration  0
 return EAGAIN
 send unique  567  s_frame  104  pts  104
 codec time  1  stream time  12288
 pts  46592  dts  46592  duration  0
 return EAGAIN
 send unique  569  s_frame  105  pts  105
 codec time  1  stream time  12288
 pts  47104  dts  47104  duration  0
 return EAGAIN
 send unique  570  s_frame  106  pts  106
 codec time  1  stream time  12288
 pts  47616  dts  47616  duration  0
 return EAGAIN
 send unique  572  s_frame  107  pts  107
 codec time  1  stream time  12288
 pts  48128  dts  48128  duration  0
 return EAGAIN
 send unique  574  s_frame  108  pts  108
 codec time  1  stream time  12288
 pts  48640  dts  48640  duration  0
 return EAGAIN
 send unique  576  s_frame  109  pts  109
 codec time  1  stream time  12288
 pts  49152  dts  49152  duration  0
 return EAGAIN
 send unique  578  s_frame  110  pts  110
 codec time  1  stream time  12288
 pts  49664  dts  49664  duration  0
 return EAGAIN
 send unique  580  s_frame  111  pts  111
 codec time  1  stream time  12288
 pts  50176  dts  50176  duration  0
 return EAGAIN
 send unique  582  s_frame  112  pts  112
 codec time  1  stream time  12288
 pts  50688  dts  50688  duration  0
 return EAGAIN
 send unique  584  s_frame  113  pts  113
 codec time  1  stream time  12288
 pts  51200  dts  51200  duration  0
 return EAGAIN
 send unique  586  s_frame  114  pts  114
 codec time  1  stream time  12288
 pts  51712  dts  51712  duration  0
 return EAGAIN
 send unique  588  s_frame  115  pts  115
 codec time  1  stream time  12288
 pts  52224  dts  52224  duration  0
 return EAGAIN
 send unique  589  s_frame  116  pts  116
 codec time  1  stream time  12288
 pts  52736  dts  52736  duration  0
 return EAGAIN
 send unique  591  s_frame  117  pts  117
 codec time  1  stream time  12288
 pts  53248  dts  53248  duration  0
 return EAGAIN
 send unique  593  s_frame  118  pts  118
 codec time  1  stream time  12288
 pts  53760  dts  53760  duration  0
 return EAGAIN
 send unique  595  s_frame  119  pts  119
 codec time  1  stream time  12288
 pts  54272  dts  54272  duration  0
 return EAGAIN
 send unique  597  s_frame  120  pts  120
 codec time  1  stream time  12288
 pts  54784  dts  54784  duration  0
 return EAGAIN
 close 
 flushed codec 
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to