AMD EPYC 7401P 24코어/48스레드 CPU, 128GB DDR4 RAM, Intel P4800x PCIe NVMe를 갖춘 고급형 HPE ProLiant DL325 G10 서버를 보유하고 있습니다. 온라인 스트리밍을 위해 비디오(MKV)를 MP4로 변환하기 위해 ffmpeg를 실행하려고 시도했지만 24개 코어를 모두 활용하지 않습니다. 인코딩 과정에서 CPU의 약 10%를 사용합니다 top
. 상단 출력의 예는 다음과 같습니다.
나는 stackexchange 사이트에서 비슷한 질문을 읽었지만 모두 답이 없으며 6-8년 된 질문입니다. 옵션 0, 24, 48 및 기타 다양한 -threads
매개변수를 전후에 추가하려고 시도했지만 -i
이 입력을 무시하는 것 같습니다. 동영상 크기도 조정하지 않습니다.
H.264로도 인코딩하고 있습니다. 다음은 내가 사용한 몇 가지 명령입니다. 내가 뭘 잘못하고 있는지, 병목 현상이 정확히 무엇인지 알 수 없습니다.
이 문제를 어떻게 해결할 수 있는지 제안해 주시겠습니까?
사용된 명령:
ffmpeg -threads 24 -i input.mkv -c:v libx264 -preset medium -c:a copy -vf subtitles=input.mkv output.mp4
나는 또한 -sws_flags fast_bilinear
&를 사용하여 진실을 밝혔 -x264-params sliced-threads=1
지만 둘 다 많이 변하지 않습니다. 일부 코어에서는 약간 증가된 CPU 사용량을 사용했지만 -tune zerolatency
전체 CPU 사용량은 15% 미만이었습니다.
최고 출력:
top - 16:14:13 up 57 min, 2 users, load average: 2.65, 0.59, 0.50
Tasks: 509 total, 1 running, 280 sleeping, 1 stopped, 0 zombie
%Cpu0 : 5.7 us, 0.7 sy, 12.2 ni, 80.4 id, 0.0 wa, 0.0 hi, 1.0 si, 0.0 st
%Cpu1 : 2.6 us, 0.3 sy, 4.6 ni, 92.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu2 : 6.2 us, 0.3 sy, 6.9 ni, 86.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 4.0 us, 0.0 sy, 1.7 ni, 94.3 id, 0.0 wa, 0.0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 si, 0.0 st
%Cpu34 : 5.4 us, 0.0 sy, 2.7 ni, 91.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu35 : 6.6 us, 0.0 sy, 4.6 ni, 88.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu36 : 4.3 us, 0.0 sy, 17.1 ni, 78.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu37 : 5.6 us, 0.3 sy, 3.3 ni, 90.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu38 : 2.3 us, 0.0 sy, 8.6 ni, 89.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu39 : 2.3 us, 0.0 sy, 22.0 ni, 75.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu40 : 1.7 us, 0.0 sy, 17.4 ni, 80.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu41 : 6.0 us, 0.3 sy, 3.3 ni, 90.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu42 : 4.7 us, 0.3 sy, 15.7 ni, 79.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu43 : 7.9 us, 0.7 sy, 24.2 ni, 67.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu44 : 7.0 us, 0.3 sy, 28.3 ni, 64.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu45 : 29.1 us, 1.0 sy, 13.9 ni, 56.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu46 : 0.0 us, 0.0 sy, 45.3 ni, 54.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu47 : 0.0 us, 0.0 sy, 48.5 ni, 51.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
ffmpeg 정보:
ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --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
우분투 버전:
Linux ubuntu 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
마지막으로 인코딩 프로세스 중 출력의 일부는 다음과 같습니다.
frame=34048 fps=316 q=-1.0 Lsize= 119840kB time=00:23:40.03 bitrate= 691.3kbits/s dup=2 drop=0 speed=13.2x