[FFmpeg-devel] [PATCH][RFC] AVFMT_RAWPICTURE, null format and 2-pass log

Michael Niedermayer michaelni
Mon Aug 11 20:13:55 CEST 2008


On Mon, Aug 11, 2008 at 01:09:38AM +0200, Stefano Sabatini wrote:
> On date Sunday 2008-08-10 01:17:16 +0200, Michael Niedermayer encoded:
> > On Sat, Aug 09, 2008 at 11:33:44AM +0200, Stefano Sabatini wrote:
> > > Hi all,
> > > 
> > > I see no reason for which when is
> > > s->oformat->flags & AVFMT_RAWPICTURE
> > > 
> > > ffmpeg shouldn't print on the 2-passlog file.
> > > 
> > > Also I cannot understand why the null_muxer is configured with the
> > > AVFMT_RAWPICTURE flag, which I'd expect instead in rawvideo_muxer (where
> > > it is missing).
> > > 
> > > Are the attached patches OK, or would you like to comment on the
> > > meaning of the AVFMT_RAWPICTURE flag?
> > > 
> > > Current documentation says:
> > > #define AVFMT_RAWPICTURE    0x0020 /**< format wants AVPicture structure for
> > >                                       raw picture data */
> > > 
> > > BTW each one of the patch fixes the problem for which if I do:
> > > 
> > > ffmpeg -i ~/test.mov -vcodec libxvid -pass 1 -passlogfile test1 -an -f null -y /dev/null
> > > 
> > > then the pass-logfile issued is empty.
> > > 
> > > Regards.
> > > -- 
> > > FFmpeg = Forgiving Fostering Multimedia Portable Elastic Gymnast
> > 
> > > Index: libavformat/raw.c
> > > ===================================================================
> > > --- libavformat/raw.c	(revision 14673)
> > > +++ libavformat/raw.c	(working copy)
> > > @@ -850,7 +850,7 @@
> > >      CODEC_ID_RAWVIDEO,
> > >      NULL,
> > >      null_write_packet,
> > > -    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
> > > +    .flags = AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
> > >  };
> > >  #endif //CONFIG_MUXERS
> > >  
> > 
> > not ok, this makes the code do extra computations IIRC
> 
> I checked the code, this flag is used in the code only in ffmpeg.c,
> and it avoids the encoding of the output frame in the below block.
> 
> The logic is that if we don't have to output the frame, then there is
> no need to encode it, the outshoot of this is that this can't work in
> this scenario, when we need to encode in order to fill the
> enc->stats_out field of the encoder context.
> 
> So when it saves somehow some computation, it simply doesn't do the
> right thing at least in this case.

then dont use it in that case, i faintly remember this issue, from what
i remember the flag is needed and its removial would break something.
Possibly some unneeded memcpies. RTFS & RTF issue tracker or ML i dont
remember it clearly sorry

If you want the encoder to run, -f rawvideo or -f image2pipe /dev/null
should do

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080811/690da6ef/attachment.pgp>



More information about the ffmpeg-devel mailing list