[MEncoder-users] subtitling

Alejandro Vargas alejandro.anv at gmail.com
Tue Aug 22 11:46:22 CEST 2006


2006/8/21, Corey Hickey <bugfood-ml at fatooh.org>:
> If you're using lavc to encode, try either or both of these options:
>    qns=2
> This will make encoding very slow but might help sharp edges.

I think there is a different problem because the blocks only appears
on the very first subtitle that is shown. It does not matter when is
it shown. It may be in the first second or 2 minutes later, but only
the first has the problem...

> Once you send your command line I may be able to point out more.

Ok, the command line (for the first pass) is this:

mencoder 7041.avi -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=1008:vpass=1:vqmax=31:vhq:v4mv:dia=2 -oac
mp3lame -lameopts cbr:mode=0:br=96 -noodml -ffourcc DIVX -v -o
test1.2.avi -sub subtitles.sub -noodml -fontconfig -subfont-text-scale
3 -subcp utf8 -subwidth 80 -noskip -skiplimit 1


Noodml is necesary because in large pictures, the info inserted after
2Gb breaks my divx player. Fourcc is necesary because "FFDX" is not
known by my divx player. "noscip and skiplimit avoids a-v sync
problems when there are many dropped frames. The bitrate for video is
obtained by parsing a mplayer -identify of the original file, then it
uses the same bitrate of it.

The second pass is the samb but with vpass=2

The output of mencoder is:

MEncoder dev-CVS-051220-04:08-4.0.1 (C) 2000-2005 MPlayer Team
CPU: Advanced Micro Devices Athlon 64 Clawhammer; Athlon 64 X2 Toledo;
Turion Newark,Lancaster (Family: 15, Stepping: 8)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
89 audio & 203 video codecs
init_freetype
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
font: can't open file: /root/.mplayer/font/font.desc
font: can't open file: /usr/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
[file] File size is 366484120 bytes
STREAM: [file] 7041.avi
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
success: format: 0  data: 0x0 - 0x15d81a98
AVI file format detected.
list_end=0x146
======= AVI Header =======
us/frame: 41708  (fps=23.976)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (272) HAS_INDEX IS_INTERLEAVED
frames  total: 61476   initial: 0
streams: 2
Suggested BufferSize: 0
Size:  512 x 384
==========================
list_end=0xD4
==> Found video stream: 0
====== STREAM Header =====
Type: vids   FCC: XVID (44495658)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 23976024/1000000 = 23.976
Start: 0   Len: 61476
Suggested BufferSize: 95159
Quality 0
Sample size: 0
==========================
Found 'bih', 40 bytes of 40
======= VIDEO Format ======
  biSize 40
  biWidth 512
  biHeight 384
  biPlanes 1
  biBitCount 24
  biCompression 1145656920='XVID'
  biSizeImage 589824
===========================
===========================
Regenerating keyframe table for MPEG4 video
list_end=0x146
==> Found audio stream: 1
====== STREAM Header =====
Type: auds   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 48000/1152 = 41.667
Start: 0   Len: 106835
Suggested BufferSize: 0
Quality 0
Sample size: 0
==========================
Found 'wf', 30 bytes of 18
======= WAVE Format =======
Format Tag: 85 (0x55)
Channels: 2
Samplerate: 48000
avg byte/sec: 16000
Block align: 1152
bits/sample: 16
cbSize: 12
mp3.wID=1
mp3.fdwFlags=0x2
mp3.nBlockSize=1152
mp3.nFramesPerBlock=1
mp3.nCodecDelay=0
===========================
list_end=0x16A
hdr=Software  size=16
Software  : cant touch this
list_end=0x15AF0320
Found movie at 0x800 - 0x15AF0320
Reading INDEX block, 168311 chunks for 61476 frames (fpos=0x15af0328)
AVI index offset: 0x0 (movi=0x800 idx0=0x800 idx1=0x107C)
Auto-selected AVI video ID = 0
Auto-selected AVI audio ID = 1
AVI: Searching for audio stream (id:1)
XXX initial  v_pts=0.000  a_pos=0 (0.000)
AVI video size=323162737 (61476) audio size=39248928 (106835)
VIDEO:  [XVID]  512x384  24bpp  23.976 fps  1008.3 kbps (123.1 kbyte/s)
[V] filefmt:3  fourcc:0x44495658  size:512x384  fps:23.98  ftime:=0.0417
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer.
mp3lib: made decode tables with MMX optimization
mp3lib: using 3DNow!Ex optimized decore!
MP3lib: init layer2&3 finished, tables done
^MMPEG 1.0, Layer III, 48000 Hz 128 kbit Joint-Stereo, BPF: 384
Channels: 2, copyright: No, original: Yes, CRC: Yes, emphasis: 0
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
SUB: Detected subtitle file format: microdvd
SUB: opened iconv descriptor.
SUB: closed iconv descriptor.
SUB: Read 747 subtitles.
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
INFO: libavcodec init OK!
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Forcing output fourcc to 58564944 [DIVX]
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
LAME 3.97 (beta 2, Nov 29 2005) 32bits (http://www.mp3dev.org/)
CPU features: MMX (ASM used), 3DNow! (ASM used), SSE, SSE2
Using polyphase lowpass filter, transition band: 14903 Hz - 15484 Hz

misc:

        scaling: 0.95
        ch0 (left) scaling: 0
        ch1 (right) scaling: 0
        filter type: 0
        quantization: xr^3/4
        huffman search: normal
        experimental Y=0
        ...
stream format:

        MPEG-1 Layer 3
        2 channel - stereo
        padding: off
        constant bitrate - CBR
        ...

psychoacoustic:

        using psychoacoustic model: 1
        psychoacoustic model: NSPsytune
        tonality estimation limit: 8871.700195 Hz (not relevant)
        using short blocks: channel coupled
        subblock gain: 1
        adjust masking: 0 dB
        adjust masking short: 0 dB
        quantization comparison: 9
         ^ comparison short blocks: 9
        noise shaping: 2
         ^ amplification: 0
         ^ stopping: 0
        ATH: using
         ^ type: 4
         ^ shape: 5.5 (only for type 4)
         ^ level adjustement: -0.1
         ^ adjust type: 3
         ^ adjust sensitivity power: 1.000000
         ^ adapt threshold type: 2
        experimental psy tunings by Naoki Shibata
           adjust masking bass=0 dB, alto=0 dB, treble=0 dB, sfb21=0 dB
        using temporal masking effect: yes
        interchannel masking ratio: 0.0006
        ...

MP3 audio selected
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[ffmpeg] aspect_ratio: 1.333333
VDec: vo config request - 512 x 384 (preferred colorspace: Planar YV12)
Trying filter chain: expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO Config (512x384->512x384,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (512x384 fourcc=58564944 [DIVX])
High quality encoding selected (non real time)!
Unicode font: 490 glyphs.
*** [lavc] Allocating mp_image_t, 512x384x12bpp YUV planar, 294912 bytes
*** [expand] Direct Rendering mp_image_t, 512x384x12bpp YUV planar, 294912 bytes
Pos:   0.0s      1f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:0]
A/Vms 1/34 D/B/S 0/1/0 ^M*** [lavc] Allocating mp_image_t,
512x384x12bpp YUV planar, 2
94912 bytes
*** [expand] Direct Rendering mp_image_t, 512x384x12bpp YUV planar, 294912 bytes
........



-- 
Alejandro Vargas



More information about the MEncoder-users mailing list