I have a directory with .jpg
images named in UNIX timestamp format. How can I convert all images starting with the oldest timestamp to the newest in .mp4
video format?
I found a solution but it uses incremental naming, like image001
, image002
.
I would appreciate any help. Thanks.
Using aergistal's solution, i get an error in output: I did as you told me, but i get an output error:
Input #0, concat, from 'list.txt':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 540x405 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x14751c0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x14b7120] height not divisible by 2 (540x405)
Output #0, mp4, to 'out.mp4':
Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 30 fps
Metadata:
encoder : Lavc56.26.100 libx264
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Make a list of files in the order in which you want them to appear using the format:
file '<path/to/file>'
On Linux you can fetch the files using the timestamp order and create the list using:
From the
sort
man page:Example list:
Then use the FFmpeg concat demuxer with your list: