I am trying to create a video, with a bunch of different inputs consisting of set of sequence of images, along with few other images and a video (might be more than one) to overlay on top of those.
The duration of the final video output is supposed to be equal to the duration of the longest input (while shorter inputs will just loop till that duration).
While the command is working for most cases. In some cases I see the warning EOF timestamp not reliable, and afterthat FFmpeg gets stuck indefinately.This happens with some particular cases of inputs, and also seem to vary with different versions of ffmpeg, i tried with ffmpeg versions 4.1, 4.0.4 and 3.4.1. It seems to be only working with 4.0.4, while it fails on other versions.
I am sharing an example command along with assets for windows, for which I am encountering this problem
Below is the Command:
ffmpeg -i assets\w_re_p_3\w_re_p_3_%d.jpg -loop 1 -i assets\text_0.png -loop 1 -i assets\text_1.png -loop 1 -i assets\text_2.png -loop 1 -i assets\text_3.png -loop 1 -i assets\text_4.png -loop 1 -i assets\text_5.png -loop 1 -i assets\text_6.png -loop 1 -i assets\text_7.png -lavfi "[0:v]loop=loop=-1:size=121:start=1[lip0];[1:v]scale=w=693:h=155[si_1];[lip0][si_1]overlay=x=13:y=13:shortest=1[over_0];[2:v]scale=w=693:h=45[si_2];[over_0][si_2]overlay=x=13:y=871:shortest=1[over_1];[3:v]scale=w=693:h=155[si_3];[over_1][si_3]overlay=x=13:y=236:shortest=1[over_2];[4:v]scale=w=693:h=40[si_4];[over_2][si_4]overlay=x=13:y=1089:shortest=1[over_3];[5:v]scale=w=693:h=84[si_5];[over_3][si_5]overlay=x=13:y=1141:shortest=1[over_4];[6:v]scale=w=693:h=31[si_6];[over_4][si_6]overlay=x=13:y=1207:shortest=1[over_5];[7:v]scale=w=693:h=85[si_7];[over_5][si_7]overlay=x=13:y=982:shortest=1[over_6];[8:v]scale=w=693:h=52[si_8];[over_6][si_8]overlay=x=13:y=148:shortest=1[over_7];movie=filename=assets\\\\cmedia_cropped.mp4:loop=1,setpts=N/(FRAME_RATE*TB)[mov_0];[mov_0]scale=w=720:h=487[sm_0];[over_7][sm_0]overlay=x=0:y=357:shortest=1" card_output.mp4
Below is the link of all the assets being used in the command:
https://www.dropbox.com/sh/6bwo4fg5de3fjwz/AAA471jUtLZGtti3hakT1bgfa?dl=0
The final output should look something like this:
https://www.dropbox.com/s/s92t6qij2lrl2j7/card_output1.mp4?dl=0
Please, I dont understand the reason behind it. Is there anyway that I can improve my command so that I dont have to face this problem. Any help would be appreciated.
It seems like the problem lies in this part of the command [0:v]loop=loop=-1:size=121:start=1[lip0].
For some unknown reason, FFmpeg is not looping indefinitely over my input set of images, instead, it is looping only one single time. If I set loop=(any +ve number) instead then it's working fine.
FFmpeg got stuck because the duration of the set of images (at 25 fps) was less than the duration of the video in movie filter (movie=filename=assets\\cmedia_cropped.mp4:loop=1,setpts=N/(FRAME_RATE*TB)[mov_0]), and it seems like a bug in FFmpeg itself as in documentation it is clearly written that -1 will result in infinite loops but this is not happening in this case.