[FFmpeg-devel] [PATCH] avfillter/buffersrc: activate and EOF fix

Paul B Mahol onemda at gmail.com
Fri Oct 27 16:07:41 EEST 2023


On Fri, Oct 27, 2023 at 2:54 PM Nicolas George <george at nsup.org> wrote:

> Paul B Mahol (12023-10-27):
> > Subject: [PATCH 1/2] avfilter/buffersrc: switch to activate
> >
> > Signed-off-by: Paul B Mahol <onemda at gmail.com>
> > ---
> >  libavfilter/buffersrc.c | 25 ++++++++++++++++---------
> >  1 file changed, 16 insertions(+), 9 deletions(-)
>
> What would be the benefit?
>
> >      if (s->eof)
> > -        return AVERROR(EINVAL);
> > +        return AVERROR_EOF;
> >
>
> AVERROR_EOF does not have a semantic for writing, only for reading, so
> no.
>

Both patches are required to fix out of memory scenario with this use case:

#!/usr/bin/env bash





which ffmpeg






if [ $# -lt 1 ] ; then



    echo "Usage: ${0} INPUT"



    echo "Example input can be generated with: "



    echo "  ffmpeg -v verbose -filter_complex
'testsrc2=r=25:s=640x480:d=470[out]' -map '[out]' -c:v libx264 -preset
superfast test_clip.mp4"

    exit 1



fi






INPUT="${1}"



COPY_OUTPUT="${INPUT}_copy.mp4"


IMG2_OUTPUT="${INPUT}_img2.jpg"





echo "Input: ${INPUT}"






# if you get ooms, feel free to utilize ulimit



# (ulimit -v 5000000 && )





valgrind --tool=massif --massif-out-file="massif.out.$(date -Iseconds)" \


ffmpeg \



  -y -ignore_unknown \



  -v verbose \



  -i "${INPUT}" \


    -c copy -map 0 \



    -t 470 \



    "${COPY_OUTPUT}" \



  -filter_complex
'[0:0]split=1[thumb_in];[thumb_in]trim=start=420:end=421,scale=720:-2:threads=1,setsar=1/1,hqdn3d,unsharp[thumb_out]'
\

    -map "[thumb_out]" \



    -vframes 1 \



    -f image2 \


  "${IMG2_OUTPUT}"


>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list