Cai, Xin wrote:
> Hi
> so I am experimenting with trying to grab video(mjpeg) from an IP webcam and 
> I am using the Stepehen Dranger's tutorial01 as my starting point and I know 
> that in his program he does a call av_find_stream_info to retrieve the stream 
> information. Now I tried to feed the url of the ip webcam into his program 
> and it fails at av_find_stream_info (which is expected because when I try to 
> grab video from this IP camera using ffplay I have to do a -f mjpg to specify 
> an input format).
You can specify an input format when invoking av_open_input_file():
/**
  * Open a media file as input. The codecs are not opened. Only the file
  * header (if present) is read.
  *
  * @param ic_ptr The opened media file handle is put here.
  * @param filename filename to open
  * @param fmt If non-NULL, force the file format to use.
  * @param buf_size optional buffer size (zero if default is OK)
  * @param ap Additional parameters needed when opening the file
  *           (NULL if default).
  * @return 0 if OK, AVERROR_xxx otherwise
  */
int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
                        AVInputFormat *fmt,
                        int buf_size,
                        AVFormatParameters *ap);

(look at the "fmt" parameter).


                                Luca
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to