What is ffmpeg UDP protocol?

What is ffmpeg UDP protocol?

Here is an example from another question

ffmpeg -i udp://localhost:1234 -vcodec copy output.mp4 Or try: ffmpeg -i rtp://localhost:1234 -vcodec copy output.mp4 

Are there similar RTP and UDP protocols, or do UDP packets contain the same files that I can create with the -f segement ?

+5
source share
4 answers

This is apparently RTSP, see libavformat/rtsp.c and libavformat/udp.c in the source.

+3
source

ffmpeg can listen on UDP port and receive data from this port. The data can be from a camera that sends RTP packets encapsulated in UDP. SO imagine the camera as a sender, which simply sends udp pakets to the port for ip and ffmpeg, listening to this ip on the same port and processing which camera sends it to them. They are just entering your data, and you can use the -f option no matter which input is from the udp port or from the movie for you, you can do

ffmpeg -i movie.mp4 -c copy -f flv a.flv

or do

 ffmpeg -i udp://localhost:1234 -c copy -f flv a.flv 

for ffmpeg dnt matter, this is just an input

+2
source

udp: // in ffmpeg means that it will transmit / analyze direct video / audio content (e.g. H.264) to / from UDP network packets without intermediate protocols.

rtp: // on the other hand, adds another layer of encapsulation, where the video / audio content will be encapsulated in an RTP packet and the RTP packet will be encapsulated in a UDP packet.

RTP is much better suited for multimedia streaming because it includes time and sequence information. Raw UDP packets do not have this information; they are more prone to failures and packet drops, which leads to video / audio artifacts.

+1
source

User Datagram Protocol

Required UDP URL syntax:

 udp://hostname:port[?options] 
Parameters

contain a list of & -separable options of the form key = val.

If streaming is enabled in the system, a circular buffer is used to store incoming data, which allows to reduce data loss due to the overflow of the UDP socket buffer. The fifo_size and overrun_nonfatal parameters are associated with this buffer.

The following is a list of supported options.

Use ffmpeg to transmit over UDP to the remote endpoint:

 ffmpeg -i input -f format udp://hostname:port 

Use ffmpeg to stream mpegts over UDP using 188 UDP packets using a large input buffer:

 ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535 

Use ffmpeg to get UDP from a remote endpoint:

 ffmpeg -i udp://[multicast-address]:port ... 

You can find some tips in the man command!

0
source

Source: https://habr.com/ru/post/1211031/


All Articles