[FFmpeg-devel] [PATCH][RFC] AVFMT_RAWPICTURE, null format and 2-pass log
Michael Niedermayer
michaelni
Sun Aug 10 01:17:16 CEST 2008
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
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c (revision 14673)
> +++ ffmpeg.c (working copy)
> @@ -922,6 +922,7 @@
>
> write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
> enc->coded_frame = old_frame;
> + ret = 1;
> } else {
> AVFrame big_picture;
>
> @@ -973,12 +974,14 @@
> //fprintf(stderr,"\nFrame: %3d %3d size: %5d type: %d",
> // enc->frame_number-1, enc->real_pict_num, ret,
> // enc->pict_type);
> - /* if two pass, output log */
> - if (ost->logfile && enc->stats_out) {
> - fprintf(ost->logfile, "%s", enc->stats_out);
> - }
> }
> }
> +
> + /* if two pass, output log */
> + if (ret>0 && ost->logfile && enc->stats_out) {
> + fprintf(ost->logfile, "%s", enc->stats_out);
> + }
> +
> ost->sync_opts++;
> ost->frame_number++;
> }
ok if it fixes the bug and passes regressions
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- 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/20080810/fca70668/attachment.pgp>
More information about the ffmpeg-devel
mailing list