This seems to be a known issue
see: https://github.com/maRce10/dynaSpec/issues/15
which is a 1 year old issue.
Comment: removed previous observations replacing them by the following
I tested the ffmpeg using tiff files created in python (jupyter notebook) and in R (R-Studio)
Here are the two code snippets
Python:
import numpy as np
import matplotlib.pyplot as plt
xx=np.arange(100)
for ii in range(300):
plt.clf()
plt.plot(xx,np.sin(2*np.pi*(xx+ii)/100))
plt.savefig(f"movie/{ii:05}_test.tiff",)
#plt.show()
R:
x=seq(-pi,pi,0.1)
for(ii in 1:300)
{
fname <- sprintf("movie/%05d_test.tiff",ii)
tiff(fname, units="in", width=5, height=5, res=100)
y=sin(x+ii/10)
plot(x,y)
dev.off()
}
Moving to the *.tiff folder and executing
ffmpeg -framerate 50 -i ./%05d_test.tiff -y test.mp4
produces correct the mp4 file for python-generated files but fails for R-generated files
Conclusion: ffmpeg seems to work fine, but the tiff files differ.
I futher checked the content of the tiff files (using HxD) and it turned out that the header of the Python-generated files are much longer (about 206 bytes) than the header of the R-generated files (about 8 bytes). The R-generated tiff file has a trailer of about 184 bytes, while the python generated file has no trailer.
It is clear that R-generated tiff files differ from Python-generated tiff files and that the ffmpeg code has difficulties with the R-generated tiff files.
For the record: following Python Jupyter Notepad cell also works (windows 11 without cmd.exe)
import os
os.environ.update(comspec="powershell.exe")
!ffmpeg "-framerate 50 -i ./movie/%05d_test.tiff -y ./movie/test.mp4"