[Ffmpeg-devel] Read video from UDP

Raphael HUCK raphaelh
Wed Dec 14 22:35:02 CET 2005


Hi,

I would like to read a video which is sent through an UDP stream.
So, I'm using "av_open_input_file" like this:

    if(av_open_input_file(&pFormatCtx, "udp://?localport=16886", NULL, 
0, NULL)!=0)

because I saw in "udp.c":

     /* XXX: fix url_split */
     if (hostname[0] == '\0' || hostname[0] == '?') {
         /* only accepts null hostname if input */
         if (s->is_multicast || (flags & URL_WRONLY))
             goto fail;
     } else {
         udp_set_remote_url(h, uri);
     }

But it doesn't work. There's not too much documentation, so I'm trying 
to guess how to do it from the comments, but it's not always easy...

I also don't understand that:

    * If no filename is given to av_open_input_file because you want to
    * get the local port first, then you must call this function to set
    * the remote server address.
    int udp_set_remote_url(URLContext *h, const char *uri)

How is it possible not to give a filename to "av_open_input_file" ? What 
  is the remote server address for if I just want to read a video from UDP ?

Don't I just have to listen on a given port to receive a video ?

Thanks in advance,

--Raphael





More information about the ffmpeg-devel mailing list