[FFmpeg-user] Documentation/examples about async protocol

Daniel CantarĂ­n omega_canta at yahoo.com
Mon Apr 1 04:59:50 EEST 2019


Hi there.

I'm interesting in using the async protocol, which I discovered a few 
hours ago. I believe it may solve a problem I'm facing with my video 
pipeline.

However, this is the documentation page about the async protocol: 
https://ffmpeg.org/ffmpeg-protocols.html#async
It only has a very brief description of what it does, and has a very 
generic syntax example.

Following that very example, I've tried the following setup:

# ffmpeg instance 1
ffmpeg -f lavfi -re -i "testsrc" -c:v libx264 -preset veryfast -r 30 -f 
mpegts "udp://127.0.0.1:3000?pkt_size=1316"

# ffmpeg instance 2
ffmpeg -i "async:udp://localhost:3000?pkt_size=1316" test.mp4


That gave me lots of "data loss" error ("part of datagram lost due to 
insufficient buffer size", "Missing reference picture", "Invalid NAL 
unit", etc), and an extremely noisy output.
So I've tried to tune it up, ending up with this command line:

ffmpeg -y -re -i 
"async:udp://localhost:3000?pkt_size=1316&overrun_nonfatal=1&buffer_size=1000000&fifo_size=1000000" 
-c:v libx264 -preset veryfast -r 30 test.mp4

But same results.
ffplay can reproduce "instance 1" fine, and if I don't use the async 
protocol on "instance 2" it also works fine.

Without extra parameters or some kind of fine tuning, the async protocol 
seems unusable even for the most basic use cases. I would like to tune 
up, for example, the buffer size ffmpeg tells me insufficient. However, 
I can't find any async buffer setting; in my previous example, that 
buffer_size parameter is for the udp protocol, and not async. I can't 
also find anywhere on google a single example of anyone using the async 
protocol.

So, my question is: is there any usage example for the async protocol, 
or any setup parameters I can use?

Thanks in advance.



More information about the ffmpeg-user mailing list