Opened 7 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#7187 closed defect (invalid)

ffmpeg stops immediately when sending by libsrt

Reported by: koba Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: libsrt
Cc: cus Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Build ffmpeg on git tag 'n4.1-dev' with configure --enable-libsrt.
Transmitting by SRT always fails.

How to reproduce:
Receiver

% ffplay -i 'srt://localhost:3000?mode=listener' 


Sender

% ffmpeg -report -re -f lavfi -i testsrc=s=1280x720:r=30 -c:v libx264 -f mpegts 'srt://localhost:3000'

Sender ffmpeg stops with these error

18:46:44.038217/ffmpeg*E: SRT.c: LiveSmoother: payload size: 9024 exceeds maximum allowed 1316
[srt @ 0x273f980] Operation not supported: Incorrect use of Message API (sendmsg/recvmsg)..
av_interleaved_write_frame(): Unknown error occurred
Error writing trailer of srt://localhost:3000: Unknown error occurred

I attach full error.log and output file by '-report' option.

FYI: this quick dirty patch fixes this problem.

diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index 0f9529d..073261b 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -466,6 +466,7 @@ static int libsrt_open(URLContext *h, const char *uri, int flags)
             }
         }
     }
+    h->max_packet_size = 1316;
     return libsrt_setup(h, uri, flags);
 }

Attachments (2)

error.log (3.0 KB) - added by koba 7 weeks ago.
console output
ffmpeg-20180502-184642.log (31.6 KB) - added by koba 7 weeks ago.
generated by '-report' option

Download all attachments as: .zip

Change History (5)

Changed 7 weeks ago by koba

console output

Changed 7 weeks ago by koba

generated by '-report' option

comment:1 Changed 6 weeks ago by cus

  • Cc cus added

comment:2 Changed 4 weeks ago by pkv

Bug confirmed on my side and by several other people: https://github.com/Haivision/srt/issues/371

nxstreaming in the link has a better patch IMO:
https://gist.github.com/nxtreaming/defaf90d4a08fdda0a7b30440ddfbbaa

It adds a pkt_size option to the protocol exactly as with udp protocol.

edit: the mss option should be used per mss=1316
So not a bug.
The doc should reflect that important info since it is not clearly spellt out.

Last edited 4 weeks ago by pkv (previous) (diff)

comment:3 Changed 4 weeks ago by pkv

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.