Lines Matching refs:frame
179 AVFrame *frame = ist->sub2video.frame;
181 av_frame_unref(frame);
182 ist->sub2video.frame->width = ist->dec_ctx->width ? ist->dec_ctx->width : ist->sub2video.w;
183 ist->sub2video.frame->height = ist->dec_ctx->height ? ist->dec_ctx->height : ist->sub2video.h;
184 ist->sub2video.frame->format = AV_PIX_FMT_RGB32;
185 if ((ret = av_frame_get_buffer(frame, 0)) < 0)
187 memset(frame->data[0], 0, frame->height * frame->linesize[0]);
224 AVFrame *frame = ist->sub2video.frame;
228 av_assert1(frame->data[0]);
229 ist->sub2video.last_pts = frame->pts = pts;
231 ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter, frame,
235 av_log(NULL, AV_LOG_WARNING, "Error while add the frame to buffer source(%s).\n",
242 AVFrame *frame = ist->sub2video.frame;
248 if (!frame)
271 dst = frame->data [0];
272 dst_linesize = frame->linesize[0];
274 sub2video_copy_rect(dst, dst_linesize, frame->width, frame->height, sub->rects[i]);
286 /* When a frame is read from a file, examine all sub2video streams in
287 the same file and send the sub2video frame again. Otherwise, decoded
289 (possibly overlay) is desperately waiting for a subtitle frame. */
292 if (!ist2->sub2video.frame)
297 /* do not send the heartbeat frame if the subtitle is already ahead */
322 av_log(NULL, AV_LOG_WARNING, "Flush the frame error.\n");
531 AVFrame *frame;
532 while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0)
533 av_frame_free(&frame);
620 av_frame_free(&ist->sub2video.frame);
765 AVFrame *frame)
767 double float_pts = AV_NOPTS_VALUE; // this is identical to frame.pts but with higher precision
769 if (!frame || frame->pts == AV_NOPTS_VALUE ||
783 av_rescale_q(frame->pts, filter_tb, tb) -
789 frame->pts =
790 av_rescale_q(frame->pts, filter_tb, enc->time_base) -
798 frame ? av_ts2str(frame->pts) : "NULL",
799 frame ? av_ts2timestr(frame->pts, &enc->time_base) : "NULL",
808 static int init_output_stream(OutputStream *ost, AVFrame *frame,
811 static int init_output_stream_wrapper(OutputStream *ost, AVFrame *frame,
820 ret = init_output_stream(ost, frame, error, sizeof(error));
869 fprintf(vstats_file, "frame= %5"PRId64" q= %2.1f ", frame_number,
872 fprintf(vstats_file, "out= %2d st= %2d frame= %5"PRId64" q= %2.1f ", ost->file_index, ost->index, frame_number,
892 static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
897 const char *action = frame ? "encode" : "flush";
900 if (frame) {
907 av_ts2str(frame->pts), av_ts2timestr(frame->pts, &enc->time_base),
914 ret = avcodec_send_frame(enc, frame);
915 if (ret < 0 && !(ret == AVERROR_EOF && !frame)) {
916 av_log(NULL, AV_LOG_ERROR, "Error submitting %s frame to the encoder\n",
931 av_assert0(frame); // should never happen during flushing
975 AVFrame *frame)
979 adjust_frame_pts_to_encoder_tb(of, ost, frame);
984 if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0)
985 frame->pts = ost->sync_opts;
986 ost->sync_opts = frame->pts + frame->nb_samples;
987 ost->samples_encoded += frame->nb_samples;
989 ret = encode_frame(of, ost, frame);
1120 delta0 = sync_ipts - ost->sync_opts; // delta0 is the "drift" between the input frame (next_picture) and where it would fall in the output.
1123 /* by default, we output a single frame */
1124 nb0_frames = 0; // tracks the number of times the PREVIOUS frame should be duplicated, mostly for variable framerate (VFR)
1134 av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0);
1191 "*** dropping frame %"PRId64" from stream %d at ts %"PRId64"\n",
1196 av_log(NULL, AV_LOG_ERROR, "%"PRId64" frame duplication too large, skipping\n", nb_frames - 1);
1210 /* duplicates frame if needed */
1331 * Unlike video, with audio the audio frame size matters.
1333 * do the buffering deed for us, and thus the frame size parameter
1335 * frame size? From the initialized AVCodecContext of an audio
1568 av_bprintf(&buf, "frame=%5"PRId64" fps=%3.*f q=%3.1f ",
1570 av_bprintf(&buf_script, "frame=%"PRId64"\n", frame_number);
1918 "%s: corrupt decoded frame in stream %d\n", input_files[ist->file_index]->ctx->url, ist->st->index);
1937 static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference)
1948 need_reinit = ifilter->format != frame->format;
1952 need_reinit |= ifilter->sample_rate != frame->sample_rate ||
1953 av_channel_layout_compare(&ifilter->ch_layout, &frame->ch_layout);
1956 need_reinit |= ifilter->width != frame->width ||
1957 ifilter->height != frame->height;
1964 if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
1965 (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data))
1968 if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) {
1975 ret = ifilter_parameters_from_frame(ifilter, frame);
1980 /* (re)init the graph if possible, otherwise buffer the frame and return */
1983 AVFrame *tmp = av_frame_clone(frame);
2007 ret = av_buffersrc_add_frame_flags(ifilter->filter, frame, buffersrc_flags);
2044 // There is the following difference: if you got a frame, you must call
2047 static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
2061 ret = avcodec_receive_frame(avctx, frame);
2081 "Failed to inject frame into filter network: %s\n", av_err2str(ret));
2313 if (ist->sub2video.frame) {
2487 // Decode only 1 frame per call on EOF to appease these FATE tests.
2954 static int init_output_stream_encode(OutputStream *ost, AVFrame *frame)
2991 // reduce frame rate for mpeg4 to be within the spec limits
3043 if (frame) {
3044 enc_ctx->color_range = frame->color_range;
3045 enc_ctx->color_primaries = frame->color_primaries;
3046 enc_ctx->color_trc = frame->color_trc;
3047 enc_ctx->colorspace = frame->colorspace;
3048 enc_ctx->chroma_sample_location = frame->chroma_location;
3056 if (frame) {
3059 frame->top_field_first = !!ost->top_field_first;
3061 if (frame->interlaced_frame) {
3063 enc_ctx->field_order = frame->top_field_first ? AV_FIELD_TT:AV_FIELD_BB;
3065 enc_ctx->field_order = frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
3117 static int init_output_stream(OutputStream *ost, AVFrame *frame,
3127 ret = init_output_stream_encode(ost, frame);
3323 * to be configured with the correct audio frame size, which is only
3844 /* duration is the length of the last frame in a stream
3846 * last video frame length because it's not defined exactly */
3875 * the duration of the stream without the last frame */
4188 * @param[out] best_ist input stream where a frame would allow to continue
4268 * audio frame buffering/creation to get the output audio frame size
4269 * in samples correct. The audio frame size for the filter chain is
4274 * puts one frame "ready to be given out", which means that any