Best CPU for teanscode
Added by Jack Jordan over 3 years ago
What is the best cpu for transcode from your opinion intel vs amd, intel core or xeon,please advise
Replies (13)
RE: Best CPU for teanscode - Added by saen acro over 3 years ago
AMD more cores more frequency faster memory access.
Of course NVIDIA gpu can beat them with up to 60 SD and 35 HD streams
See this page for NVENC Transcoding Cheat Sheet
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
Thank you for your response, i have quadro k420 (2GB) but unable to reach 5 stream limit described in the cheat sheet, cpu reach 100% usage and system stutters in the second transcode, my cpu is intel core 2 [email protected], my understanding is that cpu will still have role to play even if we are using nvidia gpu, please advise what could be wrong in my setup
RE: Best CPU for teanscode - Added by saen acro over 3 years ago
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
YOU ARE THE BEST!! i used spawn profile with below ffmpeg line parameters and the cpu usage down to 8% and nvidia-smi used 219Mib, thank you very much
/usr/bin/ffmpeg -loglevel debug -threads 4 -hwaccel cuvid -c:v mpeg2_cuvid -i pipe:0 -c:v h264_nvenc -b:v 2M -maxrate:v 5M -bufsize:v 8M -profile:v main -level:v 4.1 -rc:v vbr_hq -f mpegts pipe:1
i can start planning to add more tuners now, please let me know if you have any comments on provided ffmpeg line, thanks you
RE: Best CPU for teanscode - Added by saen acro over 3 years ago
Recomended for install is CUDA driver
https://developer.nvidia.com/cuda-downloads
it contain al cuda dependency for TVH native transcoding (with latest patches)
Use some "realtime aka low latency -preset LLHP or LLHQ -surfaces 8 in place of -rc VBR_HQ and set real frame rate to reduse GPU load and stream start
https://superuser.com/questions/1296374/best-settings-for-ffmpeg-with-nvenc
keep in mind when read that file transcoding and live stream transcoding is diferent things
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
Thank you for all your help, i hope this will be my last question - i followed your instructions and also used NVTOP app to monitor nvidia GPU, i noticed the Enc percentage reach 100% after third stream (attached NVTOP.png), and the picture degraded in the fourth stream (attached pic.png), is this something related to a limitation in the hardware or it can be configuration issue, my ffmpeg is below
/usr/bin/ffmpeg -loglevel debug -threads 4 -hwaccel cuvid -c:v mpeg2_cuvid -i pipe:0 -c:v h264_nvenc -b:v 2M -maxrate:v 5M -bufsize:v 8M -profile:v high -level:v 4.1 -preset llhp -surfaces 8 -f mpegts pipe:1
nvidia patch already installed
Thank you for all your help it was very useful
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
Please if you have any direction why i have pixlation starting with the 4th stream it will be appreciated, if it is matter of hardware limitation (since my hardware is pretty old) then please ket me know so i can plan for upgrade
RE: Best CPU for teanscode - Added by saen acro over 3 years ago
set framerate as fixed
adapt this example
pipe://ffmpeg \
-re \
-vsync passthrough \
-copytb 1 \
-hwaccel cuvid \
-hwaccel_device 0 \
-probesize 10000000 \
-analyzeduration 10000000 \
-fflags discardcorrupt+genpts+nobuffer \
-c:v h264_cuvid \
-gpu 0 \
-deint adaptive \
-drop_second_field 1 \
-recv_buffer_size 67108864 \
-i pipe:0 \
-filter_complex [0:i:0x203]split=outputs=1[map:v:0] \
-map [map:v:0] \
-c:v:0 h264_nvenc \
-g 150 \
-flags:v +global_header+cgop \
-preset:v llhp \
-profile:v:0 high \
-gpu 0 \
-b:v:0 2000k \
-maxrate:v:0 3500k \
-bufsize:v:0 7000k \
-map 0:i:0x206 \
-c:a:0 aac \
-ac 2 \
-ar 44100 \
-b:a:0 128k \
-max_muxing_queue_size 512 \
-f=mpegts \
-nostdin \
-hide_banner \
-loglevel info \
pipe:1
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
thank you i fixed the rate to 30 fps using (-r 30) and now i am able to execute more streams without the issue of pixilation
RE: Best CPU for teanscode - Added by saen acro over 3 years ago
Jack Jordan wrote:
thank you i fixed the rate to 30 fps using (-r 30) and now i am able to execute more streams without the issue of pixilation
If you incoming stream is 25 or 50 interlaced FPS,
is total useless to add this fake 5 more frames,
aka 20% productivity lost.
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
Frankly the channel original frame rate is 60 FPS (screenshot attached for your reference) , the original bit rate is something around 18 Mbps, i had to reduce the frame rate using encoder h264_nvec 30 FPS to be able to get more streams, i noticed one thing that decoder h264_cuvid is not working in the ffmpeg command line as i am using mpeg2_cuvid instead, but that should be fine since my high NVTOP usage percentage is in encoder and not decoder (i am trying to transcode ATSC channel stream which is using MPEG transport packet, this could be the answer why decoder h264_cuvid is not working - i already enabled cuda,cuvid and nvenc in ffmpeg).
/usr/bin/ffmpeg -loglevel debug -hwaccel cuvid -c:v mpeg2_cuvid -i pipe:0 -c:v h264_nvenc -b:v 2M -maxrate:v 5M -bufsize:v 8M -profile:v high -level:v 4.1 -preset llhp -r 30 -surfaces 8 -f mpegts pipe:1
will still need to do lot of study on your provided ffmpeg example :-) thank you so much
FrameRate.png (33.9 KB) FrameRate.png | Original Frame Rate 60 FPS | ||
FrameRate.png (33.9 KB) FrameRate.png | Original Frame Rate 60 FPS |
RE: Best CPU for teanscode - Added by saen acro over 3 years ago
More simple and informative is to use FFPROBE
ffprobe http://192.168.100.103:9981/play/ticket/stream/channel/4f949a0fd29d5dd38f2d8fffb1abe930?title=204%20%3A%20Eurosport%20HD
ffprobe version N-97547-gf441fadbcf Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --enable-libx264 --enable-libvpx --enable-gpl
libavutil 56. 43.100 / 56. 43.100
libavcodec 58. 82.100 / 58. 82.100
libavformat 58. 42.101 / 58. 42.101
libavdevice 58. 9.103 / 58. 9.103
libavfilter 7. 80.100 / 7. 80.100
libswscale 5. 6.101 / 5. 6.101
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
[mp3float @ 0x55ce5f712540] Header missing
[mpegts @ 0x55ce5f70ed80] Packet corrupt (stream = 3, dts = 3023092466).
[mp3float @ 0x55ce5f7213c0] Header missing
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[h264 @ 0x55ce5f720100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ce5f720100] decode_slice_header error
[h264 @ 0x55ce5f720100] no frame!
[mpegts @ 0x55ce5f70ed80] Could not find codec parameters for stream 4 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'http://192.168.100.103:9981/play/ticket/stream/channel/4f949a0fd29d5dd38f2d8fffb1abe930?title=204%20%3A%20Eurosport%20HD':
Duration: N/A, start: 33589.844289, bitrate: N/A
Program 1
Metadata:
service_name : Eurosport HD
service_provider: xxxxxxxxx
Stream #0:1[0x1f9]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x1fa](bul): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s
Stream #0:3[0x1fc](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 128 kb/s
Stream #0:4[0xb0]: Unknown: none ([5][0][0][0] / 0x0005)
No Program
Stream #0:0[0x12]: Data: epg
Unsupported codec with id 98306 for input stream 0
Unsupported codec with id 0 for input stream 4
stream 0:4 is HBBTV
RE: Best CPU for teanscode - Added by Jack Jordan over 3 years ago
Thank you for all your help, really appreciated, i learned a lot from you through out this post