[XviD-devel] problem with xvid bitrate and... partial solution (?)

Edouard Gomez ed.gomez at free.fr
Tue Sep 14 21:23:18 CEST 2004


podolany at autograf.pl (podolany at autograf.pl) wrote:
> but....
> truncation is done BEFORE the end of the coding
> (and then the size of the xvid-twopass.. grows).
>
> Of course mpeg2 stream can be "corrupted" (created
> with Pinnacle Studio 9.1..).

EOS can happen whenever the MPEG encoder decides to put one.
So truncation is caused by mencoder resting the encoding
pipeline, as xvid module is just "uninit" and then "config"
again, the twopass module happens to truncate the file stats
file.

> Is a simple solution to remove EOS from mpeg ?

Hmmm thibking of a workaround, but that doesn't fix mencoder
behavior, it will just make xvid avoid truncating the file.
Btw there is even a more detailed description of the mencoder
bug you experience right after the patch chunk.

--- orig/src/plugins/plugin_2pass1.c
+++ mod/src/plugins/plugin_2pass1.c
@@ -69,7 +69,7 @@
     rc->stat_file = NULL;

        /* Open the 1st pass file */
-       if((rc->stat_file = fopen(param->filename, "w+b")) == NULL)
+       if((rc->stat_file = fopen(param->filename, "ab")) == NULL)
                return(XVID_ERR_FAIL);

        /* I swear xvidcore isn't buggy, but when using mencoder+xvid4 i observe

-- 
Edouard Gomez


More information about the XviD-devel mailing list