[FFmpeg-user] Creating video from a lot of jpeg pictures

Balogh László laci at blacc.hu
Mon Apr 11 13:08:35 EEST 2022


Hi,

Thanks for the link! The following command seems to be do the job i wanted.

cat 000_Images/2022/04/2022-04-10/*.jpeg | ffmpeg -f image2pipe -i - 
output.mkv

Regards, Laszlo

2022. 04. 11. 11:42 keltezéssel, Paul B Mahol írta:
> On Mon, Apr 11, 2022 at 11:35 AM Balogh László <laci at blacc.hu> wrote:
>
>> Thank,
>>
>> I have a backup of the framsets, so no panic. :)
>>
>> But then why is asking to overwrite? Why does the ffmpeg try to
>> overwrite? Here the command without "-y":
>>
> will need to use -f image2 demuxer
>
> Consult https://trac.ffmpeg.org/wiki/Slideshow for more info.
>
>
>> mcll at mcllserver-i3:/home/VVCam$ ffmpeg -framerate 25 -i
>> 000_Images/2022/04/2022-04-10/*.jpeg -c:v libx264 -profile:v high -crf
>> 20 -pix_fmt yuv420p output.mp4
>> ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg
>> developers
>>     built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
>>     configuration: --prefix=/usr --extra-version=0ubuntu0.2
>> --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
>> --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping
>> --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
>> --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
>> --enable-libcdio --enable-libflite --enable-libfontconfig
>> --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
>> --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg
>> --enable-libopenmpt --enable-libopus --enable-libpulse
>> --enable-librubberband --enable-librsvg --enable-libshine
>> --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
>> --enable-libtheora --enable-libtwolame --enable-libvorbis
>> --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
>> --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
>> --enable-omx --enable-openal --enable-opengl --enable-sdl2
>> --enable-libdc1394 --enable-libdrm --enable-libiec61883
>> --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264
>> --enable-shared
>>     libavutil      55. 78.100 / 55. 78.100
>>     libavcodec     57.107.100 / 57.107.100
>>     libavformat    57. 83.100 / 57. 83.100
>>     libavdevice    57. 10.100 / 57. 10.100
>>     libavfilter     6.107.100 /  6.107.100
>>     libavresample   3.  7.  0 /  3.  7.  0
>>     libswscale      4.  8.100 /  4.  8.100
>>     libswresample   2.  9.100 /  2.  9.100
>>     libpostproc    54.  7.100 / 54.  7.100
>> Input #0, image2, from
>> '000_Images/2022/04/2022-04-10/2022-04-10_00_00_01.jpeg':
>>     Duration: 00:00:00.04, start: 0.000000, bitrate: 66148 kb/s
>>       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
>> 2688x1520 [SAR 1:1 DAR 168:95], 25 tbr, 25 tbn, 25 tbc
>> File '000_Images/2022/04/2022-04-10/2022-04-10_00_00_21.jpeg' already
>> exists. Overwrite ? [y/N]
>>
>> Regards, Laszlo
>>
>>
>> 2022. 04. 11. 11:26 keltezéssel, Paul B Mahol írta:
>>> On Mon, Apr 11, 2022 at 11:22 AM Paul B Mahol <onemda at gmail.com> wrote:
>>>
>>>> On Mon, Apr 11, 2022 at 10:58 AM Balogh László <laci at blacc.hu> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have about 4300 pictures in a folder
>> (000_Images/2022/04/2022-04-10/).
>>>>> I want to create a video from them, every picture should be one frame
>> in
>>>>> the video.
>>>>>
>>>>> I'm using the following command: ffmpeg -framerate 25 -i
>>>>> 000_Images/2022/04/2022-04-10/*.jpeg -c:v libx264 -profile:v high -crf
>>>>> 20 -pix_fmt yuv420p -y output.mp4
>>>>>
>>>>> Its starting, but after about 500 pictures ffmpeg is slowing down,
>> while
>>>>> the system load goes quickly up. It was hard to cancel the command, as
>>>>> the load was above 80. :)
>>>>>
>>>>> Here some log of the command:
>>>>>
>>>>> mcll at mcllserver-i3:/home/VVCam$ ffmpeg -framerate 25 -i
>>>>> 000_Images/2022/04/2022-04-10/*.jpeg -c:v libx264 -profile:v high -crf
>>>>> 20 -pix_fmt yuv420p -y output.mp4
>>>>      built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
>>>>>      configuration: --prefix=/usr --extra-version=0ubuntu0.2
>>>>> --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
>>>>> --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping
>>>>> --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
>>>>> --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
>>>>> --enable-libcdio --enable-libflite --enable-libfontconfig
>>>>> --enable-libfreetype --enable-libfribidi --enable-libgme
>> --enable-libgsm
>>>>> --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg
>>>>> --enable-libopenmpt --enable-libopus --enable-libpulse
>>>>> --enable-librubberband --enable-librsvg --enable-libshine
>>>>> --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
>>>>> --enable-libtheora --enable-libtwolame --enable-libvorbis
>>>>> --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
>>>>> --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
>>>>> --enable-omx --enable-openal --enable-opengl --enable-sdl2
>>>>> --enable-libdc1394 --enable-libdrm --enable-libiec61883
>>>>> --enable-chromaprint --enable-frei0r --enable-libopencv
>> --enable-libx264
>>>>> --enable-shared
>>>>>      libavutil      55. 78.100 / 55. 78.100
>>>>>      libavcodec     57.107.100 / 57.107.100
>>>>>      libavformat    57. 83.100 / 57. 83.100
>>>>>      libavdevice    57. 10.100 / 57. 10.100
>>>>>      libavfilter     6.107.100 /  6.107.100
>>>>>      libavresample   3.  7.  0 /  3.  7.  0
>>>>>      libswscale      4.  8.100 /  4.  8.100
>>>>>      libswresample   2.  9.100 /  2.  9.100
>>>>>      libpostproc    54.  7.100 / 54.  7.100
>>>>> Input #0, image2, from
>>>>> '000_Images/2022/04/2022-04-10/2022-04-10_00_00_01.jpeg':
>>>>>      Duration: 00:00:00.04, start: 0.000000, bitrate: 66148 kb/s
>>>>>        Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
>>>>> 2688x1520 [SAR 1:1 DAR 168:95], 25 tbr, 25 tbn, 25 tbc
>>>>> Stream mapping:
>>>>>      Stream #0:0 -> #0:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #1:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #2:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #3:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #4:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #5:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #6:0 (mjpeg (native) -> mjpeg (native))
>>>>> ...cut...
>>>>>      Stream #0:0 -> #4316:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #4317:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #4318:0 (mjpeg (native) -> mjpeg (native))
>>>>>      Stream #0:0 -> #4319:0 (mjpeg (native) -> h264 (libx264))
>>>>> Press [q] to stop, [?] for help
>>>>> Output #0, image2, to
>>>>> '000_Images/2022/04/2022-04-10/2022-04-10_00_00_21.jpeg':
>>>>>      Metadata:
>>>>>        encoder         : Lavf57.83.100
>>>>>        Stream #0:0: Video: mjpeg, yuvj420p(pc), 2688x1520 [SAR 1:1 DAR
>>>>> 168:95], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
>>>>>        Metadata:
>>>>>          encoder         : Lavc57.107.100 mjpeg
>>>>>        Side data:
>>>>>          cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay:
>> -1
>>>>> Output #1, image2, to
>>>>> '000_Images/2022/04/2022-04-10/2022-04-10_00_00_41.jpeg':
>>>>>      Metadata:
>>>>>        encoder         : Lavf57.83.100
>>>>>        Stream #1:0: Video: mjpeg, yuvj420p(pc), 2688x1520 [SAR 1:1 DAR
>>>>> 168:95], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
>>>>>        Metadata:
>>>>>          encoder         : Lavc57.107.100 mjpeg
>>>>>        Side data:
>>>>>          cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay:
>> -1
>>>>> Output #2, image2, to
>>>>> '000_Images/2022/04/2022-04-10/2022-04-10_00_01_01.jpeg':
>>>>>      Metadata:
>>>>>        encoder         : Lavf57.83.100
>>>>>        Stream #2:0: Video: mjpeg, yuvj420p(pc), 2688x1520 [SAR 1:1 DAR
>>>>> 168:95], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
>>>>>        Metadata:
>>>>>          encoder         : Lavc57.107.100 mjpeg
>>>>>        Side data:
>>>>>          cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay:
>> -1
>>>>> ...etc...
>>>>>
>>>>> Why is this generating such a high load, and what should i do?
>>>>>
>>>> It is for some reason creating separate streams for each jpeg image.
>>>>
>>>> Is your ffmpeg modified or you use script?
>>>>
>>>> Because original ffmpeg does not do this.
>>>>
>>> Ignore that remark above, I forgot -y switch.
>>>
>>> Oops, using -y switch in your case is very dangerous.
>>>
>>>
>>> You completely ditched all jpegs and replaced them with the first one.
>>>
>>> NEVER EVER USE -y SWITCH, NEVER EVER.
>>>
>>>
>>>
>>>>> Thanks
>>>>>
>>>>> Regards, Laszlo
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> ffmpeg-user mailing list
>>>>> ffmpeg-user at ffmpeg.org
>>>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>>>
>>>>> To unsubscribe, visit link above, or email
>>>>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>>>>>
>>> _______________________________________________
>>> ffmpeg-user mailing list
>>> ffmpeg-user at ffmpeg.org
>>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>>
>>> To unsubscribe, visit link above, or email
>>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list