What is ffmpeg's UDP protocol?

后端 未结 4 1579
傲寒
傲寒 2021-02-09 00:21

What is ffmpeg\'s UDP protocol ?

Here is example from another question

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

ffmpeg -i rtp://lo         


        
相关标签:
4条回答
  • 2021-02-09 00:30

    Apparently it is RTSP, see libavformat/rtsp.c and libavformat/udp.c in the source.

    0 讨论(0)
  • 2021-02-09 00:38

    udp:// in ffmpeg means that it will stream/parse direct video/audio content (e.g. H.264) into/from UDP network packets, with no intermediate protocols.

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

    RTP is much better suited for media streaming, because it includes timestamp and sequencing information. Raw UDP packets lack that information, being more prone to out-of-order and dropped packets, leading to video/audio artifacts.

    0 讨论(0)
  • 2021-02-09 00:43

    ffmpeg can listen to a UDP port and receive data from that port. The data can be from a camera who send RTP pakets encapsulated in UDP . SO imagine the camera as a sender who just send udp pakets on a port to a ip and ffmpeg listening on that ip on same port and processing what camera send to it They are just the input of your data and you can use the -f option , no matter the input is from a udp port or from a movie for you is same 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 ,is just a input

    0 讨论(0)
  • 2021-02-09 00:50

    User Datagram Protocol.

    The required syntax for an UDP URL is:

    udp://hostname:port[?options]
    

    options contains a list of &-separated options of the form key=val.

    In case threading is enabled on the system, a circular buffer is used to store the incoming data, which allows one to reduce loss of data due to UDP socket buffer overruns. The fifo_size and overrun_nonfatal options are related to this buffer.

    The list of supported options follows.

    Use ffmpeg to stream over UDP to a remote endpoint:

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

    Use ffmpeg to stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:

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

    Use ffmpeg to receive over UDP from a remote endpoint:

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

    you can find some tips in the man commande!

    0 讨论(0)
提交回复
热议问题