Discussion:
[FFmpeg-user] Optimization
Marcus Lim
2018-11-01 02:31:49 UTC
Permalink
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images, with an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to 1.4Gb of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
example of my command is below:

ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf9204204500598689609.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf1241593939921003895.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6231405065182432206.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf4783563520441940155.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf823726872837129805.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf4148893068919936811.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6815991692415841819.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf553287365250808111.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6763129487770212040.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf4160943340255327277.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8834606975865492644.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf9160476045329137307.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8917976550433767102.tmp \
-stream_loop -1 -t 60 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6379741644027890621.tmp \
-filter_complex \
"[0:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];\
[1:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];\
[2:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v2];\
[3:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v3];\
[4:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v4];\
[5:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v5];\
[6:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v6];\
[7:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v7];\
[8:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v8];\
[9:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v9];\
[10:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v10];\
[11:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v11];\
[12:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v12];\
[13:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v13];\
[14:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v14];\
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14]concat=n=15:v=1:a=0,format=yuv420p[v]"
-map "[v]" -map 15:a test/fcd2b1a9-f3c8-4cdc-8355-51c08b088ee3.mp4

Each loop is on a 4Mb Jpeg, and the stream_loop was the only way I could
figure out to get the audio track to loop in the background, which is about
4Mb as well.

I'm kinda stumped as to why this would be with my limited understanding of
ffmpeg, I have some theories surrounding the -loop filling memory with
copies of the img in a lossless format but any help would be most welcome.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with
Paul B Mahol
2018-11-01 15:15:14 UTC
Permalink
Hi,
Post by Marcus Lim
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images, with an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to 1.4Gb of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf9204204500598689609.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf1241593939921003895.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6231405065182432206.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf4783563520441940155.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf823726872837129805.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf4148893068919936811.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6815991692415841819.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf553287365250808111.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6763129487770212040.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf4160943340255327277.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8834606975865492644.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf9160476045329137307.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8917976550433767102.tmp \
-stream_loop -1 -t 60 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf6379741644027890621.tmp \
-filter_complex \
"[0:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];\
[1:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];\
[2:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v2];\
[3:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v3];\
[4:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v4];\
[5:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v5];\
[6:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v6];\
[7:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v7];\
[8:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v8];\
[9:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v9];\
[10:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v10];\
[11:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v11];\
[12:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v12];\
[13:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v13];\
[14:v]scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2,setsar=1[v14];\
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11][v12][v13][v14]concat=n=15:v=1:a=0,format=yuv420p[v]"
-map "[v]" -map 15:a test/fcd2b1a9-f3c8-4cdc-8355-51c08b088ee3.mp4
Each loop is on a 4Mb Jpeg, and the stream_loop was the only way I could
figure out to get the audio track to loop in the background, which is about
4Mb as well.
I'm kinda stumped as to why this would be with my limited understanding of
ffmpeg, I have some theories surrounding the -loop filling memory with
copies of the img in a lossless format but any help would be most welcome.
Full uncut ffmpeg ouput missing.

I bet you are using too old version, which have bug regarding using
too much memory.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ff
Carl Eugen Hoyos
2018-11-01 16:46:57 UTC
Permalink
Post by Marcus Lim
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images, with an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to 1.4Gb of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
I suggest you put the files names in a text file and use the concat demuxer.

An alternative is to rename the files as tmp-01 to tmp-15 and use:
ffmpeg -i tmp-02%d

Both solutions will not have the increased memory usage and will
significantly simplify your command line.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-r
Paul B Mahol
2018-11-01 20:36:15 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Marcus Lim
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images, with an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to 1.4Gb of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
I suggest you put the files names in a text file and use the concat demuxer.
ffmpeg -i tmp-02%d
Both solutions will not have the increased memory usage and will
significantly simplify your command line.
How it is supposed to loop for 4 seconds with above solutions?
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subj
Carl Eugen Hoyos
2018-11-01 20:52:36 UTC
Permalink
Post by Paul B Mahol
Post by Carl Eugen Hoyos
Post by Marcus Lim
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images, with an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to 1.4Gb of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
I suggest you put the files names in a text file and use the concat demuxer.
ffmpeg -i tmp-02%d
Both solutions will not have the increased memory usage and
will significantly simplify your command line.
How it is supposed to loop for 4 seconds with above solutions?
The concat demuxer supports the duration command, the img2
demuxer an input frame rate.
Do you believe one of them will not work?

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffm
Paul B Mahol
2018-11-01 20:57:28 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Paul B Mahol
Post by Carl Eugen Hoyos
Post by Marcus Lim
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images, with an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to 1.4Gb of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
I suggest you put the files names in a text file and use the concat demuxer.
ffmpeg -i tmp-02%d
Both solutions will not have the increased memory usage and
will significantly simplify your command line.
How it is supposed to loop for 4 seconds with above solutions?
The concat demuxer supports the duration command, the img2
demuxer an input frame rate.
Do you believe one of them will not work?
Didn't know. It should work for images too, if not report a bug.
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with subject
Marcus Lim
2018-11-01 23:05:43 UTC
Permalink
Thanks for all the suggestions,
So after some reading, the img2 demuxer won't work since the images I have
are all of different sizes, and according to the documentation it says that
they need to be of the same size (still tried it, but the images became cut
off) as well I couldn't figure out how to get the timings done right.
The concat demuxer actually had the same issue as the img2 demuxer.

For reference to the output from ffmpeg:

ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared
--enable-pthreads --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl
--enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl
--enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
of 25, misdetection possible!
rate; consider increasing probesize
Input #0, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
4032x3024 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #1, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #2, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #2:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #3, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #3:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #4, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #4:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
4032x3024 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #5, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #5:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
4032x3024 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #6, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #6:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3264x2448 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #7, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #7:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #8, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #8:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #9, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #9:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3264x2448 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #10, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #10:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
4032x3024 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #11, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #11:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
4032x3024 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #12, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #12:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #13, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #13:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3264x2448 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
of 25, misdetection possible!
rate; consider increasing probesize
Input #14, jpeg_pipe, from
Duration: N/A, bitrate: N/A
Stream #14:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
inaccurate
Input #15, mp3, from
title : Indo Rock2
artist : DL Sounds
album : Royalty Free Music
date : 2014
comment : (C) dl-sounds.com
genre : Other
Duration: 00:00:34.81, start: 0.000000, bitrate: 255 kb/s
Stream #15:0: Audio: mp3, 44100 Hz, stereo, fltp, 256 kb/s
File 'fcd2b1a9-f3c8-4cdc-8355-51c08b088ee3.mp4' already exists. Overwrite
? [y/N] y
Stream #0:0 (mjpeg) -> scale (graph 0)
Stream #1:0 (mjpeg) -> scale (graph 0)
Stream #2:0 (mjpeg) -> scale (graph 0)
Stream #3:0 (mjpeg) -> scale (graph 0)
Stream #4:0 (mjpeg) -> scale (graph 0)
Stream #5:0 (mjpeg) -> scale (graph 0)
Stream #6:0 (mjpeg) -> scale (graph 0)
Stream #7:0 (mjpeg) -> scale (graph 0)
Stream #8:0 (mjpeg) -> scale (graph 0)
Stream #9:0 (mjpeg) -> scale (graph 0)
Stream #10:0 (mjpeg) -> scale (graph 0)
Stream #11:0 (mjpeg) -> scale (graph 0)
Stream #12:0 (mjpeg) -> scale (graph 0)
Stream #13:0 (mjpeg) -> scale (graph 0)
Stream #14:0 (mjpeg) -> scale (graph 0)
format (graph 0) -> Stream #0:0 (libx264)
Stream #15:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
did set range correctly
a speed loss
SSE4.2 AVX
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
encoder : Lavf58.12.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661),
yuv420p(progressive), 1080x1080 [SAR 1:1 DAR 1:1], q=-1--1, 25 fps, 12800
tbn, 25 tbc (default)
encoder : Lavc58.18.100 libx264
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo,
fltp, 128 kb/s
encoder : Lavc58.18.100 aac
frame= 1500 fps= 12 q=-1.0 Lsize= 3148kB time=00:01:00.00 bitrate=
429.8kbits/s speed=0.466x
video:2148kB audio:949kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.628573%
0.1% 0.1% 0.0% 0.0% skip:98.7%
0.0% 0.0% direct: 0.0% skip:99.9% L0:17.4% L1:82.6% BI: 0.0%
inter: 0.1% 0.2% 0.0%
7% 6% 10% 7% 14%
8% 7% 12% 6% 11%
Now I should probably share a requirement that I realize I hadn't included
before, that being that the reason I am using a complex filter, is because
I sometimes incorporate simple fade transitions between the images using
the fade filter.

I should note as well, when I tried to use all the files in, so ffmpeg -i
file.txt, it meant the complex filter couldn't find reference to the
individual streams.

I did find https://trac.ffmpeg.org/wiki/Slideshow and followed it's example
using the concat demuxer, much to my horror it resulted in using approx 3.2
gig which I think we can all agree was simply stupid levels.

Below is the command and output, though I should note I cancelled it since
the 3.2 gig is a touch above the budget I would allow to run on my server
for a single process:

ffmpeg -f concat -i file.txt -stream_loop -1 -t 60 -i
ed141148-9b79-494b-a26d-f5c84535eeaf6379741644027890621.tmp
fcd2b1a9-f3c8-4cdc-8355-51c08b088ee3.mp4
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared
--enable-pthreads --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl
--enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl
--enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
of 25, misdetection possible!
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
inaccurate
Input #1, mp3, from
title : Indo Rock2
artist : DL Sounds
album : Royalty Free Music
date : 2014
comment : (C) dl-sounds.com
genre : Other
Duration: 00:00:34.81, start: 0.000000, bitrate: 255 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 256 kb/s
File 'fcd2b1a9-f3c8-4cdc-8355-51c08b088ee3.mp4' already exists. Overwrite
? [y/N] y
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
SSE4.2 AVX
of 25, misdetection possible!
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
encoder : Lavf58.12.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc,
progressive), 3024x4032 [SAR 1:1 DAR 3:4], q=-1--1, 25 fps, 12800 tbn, 25
tbc
encoder : Lavc58.18.100 libx264
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo,
fltp, 128 kb/s
encoder : Lavc58.18.100 aac
of 25, misdetection possible!
did set range correctly
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!
of 25, misdetection possible!163x
^C^C^CReceived > 3 system signals, hard exiting
Right now I'm running into a bit of a brick wall. I noticed an earlier post
mentioning the use of a loop filter which would mean i wouldn't have to use
-loop which I assume is where my overhead is coming from, but I have yet to
be able to get an example to work.

Any thoughts feedbacks, and examples of things I could do would be ever so
helpful
Post by Carl Eugen Hoyos
Post by Paul B Mahol
Post by Carl Eugen Hoyos
Post by Marcus Lim
Hey all,
New to the list and trying to get my head around ffmpeg a bit still.
So I am using ffmpeg to create slideshows out of individual images,
with
Post by Carl Eugen Hoyos
Post by Paul B Mahol
Post by Carl Eugen Hoyos
Post by Marcus Lim
an
audio backing track (usually mp3), and then encoding as MP4 (video is h264
and audio is acc), but for some reason the process is taking up to
1.4Gb
Post by Carl Eugen Hoyos
Post by Paul B Mahol
Post by Carl Eugen Hoyos
Post by Marcus Lim
of
memory which is blowing me away.
Now I am using a complex filter to achieve this, with multiple inputs, and
ffmpeg \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf8912937006552540487.tmp \
-loop 1 -t 4 -i
test/ed141148-9b79-494b-a26d-f5c84535eeaf5351513282402727883.tmp \
I suggest you put the files names in a text file and use the concat demuxer.
ffmpeg -i tmp-02%d
Both solutions will not have the increased memory usage and
will significantly simplify your command line.
How it is supposed to loop for 4 seconds with above solutions?
The concat demuxer supports the duration command, the img2
demuxer an input frame rate.
Do you believe one of them will not work?
Didn't know. It should work for images too, if not report a bug.
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-reque
Carl Eugen Hoyos
2018-11-02 00:05:51 UTC
Permalink
Post by Marcus Lim
Thanks for all the suggestions,
So after some reading, the img2 demuxer won't work since the images I have
are all of different sizes, and according to the documentation it says that
they need to be of the same size (still tried it, but the images became cut
off)
This doesn't seem correct to me, please point me to this part
of the documentation.
I just tried different sizes and it works fine.
Post by Marcus Lim
as well I couldn't figure out how to get the timings done right.
$ ffmpeg -r 1/4 -i img%2d.jpg
Post by Marcus Lim
The concat demuxer actually had the same issue as the img2 demuxer.
I wanted to suggest using the img2 demuxer instead, but since you
only tested old FFmpeg, it may work with a current version.
Post by Marcus Lim
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
Only current FFmpeg git head is supported here.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-us
Marcus Lim
2018-11-02 02:47:43 UTC
Permalink
Sorry for the confusion, I just double checked, and I miss read "video size
is guessed from the first image file in the sequence." as it effectively
see's as only one size.

The issue though still stands, and I did a fresh clone from git, and built
from source as per https://trac.ffmpeg.org/wiki/CompilationGuide/macOS.
./../FFmpeg/ffmpeg -r 1/4 -i IMG_%3d.jpg out.mp4
ffmpeg version N-92328-gf4dd2db913 Copyright (c) 2000-2018 the FFmpeg
developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
configuration: --enable-gpl --enable-nonfree --enable-libass
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
--enable-libx265 --enable-libopus --enable-libxvid --samples=fate-suite
libavutil 56. 23.100 / 56. 23.100
libavcodec 58. 36.100 / 58. 36.100
libavformat 58. 21.100 / 58. 21.100
libavdevice 58. 6.100 / 58. 6.100
libavfilter 7. 41.100 / 7. 41.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Duration: 00:00:00.12, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown),
3024x4032 [SAR 1:1 DAR 3:4], 25 tbr, 25 tbn, 25 tbc
File 'out.mp4' already exists. Overwrite ? [y/N] y
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
SSE4.2 AVX
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
encoder : Lavf58.21.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc),
3024x4032 [SAR 1:1 DAR 3:4], q=-1--1, 0.25 fps, 16384 tbn, 0.25 tbc
encoder : Lavc58.36.100 libx264
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
did set range correctly
frame= 3 fps=1.3 q=-1.0 Lsize= 5248kB time=00:00:00.00
bitrate=704743868.9kbits/s speed=2.56e-05x
video:5247kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.016509%
2.5% 0.9% 0.0% 0.0% skip: 0.1%
inter: 91.2% 86.4% 14.0%
7% 8% 8% 8% 10%
11% 12% 8% 10% 8%
And I've noticed using the image demuxer is distorting the image to the
first images dimensions which is different to what the original script does
Post by Marcus Lim
Thanks for all the suggestions,
So after some reading, the img2 demuxer won't work since the images I
have
Post by Marcus Lim
are all of different sizes, and according to the documentation it says
that
Post by Marcus Lim
they need to be of the same size (still tried it, but the images became
cut
Post by Marcus Lim
off)
This doesn't seem correct to me, please point me to this part
of the documentation.
I just tried different sizes and it works fine.
Post by Marcus Lim
as well I couldn't figure out how to get the timings done right.
$ ffmpeg -r 1/4 -i img%2d.jpg
Post by Marcus Lim
The concat demuxer actually had the same issue as the img2 demuxer.
I wanted to suggest using the img2 demuxer instead, but since you
only tested old FFmpeg, it may work with a current version.
Post by Marcus Lim
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
Only current FFmpeg git head is supported here.
Carl Eugen
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ff
Carl Eugen Hoyos
2018-11-02 08:47:24 UTC
Permalink
Post by Marcus Lim
The issue though still stands, and I did a fresh clone from git, and built
from source as per https://trac.ffmpeg.org/wiki/CompilationGuide/macOS.
Which issue?
Post by Marcus Lim
./../FFmpeg/ffmpeg -r 1/4 -i IMG_%3d.jpg out.mp4
You want to set an output frame rate and a resolution (and possibly
other filters which is why I only gave an example for reading the
input files):
ffmpeg -r 1/4 -i IMG_%3d.jpg -s 2000x3000 -r 25 out.mp4

Please avoid top-posting here, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffm

Continue reading on narkive:
Loading...