[FFmpeg-user] Cut part of a video, crop it and blackout parts of it

Michael Koch astroelectronic at t-online.de
Mon Apr 5 10:40:17 EEST 2021


Am 05.04.2021 um 01:48 schrieb Cecil Westerhof via ffmpeg-user:
> I have to cut out a part of a video, crop it and blackout two parts.
> I do this with:
>      ffmpeg -y                                      \
>             -ss 00:19:49                            \
>             -i  2021-03-25ToastmastersClubAvond.mp4 \
>             -to 442                                 \
>             -vf "
>                  crop = 1440:1080:240:0
>                  ,
>                  drawbox=enable='between(t, 0, 2)'     :
>                     color     = black                  :
>                     w         = in_w                   :
>                     h         = in_h                   :
>                     thickness = fill
>                  ,
>                  drawbox=enable='between(t, 339, 342)' :
>                     color     = black                  :
>                     w         = in_w                   :
>                     h         = in_h                   :
>                     thickness = fill
>             "                                       \
>             -acodec copy                            \
>             -vcodec libx264                         \
>             -crf    23                              \
>             speechClean2.mp4
>
> The reason I do -to in the output is that in this way the metadata
> concerning the video length is less out of whack.
>
> I was wondering if this is a good way, or that it could be done
> better?
> Also, beside the timestamps the parameters for drawbox are the same.
> Is there a way that I do not have to repeat them?

drawbox=enable='bitor(between(t, 0, 2),between(t, 339, 342))'

Michael



More information about the ffmpeg-user mailing list