Por que estou perdendo pacotes no ffmpeg fazendo streaming local de RTP?

2

Estou tentando testar o streaming do ffmpeg com RTP por meio do arquivo SDP local. Então pra começar o stream eu corro

ffmpeg -re -thread_queue_size 4 -i .\bbb_streamable.flv -strict -2 -vcodec copy -an -f rtp rtp://127.0.0.1:6005 -acodec copy -vn -f rtp rtp://127.0.0.1:7005

Isso me dá o seguinte SDP

v=0
o=- 0 0 IN IP4 127.0.0.1
s=Big Buck Bunny, Sunflower version
t=0 0
a=tool:libavformat 58.10.100
m=video 6005 RTP/AVP 96
c=IN IP4 127.0.0.1
b=AS:3500
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z2QAKKzZQHgCJ+XARAAAAwAEAAADAPA8YMZY,aOrssiw=; profile-level-id=640028
m=audio 7005 RTP/AVP 97
c=IN IP4 127.0.0.1
b=AS:96
a=rtpmap:97 MPEG4-GENERIC/44100/2
a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=121056E500

Então, para gravar o fluxo RTP em outra janela, eu executo:

ffmpeg -protocol_whitelist "file,rtp,udp" -i .\test.sdp -strict -2 test.flv

Enquanto isso ocorre, estou constantemente recebendo mensagens no ffmpeg sobre pacotes perdidos

[sdp @ 0000020b70f2aa80] max delay reached. need to consume packete=2149.1kbits/s dup=0 drop=1 speed= 1.2x
[sdp @ 0000020b70f2aa80] RTP: missed 230 packets
[h264 @ 0000020b71456ec0] error while decoding MB 20 11, bytestream -45
[h264 @ 0000020b71456ec0] concealing 6869 DC, 6869 AC, 6869 MV errors in I frame
[sdp @ 0000020b70f2aa80] max delay reached. need to consume packete=2119.4kbits/s dup=0 drop=1 speed=1.17x
[sdp @ 0000020b70f2aa80] RTP: missed 208 packets
[h264 @ 0000020b70ff5f80] error while decoding MB 116 12, bytestream -13
[h264 @ 0000020b70ff5f80] concealing 6653 DC, 6653 AC, 6653 MV errors in I frame
[sdp @ 0000020b70f2aa80] max delay reached. need to consume packete=2107.8kbits/s dup=0 drop=1 speed=1.15x
[sdp @ 0000020b70f2aa80] RTP: missed 17 packets
[h264 @ 0000020b70ff5f80] error while decoding MB 22 48, bytestream -7
[h264 @ 0000020b70ff5f80] concealing 2427 DC, 2427 AC, 2427 MV errors in P frames dup=0 drop=1 speed=1.14x
[sdp @ 0000020b70f2aa80] max delay reached. need to consume packet
[sdp @ 0000020b70f2aa80] RTP: missed 210 packets

Ao visualizar o arquivo flv gerado, há uma tonelada de artefatos e problemas. O arquivo de origem está 100% limpo.

Por que esse desempenho está tão ruim, mesmo acima de 127.0.0.1 ?

    
por KallDrexx 09.05.2018 / 16:54

0 respostas