[FFmpeg-devel] How to correctly use init and uninit

Paul B Mahol onemda at gmail.com
Fri Apr 19 15:35:23 EEST 2019


On 4/19/19, Ulf Zibis <Ulf.Zibis at cosoco.de> wrote:
>
> Am 19.04.19 um 13:38 schrieb Paul B Mahol:
>>
>> Use either av_freep(&s->filler) or av_free(s->filler).
>
> It works fine without 'p'. Thanks!
>
> Do I really need the init function, as it has to do nothing in my case?

If it does nothing, you can safely remove it.

>
> static av_cold int init(AVFilterContext *ctx)
> {
>     FillBordersContext *s = ctx->priv;
>     return 0;
> }
>
>
>> You do not need to use loop filter on single png.
> I need real pictures to prove the correctness of my hacking. The
> smptebars is not appopriate to see errors in the output e.g. from mirroring.
>
>> Use something like this:
>>
>> ffmpeg -f lavfi -i smptebars=size=hd720 -vf fillborders=... -f null -
> For performance testing I use the like:
> -f rawvideo -pix_fmt gray16 -s 400x600 -i /dev/zero
>
> Are there doubts if that is good either?

Use ffmpeg -f lavfi -i color=color=black:size=400x600 ...

Thing about /dev/zero and -f rawvideo is that it will decode zeroes
over and over again and thus use more CPU for that.


More information about the ffmpeg-devel mailing list