Opened 6 years ago

Closed 6 years ago

Last modified 6 years 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: Marton Balint 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 6 years ago.
console output
ffmpeg-20180502-184642.log (31.6 KB ) - added by koba 6 years ago.
generated by '-report' option

Download all attachments as: .zip

Change History (5)

by koba, 6 years ago

Attachment: error.log added

console output

by koba, 6 years ago

Attachment: ffmpeg-20180502-184642.log added

generated by '-report' option

comment:1 by Marton Balint, 6 years ago

Cc: Marton Balint added

comment:2 by pkv, 6 years ago

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 6 years ago by pkv (previous) (diff)

comment:3 by pkv, 6 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.