[FFmpeg-user] Overlay images to frames in video

pdr0 pdr0 at shaw.ca
Wed Apr 7 22:28:05 EEST 2021


Rainer M. Krug-2 wrote
> Hi
> 
> First poster, o apologies for any forgotten info.
> 
> 
> I have a video with the following metadata:
> 
> ```
> $ ffprobe ./1.pre-processed.data/bemovi/20210208_00097.avi
> ffprobe version 4.3.2 Copyright (c) 2007-2021 the FFmpeg developers
>   built with Apple clang version 12.0.0 (clang-1200.0.32.29)
>   configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.2_4 --enable-shared
> --enable-pthreads --enable-version3 --enable-avresample --cc=clang
> --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls
> --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d
> --enable-libmp3lame --enable-libopus --enable-librav1e
> --enable-librubberband --enable-libsnappy --enable-libsrt
> --enable-libtesseract --enable-libtheora --enable-libvidstab
> --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264
> --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma
> --enable-libfontconfig --enable-libfreetype --enable-frei0r
> --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq
> --enable-libzimg --disable-libjack --disable-indev=jack
> --enable-videotoolbox
>   libavutil      56. 51.100 / 56. 51.100
>   libavcodec     58. 91.100 / 58. 91.100
>   libavformat    58. 45.100 / 58. 45.100
>   libavdevice    58. 10.100 / 58. 10.100
>   libavfilter     7. 85.100 /  7. 85.100
>   libavresample   4.  0.  0 /  4.  0.  0
>   libswscale      5.  7.100 /  5.  7.100
>   libswresample   3.  7.100 /  3.  7.100
>   libpostproc    55.  7.100 / 55.  7.100
> Input #0, avi, from './1.pre-processed.data/bemovi/20210208_00097.avi':
>   Metadata:
>     encoder         : Lavf58.45.100
>   Duration: 00:00:12.50, start: 0.000000, bitrate: 91831 kb/s
>     Stream #0:0: Video: png (PNG  / 0x20474E50), pal8(pc), 2048x2048,
> 92565 kb/s, 10 fps, 10 tbr, 10 tbn, 10 tbc
>     Metadata:
>       title           : FileAVI write  
> ```
> 
> In addition, I have 125 images (jpg, but I can as easily create them as
> png) which contain some labelling of the individual frames. The particles
> are moving, the images are different.
> 
> Now I want to overlay the images over the corresponding frames.
> 
> What is the easiest to do this? I could convert them to a move, then
> overlay these two, but I have the feeling I could do this in one step?
> 
> Any suggestions?
> 
> Thanks,
> 
> Rainer


Overlay them where? What x,y position? What is the dimension of your jpg
sequence?

jpg does not specify an alpha channel (transparency information). If you
overlay the jpg sequence over the base video layer , and assuming they are
the same dimensions, you will "cover up" the video layer entirely . You will
not see the video, only the jpg sequence

When you say you can "create them as PNG", does the original source have an
alpha channel?






--
Sent from: http://ffmpeg-users.933282.n4.nabble.com/


More information about the ffmpeg-user mailing list