3

I'm using ffmpeg to do RTSP to RTMP streaming, the input is an sdp file describing one video stream and one audio stream, when I test the RTSP using ffplay,it works fine

ffplay -protocol_whitelist "file,udp,rtp" -strict -2 -i media.sdp

but when I switch to ffmpeg to do streaming, I got lot of packet missing errors

ffmpeg -protocol_whitelist "file,udp,rtp" -strict -2  -i media.sdp   -c copy -f flv "rtmp://liveaddress"

error log:

[sdp @ 000001f1f4cea400] max delay reached. need to consume packet
[sdp @ 000001f1f4cea400] RTP: missed 321 packets
[sdp @ 000001f1f4cea400] max delay reached. need to consume 
[sdp @ 000001f1f4cea400] RTP: missed 14 packets
[sdp @ 000001f1f4cea400] max delay reached. need to consume packet
[sdp @ 000001f1f4cea400] RTP: missed 7 packets

the sdp file:

SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
t=0 0
a=tool:libavformat 58.12.100
m=video 5555 RTP/AVP 96
c=IN IP4 127.0.0.1
b=AS:2000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LAINoBQBbsBagICAoAAAfSAAOpgR4wZUA=,aM4fIA==; profile-level-id=42c020
m=audio 6666 RTP/AVP 96
c=IN IP4 127.0.0.1
b=AS:125
a=rtpmap:96 MPEG4-GENERIC/44100/2
a=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1210
ArL
  • 283
  • 5
  • 11

2 Answers2

2

After some research on the web, I have found a solution: add a -buffer_size command arg to ffmpeg cause my H264 video from RTSP server has variable bit rate I guess.

ArL
  • 283
  • 5
  • 11
0

I had a similar problem, solved with -rtsp_transport tcp -protocol_whiteliste rtp,file,udp,tcp