New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [ffmpeg] Data packets dropped when ffmpeg is used as a sender #1223
Comments
|
Ahoi Arno, can you please share the commands for ffmpeg that you are using? On client and server side? This is not expected and we need to take a look at it. Also the commands for the srt-live-transmit and ffmpeg-server combination might be interesting to compare. Feel free to anonymize IP addresses or passwords if needed. best regards, |
|
Here are the commands used: Direct ffmpeg to ffmpeg (dropped frames when adding packet drop):
ffmpeg to srt-live-transmit to ffmpeg (perfect transmission over bad network):
|
|
Ahoi Arno, you are using a file as input and ffmpeg will try to use all 1500 bytes of the MTU. However, SRT has some overhead, so the MTU cannot be stuffed to it's limit with data. Our sample application In ffmpeg you have to specify the Can you try following on you client side: If you wonder, why 1316: A TS packet is 188 bytes. With an MTU of 1500 you can stuff 8 packets in. Since SRT has a minimal overhead, we can only put 7 TS packets in. Please see also following links to get some more information on ffmpeg and SRT: https://srtlab.github.io/srt-cookbook/apps/ffmpeg/ Please let me know, if this solved you problem. |
|
@J-Rogmann 1316 is already the default size in ffmpeg with srt in live type (which is the default). |
|
I tested forcing pkt_size to 1316 to no avail. It still doesn't recover packets. |
|
Ps: obs 25.0.1 already comes with libsrt 1.4.1 and @Arno500 had the same bug. My build is with libsrt
master/ avformat master and a rewritten srt output since we had issues with
makito x decoder (see with Maxim who's been put in the loop by Marc, but this is unrelated to the present issue; i'm in obs dev team). It shows the same issue as the regular build of obs and ffmpeg CLI.
…On Wed, Apr 1, 2020, 14:58 Arno DUBOIS ***@***.***> wrote:
I tested forcing pkt_size to 1316 to no avail. It still doesn't recover
packets.
My final goal is to use it with OBS over bad connections and use all the
reliability power of SRT.
So at first I directly used the OBS output which doesn't feed a file to
FFMPEG. (note I used a special OBS build provided by @pkviet
<https://github.com/pkviet> with libsrt 1.4.1 to eliminate errors from
old versions)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1223 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACG2OT65ODWRJJAEJRK2IXLRKM27LANCNFSM4LXVQHFQ>
.
|
|
this in indeed very stange. @Arno500 would it be possible, to create a packet capture of your stream, e.g. with tcpdump or wireshark? Please start capture first, then initiate stream, leave it running for 30-60 seconds and stop capture. This would give us some more insight, was is happening here. @pkviet I was privately using OBS 25.0.1 last Saturday to send some live streams and connect more than 50 friends across the globe for a virtual meetup and party. We streamed mostly in Germany but also had viewers and contributors from Tokyo and Buenos Aires. Worked very well and stable with SRT. Big Up. |
|
I uploaded the dump here : https://cloud.arnodubo.is/s/BzJXsAxMKoLbGTD |
|
LInux system packet loss can be simulated with traffic control https://wiki.linuxfoundation.org/networking/netem For example, the following gives 10% packet loss on interface
assuming you already have some rules in place for |
According to the dump, the negotiated latency value is 3 ms. I can assume ffmpeg expects latency in microseconds, so the following command sets 3ms latency instead of 3s.
|
|
right the latency in ffmpeg is defined in microseconds: |
|
OH But thanks all for your help and your time! |
|
FFMpeg will keep latency in microseconds. Citing Nicolas George:
Updated SRT Cookbook on ffmpeg latency unit: link. |
|
Okay, that's fair. |
|
This issue can be closed then.
Steps to consider:
|
Describe the bug
When using
ffmpegdirectly to send an SRT stream with a bad connection (I'm simulating with clumsy, adding only outbound packet loss), packets doesn't get resend/rereceived or I don't know what. But I get these kind of errors on the receiving end:And the H264 stream is completly garbled, at only 1% packet loss.
Here is my flow:
ffmpeg ----------SRT with latency set to 3000----------> ffmpeg serverWhen using the srt-live-transmit app as a proxy
(ie:
ffmpeg ----SRT----> srt-live-transmit ----SRT with latency set to 3000----> ffmpeg server) I can go up to 90% packet lost without ANY problem (with a high bandwidth of course, but it does recover the lost data).To Reproduce the problem
Steps to reproduce the behavior:
ffmpegand output to an SRT listener server, specifying a high latency to allow for better packet recoveryclumsy) try to drop packets and increase the rate.ffmpegso I get the kind of error you can see above.Expected behavior
Packets should recover themselves with the SRT protocol (provided you have enough bandwidth, I'm on FTTH and my server have an unlimited 300mbps fiber connection with low latency).
They do with
srt-live-transmitandffmpegas a server, but not withffmpegas a sender. Either the latency setting is being ignored with FFMPEG (I get similar result when not specifying latency insrt-live-transmit, it defaults to something like 120ms (I though it should take server's one)), or something else I'm not aware of.Desktop (please provide the following information):
Additional context
ffmpegbuild I use (zeranoe) has 1.4.1 included in it.The text was updated successfully, but these errors were encountered: