[FFmpeg-devel] FFmpeg A/V filtering questions

Clément Bœsch ubitux at gmail.com
Mon Feb 13 16:15:12 CET 2012


Hi,

I have a few questions about this part of the code in ffmpeg.c (around L2140):

    avcodec_get_frame_defaults(ist->filtered_frame);
    filtered_frame = ist->filtered_frame;
    *filtered_frame= *decoded_frame; //for me_threshold
    if (ost->picref) {
        avfilter_fill_frame_from_video_buffer_ref(filtered_frame, ost->picref);
        filtered_frame->pts = av_rescale_q(ost->picref->pts, ist_pts_tb, AV_TIME_BASE_Q);
    }
    if (ost->picref->video && !ost->frame_aspect_ratio)
        ost->st->codec->sample_aspect_ratio = ost->picref->video->sample_aspect_ratio;
    do_video_out(output_files[ost->file_index].ctx, ost, ist, filtered_frame);

1) how is *filtered_frame = *decoded_frame (only?) related to me_threshold?

2) what is the point of getting the frame defaults if they are overwritten just
   after that (first 3 lines)?

3) ost->picref can't be changed in the "if (ost->picref)" scope, so it looks
   like to me that "if (ost->picref->video)" will leads to a sigsegv if
   ost->picref was NULL in the first place. Since no such bug exists at
   the moment (AFAIK), couldn't we just drop the "if (ost->picref)" block?

4) why is there an exception for the sample aspect ratio since
   avfilter_fill_frame_from_video_buffer_ref() will actually do that
   copy?

5) what is the audio equivalent for
   avfilter_fill_frame_from_video_buffer_ref()? According to
   libavdevice/lavfi.c, it seems to only need the data memcpy() and a few
   props copy.

6) libavdevice/lavfi.c seems to have a similar code to
   avfilter_fill_frame_from_video_buffer_ref(); why is it handled differently
   than in ffmpeg.c?

If anyone can answer a few questions, that would be welcome :)

Thank you,

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120213/ee5136d1/attachment.asc>


More information about the ffmpeg-devel mailing list