User Tools

Site Tools


ffmpeg:av_read_frame

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
ffmpeg:av_read_frame [2007/11/22 16:56] – created devaffmpeg:av_read_frame [2007/11/22 17:00] deva
Line 1: Line 1:
-=====avcodec_decode_video=====+=====avc_read_frame=====
 ====Overview==== ====Overview====
 Defined in ''avformat.h''\\ Defined in ''avformat.h''\\
  
-Read transport packet from a media file.\\+Return the next frame of stream.\\
  
-This function is obsolete and should never be used.\\ +The returned packet is valid until the next av_read_frame() or until av_close_input_file() and must be freed with av_free_packet. For video, the packet contains exactly one frame. For audio, it contains an integer number of frames if each frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames have a variable size (e.g. MPEG audio), then it contains one frame.\\ 
-Use [[ffmpeg:av_read_frame|av_read_frame()]] instead.+ 
 +pkt->pts, pkt->dts and pkt->duration are always set to correct values in AVStream.timebase units (and guessed if the format cannot provided them). pkt->pts can be AV_NOPTS_VALUE if the video format has B frames, so it is better to rely on pkt->dts if you do not 
 +decompress the payload.
  
 <code c> <code c>
-int av_read_packet(AVFormatContext *s, +int av_read_frame(AVFormatContext *s, 
-                   AVPacket *pkt);+                  AVPacket *pkt);
 </code> </code>
  
Line 23: Line 25:
  
 ====Return value==== ====Return value====
-0 if OK. AVERROR_xxx if error.+0 if OK, < 0 if error or end of file.
  
 ---- ----
 Back to [[ffmpeg:ffmpeg]] Back to [[ffmpeg:ffmpeg]]
ffmpeg/av_read_frame.txt · Last modified: 2007/11/22 17:03 by deva