我尝试使用 ffmpeg 从 2 个 jpeg(6912x3456 像素,文件很大,是 360 全景图)制作视频
ffmpeg -r 1/4 -pattern_type glob -i "my_dir/*.jpg" -c:v libx264 -profile:v high -crf 18 -vf "fps=30,format=yuv420p" -movflags +faststart output.mp4
并得到很长时间(我最多等了 30 分钟)这个输出
ffmpeg version N-55618-ga0acc44106-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 63.100 / 56. 63.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.101 / 58. 65.101
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 95.100 / 7. 95.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, image2, from 'my_dir/*.jpg':
Duration: 00:00:00.08, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg (Progressive), yuvj444p(pc, bt470bg/unknown/unknown), 7680x3840, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x6c1dbc0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x67c3000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x67c3000] profile High, level 6.0, 4:2:0, 8-bit
[libx264 @ 0x67c3000] 264 - core 161 r3033 0d754ec - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: 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=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=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'my_dir/output.mp4':
Metadata:
encoder : Lavf58.65.101
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt470bg/unknown/unknown, progressive), 7680x3840, q=2-31, 25 fps, 12800 tbn
Metadata:
encoder : Lavc58.115.102 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
Htop 秀 顶部
硬件:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 55
Model name: Intel(R) Celeron(R) CPU J1900 @ 1.99GHz
Stepping: 8
CPU MHz: 1332.718
CPU max MHz: 2415.7000
CPU min MHz: 1332.8000
MemTotal: 3749836 kB
SwapTotal: 4008956 kB
如果我使用较小的 jpg(FHD 或 4k 分辨率),ffmpeg 可以正常工作。PC 真的没有足够的内存来完成这项工作吗?视频只有 8 秒。有没有办法在这台 PC 上完成这项工作?对 PC 有什么要求?