Hi Viral Thanks for the reply. I am using function av_read_frame(pFormatCtx, &packet) and I am giving the packet.data to my codec. Is the "packet->data" is different for .avi and .vob file(assuming each has same encoded frame). I am wondering why for .avi case my codec is successfully decoding the "packet->data" but for .vob case it is unable ?? THANKS MANAs Viral Sachde <[EMAIL PROTECTED]> wrote: 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() 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. 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 --------------------------------- Share files, take polls, and make new friends - all under one roof. Click here. _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
