[MPlayer-users] mencoder - using external VBR/ABR MP3s (with bug report this time)

Moritz Bunkus moritz at bunkus.org
Mon Apr 29 00:26:02 CEST 2002


Hi.

> We dont. As you didnt write a proper bugreport
> (see bugreports.html)

Sorry, obviously my mistake :) So here it comes.

I'm currently uploading some sample files for what I did to
ftp://mplayerhq.hu/MPlayer/incoming/moritz.bunkus/

First let me tell you what my aim was. I'd like to use some external
programs (in this case "normalize") on the audio track, compress it
with lame to ABR and then include it in the final avi.

So here's what I did:

# First extract some 20 seconds of audio for this demonstration
mplayer -vo null -nogui -dumpaudio -dumpfile short.mp2 b5-dotd.mpg
# I've uploaded a 5megs sample from b5-dotd.mpg to the ftp server.
mpg123 -w short.wav -n 800 short.mp2

# Now produce two versions of the external mp3: one with ABR @ 128,
# one with CBR @ 128
lame --alt-preset 128 short.wav short-abr-128.mp3
lame short.wav short-cbr-128.mp3
# I've uploaded both mp3 files to the ftp server.
# Btw I've tried lame 3.91 and 3.92

# Use two pass encoding, again only 20 seconds, no sound at all
mencoder -nosound -o 1st.avi -ovc lavc \
  -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=1 -endpos 0:20 b5-dotd.mpg
mencoder -nosound -o short-video-only.avi -ovc lavc \
  -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vpass=2 -endpos 0:20 b5-dotd.mpg
# I've uploaded the short-video-only.avi to the ftp-server.

# Now join the video and the audio
# This works fine:
mencoder -oac copy -audiofile short-cbr-128.mp3 -ovc copy short-video-only.avi -o short-cbr.avi
# This does not:
mencoder -oac copy -audiofile short-abr-128.mp3 -ovc copy short-video-only.avi -o short-abr.avi

###########################################
# Output of the last command (without -v):
###########################################

MEncoder CVS-020426-06:00-2.95.4 (C) 2000-2002 Arpad Gereoffy (see DOCS!)
Reading /home/callista/.mplayer/codecs.conf: can't open '/home/callista/.mplayer                                                                                               /codecs.conf': No such file or directory
Reading /usr/local/share/mplayer/codecs.conf: 34 audio & 91 video codecs
CPU vendor name: AuthenticAMD  max cpuid level: 1
CPU: Advanced Micro Devices Athlon TB Thunderbird (Type: 6, Stepping: 2)
extended cpuid-level: 6
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
font: can't open file: /home/callista/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Not an URL!
File not found: 'frameno.avi'
Not an URL!
success: format: 0  data: 0x0 - 0x1869C0
Not an URL!
Detected AVI file format!
list_end=0xD4
MainAVIHeader.dwFlags: (2320) HAS_INDEX IS_INTERLEAVED TRUST_CKTYPE
list_end=0xD4
list_end=0x184A78
AVI_NI: No Audio stream found...  ->nosound
VIDEO:  [DIVX]  352x288  24bpp  25.00 fps  634.3 kbps (77.4 kbyte/s)
MPEG packet stats: p100: 0  p101: 0  PES: 7  MP3: 102 
Detected audio file
[V] filefmt:65536  fourcc:0x58564944  size:352x288  fps:25.00  ftime:=0.0400
Detected audio codec: [mp3] drv:1 (MPEG layer-2, layer-3)
Selecting Audio Decoder: [mp3lib] MPEG layer-2, layer-3
CPU vendor name: AuthenticAMD  max cpuid level: 1
CPU: Advanced Micro Devices Athlon TB Thunderbird (Type: 6, Stepping: 2)
extended cpuid-level: 6
mp3lib: made decode tables with MMX optimization
init layer2&3 finished, tables done
mp3lib: using 3DNow!Ex optimized decore!
MPEG 1.0, Layer III, 44100 Hz 80 kbit Joint-Stereo, BPF: 261
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0
AUDIO: srate=44100  chans=2  bps=2  sfmt=0x10  ratio: 10000->176400
videocodec: framecopy (352x288 24bpp fourcc=58564944)
audiocodec: framecopy (format=55 chans=2 rate=44100 bits=16 bps=10000 sample=1)
Writing AVI header...
Pos:   0.9s     22f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [0:80]
duplicate 1 frame(s)!!!    
Pos:   1.3s     32f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [193:80]
duplicate 1 frame(s)!!!    
Pos:   1.8s     42f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [231:80]
duplicate 1 frame(s)!!!    
Pos:   2.2s     52f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [241:80]
duplicate 1 frame(s)!!!    
Pos:   2.6s     62f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [248:80]
duplicate 1 frame(s)!!!    
Pos:   3.1s     72f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [253:80]
duplicate 1 frame(s)!!!    
Pos:   3.5s     82f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [257:80]
duplicate 1 frame(s)!!!    
Pos:   4.0s     92f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [260:80]
duplicate 1 frame(s)!!!    
Pos:   4.4s    102f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [266:80]
duplicate 1 frame(s)!!!    
Pos:   4.8s    112f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [271:80]
duplicate 1 frame(s)!!!    
Pos:   5.3s    122f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [279:80]
duplicate 1 frame(s)!!!    
Pos:   5.7s    132f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [288:80]
duplicate 1 frame(s)!!!    
Pos:   6.2s    142f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [303:80]
duplicate 1 frame(s)!!!    
Pos:   6.6s    152f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [318:80]
duplicate 1 frame(s)!!!    
Pos:   7.0s    162f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [335:80]
duplicate 1 frame(s)!!!    
Pos:   7.5s    172f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [357:80]
duplicate 1 frame(s)!!!    
Pos:   7.9s    182f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [373:80]
duplicate 1 frame(s)!!!
Pos:   8.4s    192f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [386:80]
duplicate 1 frame(s)!!!    
Pos:   8.8s    202f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [401:80]
duplicate 1 frame(s)!!!    
Pos:   9.2s    212f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [412:80]
duplicate 1 frame(s)!!!    
Pos:   9.7s    222f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [423:80]
duplicate 1 frame(s)!!!    
Pos:  10.1s    232f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [433:80]
duplicate 1 frame(s)!!!    
Pos:  10.6s    242f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [442:80]
duplicate 1 frame(s)!!!    
Pos:  11.0s    252f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [446:80]
duplicate 1 frame(s)!!!    
Pos:  11.4s    262f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [455:80]
duplicate 1 frame(s)!!!    
Pos:  11.9s    272f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [466:80]
duplicate 1 frame(s)!!!    
Pos:  12.3s    282f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [472:80]
duplicate 1 frame(s)!!!    
Pos:  12.8s    292f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [480:80]
duplicate 1 frame(s)!!!    
Pos:  13.2s    302f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [486:80]
duplicate 1 frame(s)!!!    
Pos:  13.6s    312f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [495:80]
duplicate 1 frame(s)!!!    
Pos:  14.1s    322f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [505:80]
duplicate 1 frame(s)!!!    
Pos:  14.5s    332f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [511:80]
duplicate 1 frame(s)!!!    
Pos:  15.0s    342f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [516:80]
duplicate 1 frame(s)!!!    
Pos:  15.4s    352f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [522:80]
duplicate 1 frame(s)!!!    
Pos:  15.8s    362f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [532:80]
duplicate 1 frame(s)!!!    
Pos:  16.3s    372f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [541:80]
duplicate 1 frame(s)!!!    
Pos:  16.7s    382f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [552:80]
duplicate 1 frame(s)!!!    
Pos:  17.2s    392f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [562:80]
duplicate 1 frame(s)!!!    
Pos:  17.6s    402f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [566:80]
duplicate 1 frame(s)!!!    
Pos:  18.0s    412f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [571:80]
duplicate 1 frame(s)!!!    
Pos:  18.5s    422f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [573:80]
duplicate 1 frame(s)!!!    
Pos:  18.9s    432f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [573:80]
duplicate 1 frame(s)!!!    
Pos:  19.4s    442f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [576:80]
duplicate 1 frame(s)!!!    
Pos:  19.8s    452f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [576:80]
duplicate 1 frame(s)!!!    
Pos:  20.2s    462f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [570:80]
duplicate 1 frame(s)!!!    
Pos:  20.7s    472f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [573:80]
duplicate 1 frame(s)!!!    
Pos:  21.1s    482f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [580:80]
duplicate 1 frame(s)!!!    
Pos:  21.6s    492f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.084 [580:80]
duplicate 1 frame(s)!!!    
Pos:  21.9s    499f ( 0%)   0fps Trem:   0min   0mb  A-V:-0.072 [579:80]
Writing AVI index...
Fixup AVI header...

Video stream:  579.749 kbit/s  (72468 bps)  size: 1585613 bytes  21.880 secs  49                                                                                               9 frames

Audio stream:   80.000 kbit/s  (10000 bps)  size: 225000 bytes  22.500 secs

*** free_stream() called ***




############################################
# Output of the last command (INCLUDING -v):
############################################

MEncoder CVS-020426-06:00-2.95.4 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

Reading /home/callista/.mplayer/codecs.conf: can't open '/home/callista/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/share/mplayer/codecs.conf: 34 audio & 91 video codecs
CPU vendor name: AuthenticAMD  max cpuid level: 1
CPU: Advanced Micro Devices Athlon TB Thunderbird (Type: 6, Stepping: 2)
extended cpuid-level: 6
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
font: can't open file: /home/callista/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Not an URL!
File not found: 'frameno.avi'
Not an URL!
File size is 1599936 bytes
success: format: 0  data: 0x0 - 0x1869C0
Not an URL!
File size is 325272 bytes
Detected AVI file format!
list_end=0xD4
======= AVI Header =======
us/frame: 40000  (fps=25.000)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (2320) HAS_INDEX IS_INTERLEAVED TRUST_CKTYPE
frames  total: 500   initial: 0
streams: 1
Suggested BufferSize: 0
Size:  352 x 288
list_end=0xD4
==> Found video stream: 0
======= STREAM Header =======
Type: vids   FCC:  (0)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 250000/10000 = 25.000
Start: 0   Len: 500
Suggested BufferSize: 7439
Quality 0
Sample size: 0
found 'bih', 40 bytes of 40
======= VIDEO Format ======
  biSize 40
  biWidth 352
  biHeight 288
  biPlanes 1
  biBitCount 24
  biCompression 1482049860='DIVX'
biSizeImage 304128
===========================
Regenerating keyframe table for DIVX 4 video
Broken chunk?  chunksize=1828  (id=JUNK)
list_end=0x184A78
Found movie at 0x80C - 0x184A78
Reading INDEX block, 500 chunks for 500 frames
Broken chunk?  chunksize=0  (id=idx1)
Reading INDEX block, 500 chunks for 500 frames
AVI index offset: 0x808 (movi=0x80C idx0=0x4 idx1=0xC)
Auto-selected AVI video ID = 0
AVI_NI: No Audio stream found...  ->nosound
AVI video length=1585876
VIDEO:  [DIVX]  352x288  24bpp  25.00 fps  634.3 kbps (77.4 kbyte/s)
Checking for YUV4MPEG2
DEMUXER: freeing demuxer at 0x8298260  
ASF_check: not ASF guid!
DEMUXER: freeing demuxer at 0x8298260  
Checking for NuppelVideo
DEMUXER: freeing demuxer at 0x8298260  
Checking for MOV
DEMUXER: freeing demuxer at 0x8298260  
Checking for VIVO
DEMUXER: freeing demuxer at 0x8298260  
Checking for REAL
DEMUXER: freeing demuxer at 0x8298260  
DEMUXER: freeing demuxer at 0x8298260  
DEMUXER: freeing demuxer at 0x8298260  
DEMUXER: freeing demuxer at 0x8298260  
DEMUXER: freeing demuxer at 0x8298260  
DEMUXER: freeing demuxer at 0x8298260  
sync_mpeg_ps: seems to be MP3 stream...
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)  
MPEG packet stats: p100: 0  p101: 0  PES: 7  MP3: 102 
Not MPEG System Stream format... (maybe Transport Stream?)
DEMUXER: freeing demuxer at 0x8298260  
==> Found audio stream: 0
demux_audio: audio data 0x19D - 0x0  
Detected audio file
[V] filefmt:65536  fourcc:0x58564944  size:352x288  fps:25.00  ftime:=0.0400
Detected audio codec: [mp3] drv:1 (MPEG layer-2, layer-3)
Initializing audio codec...
Selecting Audio Decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer
CPU vendor name: AuthenticAMD  max cpuid level: 1
CPU: Advanced Micro Devices Athlon TB Thunderbird (Type: 6, Stepping: 2)
extended cpuid-level: 6
mp3lib: made decode tables with MMX optimization
init layer2&3 finished, tables done
mp3lib: using 3DNow!Ex optimized decore!
MPEG 1.0, Layer III, 44100 Hz 80 kbit Joint-Stereo, BPF: 261
Channels: 2, copyright: No, original: Yes, CRC: No, emphasis: 0
AUDIO: srate=44100  chans=2  bps=2  sfmt=0x10  ratio: 10000->176400
videocodec: framecopy (352x288 24bpp fourcc=58564944)
audiocodec: framecopy (format=55 chans=2 rate=44100 bits=16 bps=10000 sample=1)
Writing AVI header...
ds_fill_buffer: EOF reached (stream: video)     0mb  A-V:-0.072 [579:80] A/Vms 0/0 D/S 48/0 

Writing AVI index...
Fixup AVI header...

Video stream:  579.749 kbit/s  (72468 bps)  size: 1585613 bytes  21.880 secs  499 frames

Audio stream:   80.000 kbit/s  (10000 bps)  size: 225000 bytes  22.500 secs

*** free_stream() called ***






---------------------------------------------------
(some free space for better orientation)

Now here's my system information:

Debian unstable (Woody)


[uname -a:]
Linux callista 2.4.18 #6 Tue Apr 23 00:31:21 CEST 2002 i686 unknown
-rwxr-xr-x    1 root     root      1153816 Mar 24 18:00 /lib/libc-2.2.5.so
lrwxrwxrwx    1 root     root           13 Apr 27 13:55 /lib/libc.so.6 -> libc-2.2.5.so


[X -version]
This is a pre-release version of XFree86, and is not supported in any
way.  Bugs may be reported to XFree86 at XFree86.Org and patches submitted
to fixes at XFree86.Org.  Before reporting bugs in pre-release versions,
please check the latest version in the XFree86 CVS repository
(http://www.XFree86.Org/cvs)

XFree86 Version 4.1.0.1 / X Window System
(protocol Version 11, revision 0, vendor release 6510)
Release Date: 21 December 2001
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/FAQ)
Build Operating System: Linux 2.4.17 i686 [ELF] 
Module Loader present


[gcc -v]
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)


[ld -v]
GNU ld version 2.12.90.0.1 20020307 Debian/GNU Linux


[as -v]
GNU assembler 2.12.90.0.1 20020307 Debian/GNU Linux
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i386-linux'.


[/proc/cpuinfo]
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 6
model		: 4
model name	: AMD Athlon(tm) Processor
stepping	: 2
cpu MHz		: 1200.084
cache size	: 256 KB
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
bogomips	: 2392.06


[graphics card]
Asus V7700 (NVidia GeForce 2 GTS)


[graphics drivers]
nVidia 1.0-2802


[sound card]
Soundblaster something (lspci shows 'Ensoniq 5880 AudioPCI')
with kernel module 'es1371'


----------------------------

I hope I haven't left out import details. 

The result is that while the CBR avi plays fine the ABR avi has
shortened sound. Longer movies result in totally out of synch files.

This problem also occurs when I use a DVD as my source so I assume it's
not limited to MPEG1.

If you need any more informations and/or files please let me know.

Thanks.

-- 
 ==> Ciao, Mosu (Moritz Bunkus)




More information about the MPlayer-users mailing list