[MPlayer-dev-eng] avi2mpg script using mplayer/mencoder

Svante Signell svante.signell at telia.com
Fri Feb 13 19:24:48 CET 2004


Hello,

I'm currently writing a script for conversion of files with an avi
container format to files with an mpg container format. 

The script is a rewrite of the divx2svcd script, avoiding the problem to
patch mencoder for an .avi container intermediate file. Instead I try to
use an .mpg container intermediate file. Hopefully, it will be a pure
.sh file. (No perl script). Doing this change some problems and
questions arise:

1. Writing directly to an .mpg instead of an .avi file results mostly in
the following errors: 
(The example below is an divx file with 6-channel sound with intention
to be burned as a chapter in a DVD image, using e.g. dvdauthor.)

mencoder -noskip -ofps 24000/1001 -oac lavc test1.avi -ovc lavc
-lavcopts
vcodec=mpeg2video:vbitrate=1600:acodec=ac3:abitrate=448:keyint=250:aspect=4/3:vpsize=1000:vrc_maxrate=9352:vrc_buf_size=1853 -of mpeg -o test12.mpg -srate 48000 -channels 6

libavcodec/ratecontrol.c:
[mpeg2video @ 0x85790e0]rc buffer underflow
libmpdemux/muxer_mpeg.c
Examples of outputs:
Error in stream: PTS to SCR delay 8971 is too little!
or Error in stream: PTS earlier than SCR!
or Error in stream: PTS to SCR delay 0 is too little!
or Warning: DTS to SCR delay is too small
or Unknown block type, possibly non-MPEG stream!

2. The intermediate file with 6 channel sound audio is not playable.
(However, the 2 channel files are...)

#> mplayer test12.mpg
MPEG-PS file format detected.
VIDEO:  MPEG2  480x576  (aspect 2)  23.976 fps  9352.0 kbps (1169.0
kbyte/s)
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
Too many video packets in the buffer: (4096 in 8301091 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
 
Too many video packets in the buffer: (4096 in 8301091 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
 
Too many video packets in the buffer: (4096 in 8301091 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
Unknown/missing audio format -> no sound
Opening audio decoder: [libmad] libmad mpeg audio decoder
Too many video packets in the buffer: (4096 in 8301091 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
Cannot sync MAD frame
ADecoder init failed :(
ADecoder init failed :(
Cannot find codec for audio format 0x50.
Read DOCS/HTML/en/codecs.html!

4. However, the final file is playable:
#> mplayer -dumpvideo -dumpfile test1.m2v test12.mpg
#> mplayer -dumpaudio -dumpfile test1.mp2 test12.mpg
#> tcmplex -i test1m2v -p test1.mp2 -o test1.mpg" -m d -F template
AC3: 5.1 (3f+2r+lfe)  48000 Hz  448.0 kbit/s
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 56000->192000 (448.0 kbit)
Selected audio codec: [a52] afm:liba52 (AC3-liba52)

5. Which lavc options are the best to use?
6.  Do you recommend a 2-pass encoding?
7. AOB

Thanks,
Svante





More information about the MPlayer-dev-eng mailing list