[MPlayer-users] How to properly convert mp3 to dv?

Josef Wolf jw at raven.inka.de
Tue Apr 20 08:37:56 CEST 2010


Hello,

I am trying to import an mp3 file into a kino (http://www.kinodv.org/)
project. This program works only on dv files and converts everything
into this format what it imports.

When I try to do direct import, kino tries to the mp3 into a dv, I get this
error message from mencoder:

  Audio only file format detected.
  Video stream is mandatory!

I don't really need video here, I just want to add some background audio
for this existing wedding video (which is already imported in kino).

So to make mencoder happy, I tried to use images2mpg to add a photo to the
stream like this:

 images2mpg -f DVD -d 300 -w 01-track_1.mp3 -o 01.avi -i fotos/IMG_3840.JPG.

this runs following commands in the background:

  \_ /bin/bash /usr/local/bin/images2mpg -f DVD -d 300 -w 01.mp3 -o 01.avi -i fotos/IMG_3840.JPG
      \_ /bin/bash /usr/local/bin/images2mpg -f DVD -d 300 -w 01.mp3 -o 01.avi -i fotos/IMG_3840.JPG
      |   \_ convert -depth 8 ppm:1271742253.tmp.pnm -
      |   \_ cat
      \_ ppmtoy4m -v 0 -n 7500 -F 25:1 -S 420mpeg2
      \_ yuvscaler -v 0 -n p -O SIZE_720x576
      \_ mpeg2enc -v 0 -n p -b 8000 -V 230 -f 8 -o 1271742253.tmp.m2v

The resulting file plays well in mplayer. So again, I tried to import.

This time, the import succeeds (see below for the output), but the audio is
bad. Every now and then, there are some noise and whatever.

Any ideas what I am doing wrong? How can I convert mp3 to dv and keep the
audio quality?

Here is mencoder's output:

MEncoder SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x2d8a800
MEncoder SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x2d8a800
MPEG-PS file format detected.
VIDEO:  MPEG2  720x576  (aspect 2)  25.000 fps  8000.0 kbps (1000.0 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x576  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Ignoring video stream!
videocodec: framecopy (720x576 24bpp fourcc=10000002)
FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5+svn20090706-2ubuntu2.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable
-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhoo
k --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --extra-cflags=-I/build/buildd/ffmpeg-0.5+svn20090706/debian/include
--enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Apr  8 2010 20:05:00, gcc: 4.4.1
MPEG-PS file format detected.00fps Trem:   0min  17mb  A-V:0.000 [0:0]
VIDEO:  MPEG2  720x576  (aspect 2)  25.000 fps  8000.0 kbps (1000.0 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x576  fps:25.000  ftime:=0.0400
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: [format fmt=I420]
Opening video filter: [expand w=768 h=576]
Expand: 768 x 576, -1 ; -1, osd: 0, aspect: 0.000000, round: 1
Opening video filter: [scale]
Opening video filter: [dsize=768:576:0]
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred colorspace: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Unsupported PixelFormat -1
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
==========================================================================
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar I420 as output csp (no 1)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 1 -> 1
SwScaler: reducing / aligning filtersize 1 -> 1
[swscaler @ 0xa35240]BICUBIC scaler, from yuv420p to yuv420p using MMX2
[swscaler @ 0xa35240]using 4-tap MMX scaler for horizontal luminance scaling
[swscaler @ 0xa35240]using 4-tap MMX scaler for horizontal chrominance scaling
[swscaler @ 0xa35240]using 1-tap MMX "scaler" for vertical scaling (YV12 like)
[swscaler @ 0xa35240]720x576 -> 768x576
Input #0, s16le, from '/mnt/homevideo/fotos-avi/torte.avi.pcm':0 [0:0]
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Input #1, rawvideo, from '/mnt/homevideo/fotos-avi/torte.avi.i420'::0]
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #1.0: Video: rawvideo, yuv420p, 768x576, 25 tbr, 25 tbn, 25 tbc
Output #0, dv, to '/mnt/homevideo/fotos-avi/torte.avi.dv':
    Stream #0.0: Video: dvvideo, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #1.0 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
Pos:   0.9s     22f ( 0%)  0.00fps Trem:   0min  36mb  A-V:0.083 [0:1536]:0]
Skipping frame!
Pos:   2.4s     61f ( 1%)  0.00fps Trem:   1min  41mb  A-V:0.080 [1187:1536]
Skipping frame!
Pos: 203.5s   5089f (68%) 59.45fps Trem:   0min 4672mb  A-V:0.000 [132710:0]


More information about the MPlayer-users mailing list