FFMPG Stream + libVLC - Server version 2.3.3

Hello @andyw and thanks for your precious answer on the other post.
I manage to make it work adding the pkt_size.

Here when adding the stream:

ADD 1 STREAM udp://127.0.0.1:5000?pkt_size=1316 -codec:v libx264 -tune:v zerolatency -preset:v ultrafast -crf:v 25 -vf scale=640:360 -format mpegts

While to load it on libVLC media I used:

New Media(libVLC, "udp://@127.0.0.1:5000?pkt_size=1316 :network-caching=100", FromType.FromLocation)

Now I can notice some latency (quite acceptable but…).
It seems like the args are not getting really accepted by CG.
For instance the network caching or apparently the scaling and crf, are not really making any difference.

CG log

[2024-11-29 11:26:11.344] [info]    Received message from 127.0.0.1: ADD 1 STREAM udp://127.0.0.1:5000?pkt_size=1316 -codec:v libx264 -tune:v zerolatency -preset:v ultrafast -crf:v 25 -vf scale=640:360 -format mpegts\r\n
[2024-11-29 11:26:11.344] [info]    ffmpeg[udp://127.0.0.1:5000?pkt_size=1316] Initialized.
[2024-11-29 11:26:11.345] [info]    Sent message to 127.0.0.1:202 ADD OK\r\n
[2024-11-29 11:26:11.346] [info]    [ffmpeg] [libx264 @ 00000145D839C5C0] using SAR=1/1
[2024-11-29 11:26:11.346] [info]    
[2024-11-29 11:26:11.348] [info]    [ffmpeg] [libx264 @ 00000145D839C5C0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[2024-11-29 11:26:11.348] [info]    
[2024-11-29 11:26:11.350] [info]    [ffmpeg] [libx264 @ 00000145D839C5C0] profile High 4:2:2, level 3.2, 4:2:2, 8-bit
[2024-11-29 11:26:11.350] [info]    
[2024-11-29 11:26:11.351] [warning] ffmpeg[udp://127.0.0.1:5000?pkt_size=1316] Unused option vf=scale=640:360
[2024-11-29 11:26:11.351] [info]    Received message from 127.0.0.1: TLS\r\n
[2024-11-29 11:26:11.364] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] frame I:720   Avg QP:14.02  size:  3708
[2024-11-29 11:26:11.364] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] frame P:179253 Avg QP:17.01  size:   146
[2024-11-29 11:26:11.365] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] mb I  I16..4: 100.0%  0.0%  0.0%
[2024-11-29 11:26:11.365] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[2024-11-29 11:26:11.365] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] coded y,uvDC,uvAC intra: 0.6% 1.2% 0.6% inter: 0.0% 0.0% 0.0%
[2024-11-29 11:26:11.365] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] i16 v,h,dc,p: 72%  5% 23%  0%
[2024-11-29 11:26:11.365] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] i8c dc,h,v,p: 95%  4%  0%  0%
[2024-11-29 11:26:11.365] [info]    
[2024-11-29 11:26:11.365] [info]    [ffmpeg] [libx264 @ 00000145D0050D40] kb/s:64.22

Do you have any understanding of the reason and hopefully solution for it?
Thanks

1 Like