Answer the question
In order to leave comments, you need to log in
Why does the process freeze when overlaying an image on a video using FFMPEG?
Using FFMPEG, I'm trying to overlay an image on top of a video. Team
ffmpeg -i test_video.mp4 -loop 1 -i test_image.png -filter_complex "[0:v] setpts=PTS-STARTPTS, scale=w=1920:1080 [v0];[1:v] setpts=PTS-STARTPTS, scale=w=1920:1080 [v1];[v0][v1]overlay=shortest=1:x=0:y=0" -t 20 -c:v libx264 -pix_fmt yuv420p -an test_output.mp4
C:\Users\allys\Desktop\test>ffmpeg -i test_video.mp4 -loop 1 -i test_image.png -filter_complex "[0:v] setpts=PTS-STARTPTS, scale=w=1920:1080 [v0];[1:v] setpts=PTS-STARTPTS, scale=w=1920:1080 [v1];[v0][v1]overlay=shortest=1:x=0:y=0" -t 20 -c:v libx264 -pix_fmt yuv420p -an test_output.mp4
ffmpeg version N-86330-gbd1179e Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 63.100 / 55. 63.100
libavcodec 57. 96.101 / 57. 96.101
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 90.100 / 6. 90.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2017-07-25T13:49:31.000000Z
Duration: 00:00:20.05, start: 0.000000, bitrate: 10337 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 10030 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-07-25T13:49:31.000000Z
handler_name : Alias Data Handler
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
Metadata:
creation_time : 2017-07-25T13:49:31.000000Z
handler_name : Alias Data Handler
Input #1, png_pipe, from 'test_image.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 1920x1080 [SAR 3780:3780 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
File 'test_output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 (h264) -> setpts
Stream #1:0 (png) -> setpts
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[libx264 @ 000000000378cdc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 @ 000000000378cdc0] profile High, level 4.0
[libx264 @ 000000000378cdc0] 264 - core 150 r2833 df79067 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'test_output.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
encoder : Lavf57.72.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080, q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc57.96.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 500 fps=1.8 q=28.0 size= 2919kB time=00:00:17.88 bitrate=1337.3kbits/s speed=0.0627x
frame= 500 fps=1.8 q=28.0 size= 2919kB time=00:00:17.88 bitrate=1337.3kbits/s speed=0.0627x
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question