[Ffmpeg-devel] [PATCH] Add Dirac support to ffmpeg]

Michael Niedermayer michaelni
Mon Jul 25 22:28:05 CEST 2005


Hi

On Monday 25 July 2005 17:48, Andrew Kennedy wrote:
> Hi,
>
> I've altered the code in line with your recommendations. However, I'm still
>
> not entirely clear about the following:
> >and if i understand the demuxing code in drc.c correctly, then it does
> > only split the stream into packets, this should be done in a AVParser
> > instead for raw "containers", and the remaining (de)muxing code might fit
> > better in libavformat/raw.c instead of a separate file, but a separate
> > file is fine too if preferred
>
> So, if I understand this correctly, the parsing code in drc.c is shifted to
> parser.c (or a suitable place to use a Dirac parser). This then receives
> data from the 'raw' file read in raw.c. Is this correct? 

yes, but let me explain why it should be done that way
if there is just one container format and one codec then it doesnt matter much 
where the spliting into packets is done but if there are several container 
formats like lets say a raw "container" which just stores everything from the 
encoder without any headers, a container like mpeg-ps which has headers but 
no knowledge of the frame/packet boundaries either and a container like avi 
or quicktime which has knowledge of frame/packet boundaries
now if you wish to copy the video stream without decoding&reencoding it from 
either the raw or mpeg-ps formats into mov/avi/... then you need to split it 
into 1-frame packets but if that code is not demuxer independent then it 
would need to be duplicated for every demuxer which doesnt know about frame 
boundaries (raw, mpeg-ps, mpeg-ts, ...)


> I thought 
> av_read_frame() should read an entire frame of data, so I'm not clear how
> this is now possible. Are you saying that I should use the boolean in
> avcodec_decode_video() because the frame boundaries will now be split
> across packets? Please can you elaborate.

av_read_frame() uses the AVParser if one is available to change the input 
stream of random chunks into 1-frame packets (see av_read_frame() in utils.c)

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list