If the audio frames have a variable size (e.g. Integer number of frames if each frame has a known fixed size (e.g. The returned packet is valid until the next av_read_frame() or untilĪv_close_input_file() and must be freed with av_free_packet().įor video, the packet contains exactly one frame. Pkt is a AVPacket object that will be filled with the packet data. In the case of an error, an AVFormatErrorĮxception is thrown. The return value is the integer that was returned by the underlyingĬ function (it is always >=0). The logical file position is not changed by thisįunction examined packets may be buffered for later processing.įormatCtx is the media file handle as returned by av_open_input_file(). Thisįunction also computes the real frame rate in case of mpeg2 repeatįrame mode. This is useful for file formats with no headers such as MPEG. Read packets of a media file to get stream information. If it is None, the function returns immediately. av_close_input_file ( formatCtx ) ¶įormatCtx is the format context as returned by av_open_input_file() In case of an error, an AVFormatError exception is thrown. The return value is a AVFormatContext object that contains informationĪbout the format and that serves as a handle to the open file. Params is an optional AVFormatParameters object if extra parameters To force a particular file format (AVInputFormat is not yet exposed).īuf_size is an optional buffer size (or 0/ None if the default size is ok) av_open_input_file ( fileName, format=None, buf_size=0, params=None ) ¶įileName is a string containing the file to open.įormat is an optional AVInputFormat object that can be specified If that object is passed back inĪre no more formats available, None is returned. If fmt is None, the first registered output format is returnedĪs a AVOutputFormat object. Return the first/next registered output format. If thereĪre no more formats available, None is returned. If that object is passed back inĪs input, the next registered format is returned and so on. If fmt is None, the first registered input format is returnedĪs a AVInputFormat object. Return the first/next registered input format. This must be called at the beginning before any file is opened. Initialize libavformat and register all the (de)muxers and protocols. Returns a tuple (major,minor,micro) containing the three parts of the
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |