manas lenka wrote: > Hi, > I am confused what "av_read_frame()" exactly does ? I know it *extracts a > video frame *from the container file. I am facing such problems:------ > Suppose I have a .avi file(MPEG2) , now using "av_read_frame()" I > am getting a frame which I am able to decode with the decoder mpeg2(TI > developed not ffmpeg). But when I am trying to play a .vob file, my decoder > is unable to decode it. Can any body tell me the problem. If the > av_read_frame() gives a frame then my decode should able to decode it. But is > it giving something different than a frame for .vob file case ? , so that > my codec is unable to decode it.?. > > Thanks > MANAS > > >
Hi Manas, As per ffmpeg docs, av_read_frame does : ---------------------------- Return the next frame of a stream. The returned packet is valid until the next av_read_frame() <http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/avformat_8h.html#4fdb3084415a82e3810de6ee60e46a61> or until av_close_input_file() <http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/avformat_8h.html#b16c5838ff174c28f654b07e60c5f6a2> 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 <http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/libswscale_2yuv2rgb_8c.html#73c18c59a39b18382081ec00bb456d43>. PCM or ADPCM data). If the audio frames have a variable size (e.g <http://cekirdek.pardus.org.tr/%7Eismail/ffmpeg-docs/libswscale_2yuv2rgb_8c.html#73c18c59a39b18382081ec00bb456d43>. MPEG audio), then it contains one frame. 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. ---------------------------- Thus, for .vob, it *might *contain one navigation or pci information packet besides audio is also possible. Regards, Viral Sachde _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
