[FFmpeg-devel] FFmpeg A/V filtering questions

Michael Niedermayer michaelni at gmx.at
Mon Feb 13 20:14:43 CET 2012


On Mon, Feb 13, 2012 at 04:15:12PM +0100, Clément Bœsch wrote:
> 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?

copying the motion vectors & macroblock types


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

theres no point


> 
> 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?

yes

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120213/03333f97/attachment.asc>


More information about the ffmpeg-devel mailing list