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

Andrew Kennedy andrew.kennedy
Tue Sep 20 17:55:24 CEST 2005


Hi

At 22:19 16/09/2005, you wrote:
>Hi
>
>On Fri, Sep 16, 2005 at 04:50:12PM +0100, Andrew Kennedy wrote:
> >
> > Hi
> >
> > At 11:37 02/09/2005, you wrote:
> > >Hi
> > >
> > >On Tue, Aug 30, 2005 at 04:25:54PM +0100, Andrew Kennedy wrote:
> > >> Hi,
> > >>
> > >> I've amended the patch in line with your recommendations. As part of the
> > >> changes, encoding should now only work with the -2 strict option.
> > >
> > >thanks, but it seems i keep finding issues every time i want to apply it
> > >so i have to annoy you again with a list of recommandet changes
> > >
> > >[...]
> > >> +static int dirac_encode_frame(AVCodecContext *avccontext,
> > >> +                              unsigned char *frame,
> > >> +                              int buf_size, void *data)
> > >[...]
> > >> +    avccontext->coded_frame->pts= 0;
> > >
> > >this obviously is wrong, 2 frames cant have the same pts, why do you
> > >set it at all?
> > >
> >
> > This seems to have been set to avoid problems when encoding to container
> > formats such as avi. When removed, non-monotone errors are thrown up 
> before
> > writing the frame. So this line of code is really more of a short-term 
> fix.
> > As to a cleaner implementation, I'm not sure which approach to take. Any
> > suggestions?
>
>please elaborate on what you did to get non-monotone errors?
>(with latest cvs of course)

For example, removing:
avccontext->coded_frame->pts= 0
...and encoding using:

ffmpeg_g -s 720x576 -i snowboard.yuv [14 frames] -vcodec dirac -f avi -r 
25/1 -strict -2  output.avi

....produces (from utils.c)
error, non monotone timestamps 12 >= 120.5 bitrate=2430.9kbits/s
error, non monotone timestamps 12 >= 12
error, non monotone timestamps 12 >= 12

..code snippet:
if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >= pkt->dts){
    av_log(NULL, AV_LOG_ERROR, "error, non monotone timestamps %Ld >= 
%Ld\n", st->cur_dts, pkt->dts);
    return -1;

However, adding in:
avccontext->coded_frame->pts=AV_NOPTS_VALUE;
..to dirac_encode_frame() does not produce an error. Is this valid?

Regards
Andrew








More information about the ffmpeg-devel mailing list