Passing udp unix socket as input to ffmpeg -


i know ffmpeg able receive input unix socket:

ffmpeg -i unix://path-to-socket ... 

problem once changing socket type sock_dgram instead of sock_stream in server code, ffmpeg not able receive data , error printed:

unix://path-to-socket: protocol wrong type socket 

looking @ socket documentation on ffmpeg's site following options can applied:

  • timeout: timeout in ms.
  • listen: create unix socket in listening mode.

which not relevant declaring socket type.

ls configuring unix socket sock_dgram possible?

thanks,

joey.

the documentation incomplete. in ffmpeg/libavformat/unix.c,

static const avoption unix_options[] = {     { "listen",    "open socket listening",             offset(listen),  av_opt_type_bool,  { .i64 = 0 },                    0,       1, ed },     { "timeout",   "timeout in ms",                         offset(timeout), av_opt_type_int,   { .i64 = -1 },                  -1, int_max, ed },     { "type",      "socket type",                           offset(type),    av_opt_type_int,   { .i64 = sock_stream },    int_min, int_max, ed, "type" },     { "stream",    "stream (reliable stream-oriented)",     0,               av_opt_type_const, { .i64 = sock_stream },    int_min, int_max, ed, "type" },     { "datagram",  "datagram (unreliable packet-oriented)", 0,               av_opt_type_const, { .i64 = sock_dgram },     int_min, int_max, ed, "type" },     { "seqpacket", "seqpacket (reliable packet-oriented",   0,               av_opt_type_const, { .i64 = sock_seqpacket }, int_min, int_max, ed, "type" },     { null } }; 

it handles stream=1, datagram=1, seqpacket=1, or type=#, # integer value of desired socket type (sock_stream=1, sock_dgram=2, sock_seqpacket=5).


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -