[MEncoder-users] Too-high bitrate problem
Francois Visagie
francois.visagie at gmail.com
Wed Oct 17 21:13:17 CEST 2007
Hi All,
Now that my subscription is on Gmail, may I ask if anybody can
contribute any information to this problem with incorrect handling of
unnecessarily bit rate, which can be overcome by having present the
mencoder.conf described below? To recap, although I had initially
thought 1.0rc1 didn't have this problem and 1.0rc2 did, both do,
although not necessarily with the same command line options. The same
input file is used in both versions. In both versions the problem is
overcome by adding the below mencoder.conf.
Kind regards,
Francois
--------------------------------------------------------------------------------------------------------------------
> From: Francois Visagie
> Sent: 16 October 2007 21:28
>
> Hi All,
>
> Congratulations on 1.0rc2 and all its enhancements and improvements!
>
> The previously fixed problem with bitrate deemed unnecessarily high
> not being properly handled has returned in 1.0rc2. In the comparison
> below I used the command line:
> mencoder %1 -aspect 4/3 -mc 0 -noskip -vf hqdn3d=2:1:2,harddup -ovc
> lavc -oac lavc -lavcopts
> aspect=4/3:ildct:ilme:keyint=15:vbitrate=7345:vcodec=mpeg2vide
> o:vpass=%PASS%:vrc_buf_size=1835:vrc_maxrate=9800:vstrict=0:ac
> odec=ac3:abitrate=128:psnr -of mpeg -mpegopts format=dvd:tsaf -o
> %1.1.mpg
>
> In previous versions with this problem MEncoder would crash, but now
> the symptoms are:
> * as before it reports the unnecessarily high bitrate,
> * it completes the encode (two-pass in my case),
> * the movie contains no video (except black ;-)),
> * therefore the bitrate is very much lower than specified; in this
> case it would be around 152kbps instead of around 7340, and
> * the PSNR calculations fail in pass 2
>
> As before this behaviour can be avoided by either specifying a lower
> bitrate or by enforcing a higher bitrate usage through increased
> quality.
>
> The most recent version I used where this worked correctly, was
> MEncoder Sherpya-SVN-r24537-4.2.1. I do realise that it may contain
> patches that never found their way into 1.0rc2, but hopefully somebody
> with better access than I to compiling SVNs can tell. During its two
> passes MEncoder
> Sherpya-SVN-r24537-4.2.1 displays:
>
> --------------------------------------------------------------
> --------------------------------------------------------------
> ---------------------------------
> MEncoder Sherpya-SVN-r24537-4.2.1 (C) 2000-2007 MPlayer Team
> CPU: Intel(R) Pentium(R) M processor 2.00GHz (Family: 6,
> Model: 13, Stepping: 8)
>
> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1
> SSE2: 1 Compiled with runtime CPU detection.
> success: format: 0 data: 0x0 - 0xf205000 AVI file format detected.
> AVI_NI: No video stream found.
> libavformat file format detected.
> [lavf] Video stream found, -vid 0
> [lavf] Audio stream found, -aid 1
> VIDEO: [dvsd] 720x576 0bpp 25.000 fps 28800.0 kbps
> (3515.6 kbyte/s) [V] filefmt:35 fourcc:0x64737664
> size:720x576 fps:25.00 ftime:=0.0400
> ==============================================================
> ============
> Opening audio decoder: [pcm] Uncompressed PCM audio decoder
> AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio:
> 192000->192000) Selected audio codec: [pcm] afm: pcm
> (Uncompressed PCM)
> ==============================================================
> ============
> PACKET SIZE: 2048 bytes, deltascr: 43885 Opening video
> filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening
> video filter: [harddup] Opening video filter:
> [hqdn3d=2:1:2]
> ==============================================================
> ============
> Opening video decoder: [dshow] DirectShow video codecs Decoder
> supports the following YUV formats: YUY2 UYVY Decoder is capable of
> YUV output (flags 0x9)
> VDec: vo config request - 720 x 576 (preferred colorspace:
> Packed YUY2) [PP] Using codec's postprocessing, max q = 4.
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> VDec: using Packed YUY2 as output csp (no 0) Movie-Aspect is
> 1.33:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 9 -> 8 [swscaler @
> 00D80B00]SwScaler: BICUBIC scaler, from yuyv422 to yuv420p using MMX
> 2
> [swscaler @ 00D80B00]SwScaler: using 4-tap MMX scaler for horizontal
> luminance s caling [swscaler @ 00D80B00]SwScaler:
> using 4-tap MMX scaler for horizontal chrominance scaling [swscaler @
> 00D80B00]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV
> 12 like)
> [swscaler @ 00D80B00]SwScaler: 720x576 -> 720x576
> videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
> VideoDecoder::SetExtAttr: registry failure Selected video
> codec: [qdv] vfm: dshow (Sony Digital Video (DV))
> ==============================================================
> ============
> Limiting audio preload to 0.4s.
> Increasing audio density to 4.
> Writing header...
> INITV: 0.200, 0.160, fps: 25.000
> Pos: 70.3s 1757f (100%) 26.26fps Trem: 0min 62mb
> A-V:0.000 [7355:127]
> Flushing video frames.
> Writing index...
>
> Overhead: 1.731% (1118973 / 64644355)
> Writing header...
>
> Video stream: 7355.351 kbit/s (919418 B/s) size: 64616759 bytes
> 70.280 secs
> 1757 frames
>
> Audio stream: 128.000 kbit/s (15999 B/s) size: 1124864 bytes
> 70.304 secs
> PSNR: Y:39.74, Cb:45.17, Cr:44.30, All:40.86 MEncoder
> Sherpya-SVN-r24537-4.2.1 (C) 2000-2007 MPlayer Team
> CPU: Intel(R) Pentium(R) M processor 2.00GHz (Family: 6,
> Model: 13, Stepping: 8)
>
> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1
> SSE2: 1 Compiled with runtime CPU detection.
> success: format: 0 data: 0x0 - 0xf205000 AVI file format detected.
> AVI_NI: No video stream found.
> libavformat file format detected.
> [lavf] Video stream found, -vid 0
> [lavf] Audio stream found, -aid 1
> VIDEO: [dvsd] 720x576 0bpp 25.000 fps 28800.0 kbps
> (3515.6 kbyte/s) [V] filefmt:35 fourcc:0x64737664
> size:720x576 fps:25.00 ftime:=0.0400
> ==============================================================
> ============
> Opening audio decoder: [pcm] Uncompressed PCM audio decoder
> AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio:
> 192000->192000) Selected audio codec: [pcm] afm: pcm
> (Uncompressed PCM)
> ==============================================================
> ============
> PACKET SIZE: 2048 bytes, deltascr: 43885 Opening video
> filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening
> video filter: [harddup] Opening video filter:
> [hqdn3d=2:1:2]
> ==============================================================
> ============
> Opening video decoder: [dshow] DirectShow video codecs Decoder
> supports the following YUV formats: YUY2 UYVY Decoder is capable of
> YUV output (flags 0x9)
> VDec: vo config request - 720 x 576 (preferred colorspace:
> Packed YUY2) [PP] Using codec's postprocessing, max q = 4.
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> VDec: using Packed YUY2 as output csp (no 0) Movie-Aspect is
> 1.33:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 9 -> 8 [swscaler @
> 00D80B00]SwScaler: BICUBIC scaler, from yuyv422 to yuv420p using MMX
> 2
> [swscaler @ 00D80B00]SwScaler: using 4-tap MMX scaler for horizontal
> luminance s caling [swscaler @ 00D80B00]SwScaler:
> using 4-tap MMX scaler for horizontal chrominance scaling [swscaler @
> 00D80B00]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV
> 12 like)
> [swscaler @ 00D80B00]SwScaler: 720x576 -> 720x576
> videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
> VideoDecoder::SetExtAttr: registry failure Selected video
> codec: [qdv] vfm: dshow (Sony Digital Video (DV))
> ==============================================================
> ============
> Limiting audio preload to 0.4s.
> Increasing audio density to 4.
> Writing header...
> INITV: 0.200, 0.160, fps: 25.000
> Pos: 70.3s 1757f (100%) 27.02fps Trem: 0min 62mb
> A-V:0.000 [7347:127]
> Flushing video frames.
> Writing index...
>
> Overhead: 1.725% (1113390 / 64561874)
> Writing header...
>
> Video stream: 7347.016 kbit/s (918377 B/s) size: 64543538 bytes
> 70.280 secs
> 1757 frames
>
> Audio stream: 128.000 kbit/s (15999 B/s) size: 1124864 bytes
> 70.304 secs
> PSNR: Y:39.85, Cb:45.30, Cr:44.35, All:40.97
> --------------------------------------------------------------
> --------------------------------------------------------------
> ---------------------------------
>
> By comparison, 1.0rc2 displays:
> --------------------------------------------------------------
> --------------------------------------------------------------
> ---------------------------------
> MEncoder 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
> CPU: Intel(R) Pentium(R) M processor 2.00GHz (Family: 6,
> Model: 13, Stepping: 8)
>
> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1
> SSE2: 1 Compiled with runtime CPU detection.
> success: format: 0 data: 0x0 - 0xf205000 AVI file format detected.
> AVI_NI: No video stream found.
> libavformat file format detected.
> [lavf] Video stream found, -vid 0
> [lavf] Audio stream found, -aid 1
> VIDEO: [dvsd] 720x576 0bpp 25.000 fps 28800.0 kbps
> (3515.6 kbyte/s) [V] filefmt:35 fourcc:0x64737664
> size:720x576 fps:25.00 ftime:=0.0400
> ==============================================================
> ============
> Opening audio decoder: [pcm] Uncompressed PCM audio decoder
> AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio:
> 192000->192000) Selected audio codec: [pcm] afm: pcm
> (Uncompressed PCM)
> ==============================================================
> ============
> PACKET SIZE: 2048 bytes, deltascr: 43885 Opening video
> filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening
> video filter: [harddup] Opening video filter:
> [hqdn3d=2:1:2]
> ==============================================================
> ============
> Opening video decoder: [dshow] DirectShow video codecs Decoder
> supports the following YUV formats: YUY2 UYVY Decoder is capable of
> YUV output (flags 0x9)
> VDec: vo config request - 720 x 576 (preferred colorspace:
> Packed YUY2) [PP] Using codec's postprocessing, max q = 4.
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> VDec: using Packed YUY2 as output csp (no 0) Movie-Aspect is
> 1.33:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 9 -> 8 [swscaler @
> 00D24D00]SwScaler: BICUBIC scaler, from yuyv422 to yuv420p using MMX
> 2
> [swscaler @ 00D24D00]SwScaler: using 4-tap MMX scaler for horizontal
> luminance s caling [swscaler @ 00D24D00]SwScaler:
> using 4-tap MMX scaler for horizontal chrominance scaling [swscaler @
> 00D24D00]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV
> 12 like)
> [swscaler @ 00D24D00]SwScaler: 720x576 -> 720x576
> videocodec: libavcodec (720x576 fourcc=3267706d [mpg2])
> VideoDecoder::SetExtAttr: registry failure Selected video
> codec: [qdv] vfm: dshow (Sony Digital Video (DV))
> ==============================================================
> ============
> Limiting audio preload to 0.4s.
> Increasing audio density to 4.
> Writing header...
> INITV: 0.200, 0.160, fps: 25.000
> Pos: 70.3s 1757f (100%) 38.69fps Trem: 0min 11mb
> A-V:0.000 [1350:127]
> Flushing video frames.
> Writing index...
>
> Overhead: 4.106% (480318 / 11697090)
> Writing header...
>
> Video stream: 1350.076 kbit/s (168759 B/s) size: 11860419 bytes
> 70.280 secs
> 1757 frames
>
> Audio stream: 128.000 kbit/s (15999 B/s) size: 1124864 bytes
> 70.304 secs
> PSNR: Y:50.50, Cb:57.04, Cr:54.50, All:51.64 MEncoder
> 1.0rc2-4.2.1 (C) 2000-2007 MPlayer Team
> CPU: Intel(R) Pentium(R) M processor 2.00GHz (Family: 6,
> Model: 13, Stepping: 8)
>
> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1
> SSE2: 1 Compiled with runtime CPU detection.
> success: format: 0 data: 0x0 - 0xf205000 AVI file format detected.
> AVI_NI: No video stream found.
> libavformat file format detected.
> [lavf] Video stream found, -vid 0
> [lavf] Audio stream found, -aid 1
> VIDEO: [dvsd] 720x576 0bpp 25.000 fps 28800.0 kbps
> (3515.6 kbyte/s) [V] filefmt:35 fourcc:0x64737664
> size:720x576 fps:25.00 ftime:=0.0400
> ==============================================================
> ============
> Opening audio decoder: [pcm] Uncompressed PCM audio decoder
> AUDIO: 48000 Hz, 2 ch, s16le, 1536.0 kbit/100.00% (ratio:
> 192000->192000) Selected audio codec: [pcm] afm: pcm
> (Uncompressed PCM)
> ==============================================================
> ============
> PACKET SIZE: 2048 bytes, deltascr: 43885 Opening video
> filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 Opening
> video filter: [harddup] Opening video filter:
> [hqdn3d=2:1:2]
> ==============================================================
> ============
> Opening video decoder: [dshow] DirectShow video codecs Decoder
> supports the following YUV formats: YUY2 UYVY Decoder is capable of
> YUV output (flags 0x9)
> VDec: vo config request - 720 x 576 (preferred colorspace:
> Packed YUY2) [PP] Using codec's postprocessing, max q = 4.
> Could not find matching colorspace - retrying with -vf scale...
> Opening video filter: [scale]
> VDec: using Packed YUY2 as output csp (no 0) Movie-Aspect is
> 1.33:1 - prescaling to correct movie aspect.
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 4
> SwScaler: reducing / aligning filtersize 1 -> 1
> SwScaler: reducing / aligning filtersize 9 -> 8 [swscaler @
> 00D24D00]SwScaler: BICUBIC scaler, from yuyv422 to yuv420p using MMX
> 2
> [swscaler @ 00D24D00]SwScaler: using 4-tap MMX scaler for horizontal
> luminance s caling [swscaler @ 00D24D00]SwScaler:
> using 4-tap MMX scaler for horizontal chrominance scaling [swscaler @
> 00D24D00]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV
> 12 like)
> [swscaler @ 00D24D00]SwScaler: 720x576 -> 720x576
> videocodec: libavcodec (720x576 fourcc=3267706d [mpg2]) [mpeg2video @
> 00D299C0][lavc rc] Using all of requested bitrate is not necessary
> for this video with these parameters.
> VideoDecoder::SetExtAttr: registry failure Selected video
> codec: [qdv] vfm: dshow (Sony Digital Video (DV))
> ==============================================================
> ============
> Limiting audio preload to 0.4s.
> Increasing audio density to 4.
> Writing header...
> INITV: 0.200, 0.160, fps: 25.000
> Pos: 70.3s 1757f (100%) 44.97fps Trem: 0min 2mb
> A-V:0.000 [152:127]
> Flushing video frames.
> Writing index...
>
> Overhead: 15.106% (369824 / 2448224)
> Writing header...
>
> Video stream: 152.669 kbit/s (19083 B/s) size: 1341193 bytes
> 70.280 secs 17
> 57 frames
>
> Audio stream: 128.000 kbit/s (15999 B/s) size: 1124864 bytes
> 70.304 secs
> PSNR: Y:1.#J, Cb:1.#J, Cr:1.#J, All:1.#J
> --------------------------------------------------------------
> --------------------------------------------------------------
> ---------------------------------
Hi All,
When I continued testing, I discovered that the above description
requires two corrections. The first is that I'm using Windows XP SP2.
The second is that both versions mentioned actually exhibit the five
symptoms listed, but surprisingly not necessarily with the same
command lines (options) using the same input file! The command line
above, for example, works for SVN-r24537 but fails with 1.0rc2, and
another command line would have the reverse effect.
AND, the REALLY surprising thing is, so far it seems that for both
versions the problem can be properly overcome (i.e. not lowering
bitrate etc.) by having present the following mencoder.conf file!
[default]
font="C:\Program Files\mplayer\mplayer\subfont.ttf"
subfont-blur=0
subfont-outline=1
subfont-text-scale=3
I haven't yet tested whether it's the mere presence of a valid (or
invalid) mencoder.conf file, or a particular setting that causes the
difference in behaviour, but when I restored this file that had been
present during all my previously successful SVN-r24537 testing, both
versions started behaving successfully again.
I'm happy to do further testing if required, let me know.
--------------------------------------------------------------------------------------------------------------------
More information about the MEncoder-users
mailing list