How to successfully use ffmpeg to convert images to videos

I am currently trying to make a 5 second video for each image and then combine them using concat, but I have a lot of problems.

Here is my code:

ffmpeg -loop 1 -i 000.jpg -t 5 000.mp4 ffmpeg -loop 1 -i 001.jpg -t 5 001.mp4 ffmpeg -f concat -i inputs.txt -codec copy output.mp4

inputs.txt lists the following file '000.mp4' file '001.mp4'

Now, when I try all this, I launch the mp4 output file, and the first part of it works fine, but then, as soon as it starts to display part 001 of the video, it switches to a gray screen. He does not even do this in the stand-alone 001.mp4 file.

Any suggestions on what's going on or what can I do to fix this?

I have tried so many other things. Like switching all files to png, which gave the same problem. I also tried using various types of output files such as wmv, avi, etc. I'm still very new, so I don’t know what else to try.

This is what appears on my command line after running the command.

C:\xampp\htdocs\images>ffmpeg -f concat -i inputs.txt -codec copy output.mp4
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 19.100 / 52. 19.100
  libavcodec     55.  0.100 / 55.  0.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    54.  4.100 / 54.  4.100
  libavfilter     3. 45.103 /  3. 45.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[concat @ 003b9660] Estimating duration from bitrate, this may be inaccurate
Input #0, concat, from 'inputs.txt':
  Duration: 00:00:00.01, start: 0.000000, bitrate: 28 kb/s
    Stream #0:0: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444
p, 800x600 [SAR 1:1 DAR 4:3], 28 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf55.0.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 800x600 [SAR 1:1
 DAR 4:3], q=2-31, 28 kb/s, 25 fps, 12800 tbn, 12800 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  250 fps=0.0 q=-1.0 Lsize=      31kB time=00:00:09.88 bitrate=  26.1kbits
/s
video:28kB audio:0kB subtitle:0 global headers:0kB muxing overhead 13.534948%

C:\xampp\htdocs\images>
+3
source share
1 answer

, 4: 4: 4 H.264, . ( FFmpeg .) -pix_fmt yuv420p 4: 2: 0 . -profile:v baseline, . ( , , -codec copy.) ffplay, , 4: 4: 4 H.264 mp4.

​​ , , :

ffmpeg -framerate 0.2 -i %3d.jpg -vf fps=10 -pix_fmt yuv420p output.mp4

-framerate 0.2 0.2 (1 5 ). %3d 3 000, 001 .. . -vf fps=10 10 , ; , , , , , , .

concat , inputs.txt. . :

file 000.jpg
duration 5
file 001.jpg
duration 5
...

concat demuxer, :

ffmpeg -f concat -i inputs.txt -vf fps=10 -pix_fmt yuv420p output.mp4

- , FFmpeg .

+7

All Articles