[FFmpeg-user] Question about rendering and photo dimensions.

Paul B Mahol onemda at gmail.com
Fri Nov 2 18:56:03 EET 2018


On 11/2/18, Hwaen Ch'uqi <hwaenchuqi at gmail.com> wrote:
> Greetings,
>
> I haven't yet figured out how to capture terminal output that doesn't
> include control characters or other garbabe, and the standard redirect
> commands (such as > or >> ) result in an empty file. So, I ran this
> last test in an emacs shell, again interrupting the job about 70
> minutes later when the resulting mp4 file was 139MB and climbing.
> Unlike the terminal output, the emacs shell output is extremely
> minimal, perhaps too minimal? Here it is in its entirety.
>
> $ ffmpeg -i 05.jpg -i 05.mp3 -vf loop=-1:1:0 05.mp4
> ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
>   built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
>   configuration: --enable-gpl --enable-libass --enable-libfdk-aac
> --enable-libfreetype --enable-libmp3lame --enable-libopus
> --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
> --enable-libx265 --enable-nonfree
>   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
>   libswscale      5.  1.100 /  5.  1.100
>   libswresample   3.  1.100 /  3.  1.100
>   libpostproc    55.  1.100 / 55.  1.100
> Input #0, image2, from '05.jpg':
>   Duration: 00:00:00.04, start: 0.000000, bitrate: 373558 kb/s
>     Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown),
> 5480x3652, 25 tbr, 25 tbn, 25 tbc
> [mp3 @ 0x558bf27c4040] Estimating duration from bitrate, this may be
> inaccurate
> Input #1, mp3, from '05.mp3':
>   Metadata:
>     artist          : Unknown Artist
>     album           : Unknown Album
>     title           : Track 5
>     track           : 05/07
>     TDTG            : 2013-09-28T12:38:42
>   Duration: 00:07:44.80, start: 0.000000, bitrate: 128 kb/s
>     Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
> Stream mapping:
>   Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
>   Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
> Press [q] to stop, [?] for help
> [libx264 @ 0x558bf27be780] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2 AVX
> [libx264 @ 0x558bf27be780] profile High 4:4:4 Predictive, level 6.0, 4:4:4
> 8-bit
> [libx264 @ 0x558bf27be780] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4
> AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html -
> options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7
> psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
> 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4
> threads=6 lookahead_threads=1 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
> Output #0, mp4, to '05.mp4':
>   Metadata:
>     encoder         : Lavf58.12.100
>     Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661),
> yuvj444p(pc, progressive), 5480x3652, q=-1--1, 25 fps, 12800 tbn, 25
> tbc
>     Metadata:
>       encoder         : Lavc58.18.100 libx264
>     Side data:
>       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
>     Metadata:
>       encoder         : Lavc58.18.100 aac
> frame=10971 fps=2.6 q=28.0 size=  136448kB time=00:07:16.74
> bitrate=2559.4kbits/s speed=0.103x      C-c C-c
> frame=11003 fps=2.6 q=28.0 size=  136704kB time=00:07:18.02
> bitrate=2556.7kbits/s speed=0.103x
>
> As you can see, the dimensions of the photo are 5480x3652, and my
> initial observation was that rendering speed decreases dramatically -
> to the point of hanging/crashing my computer - with photos exceeding
> certain dimensions. Carl kindly trimmed own my code of excessive
> commands, and Paul suggested using the loop video filter in order to
> save memory. I have been struglling to understand and implement this
> filter, and the code/output above documents my latest effort.
>
> Thank you all for your patience and investment.

I dunno what is actually your issue. You must use -shortest so that ffmpeg
does actually stop encoding when end of audio is reached.

It is not kind of you to ignore my questions, your machine is too weak to do
this. You need more RAM. Size of encoding when not using extra
encoding parameters will be bigger than audio + video size.

Also, only latest FFmpeg master is supported here, 4.0.2 is not supported.


More information about the ffmpeg-user mailing list