[MPlayer-users] Can't convert NTSC videos into raw-DV - NO-SPAM

Bradley Rosser b_rosser at yahoo.com
Sun Jun 29 02:55:47 CEST 2003


Hi.  I'm trying to play various videos (DivX, MPEG, etc) on my PAL
television by

o   using mencoder to convert the files into type-2 DV AVI files;

o   using libdv's 'dvavi' or transcode to convert the AVI files
      into 'raw dv' files;

o   using libdv's 'dvconnect' to transfer the raw DV down my
      IEEE 1394 (firewire) link to my PAL camcorder and, through it,
      into my PAL VCR or TV.

For testing I have two source video files.  With one the above
process works perfectly.  With the other it fails badly on the
second step (both 'dvavi' and transcode produce flawed AVI files, as
I'll describe below).  Yet, using mencoder in the first step, I
produce type-2 AVI files which look to be identical in their
parameters, as reported by 'mplayer -identify' or by transcode's
'tcprobe -i'.

I'd appreciate your looking over the details below and telling me
what I'm doing wrong, or what options exist that might circumvent my
problem.

I'm running mplayer 0.90, transcode 0.6.6 and libdv 0.99 with
the libdv-0.99-transcode-patch under Linux 2.4.16.

The first video - 1.avi - gives these details with 'mplayer
-identify' and 'tcprobe -i':

      ID_FILENAME=1.avi
      ID_VIDEO_FORMAT=DIV3
      ID_VIDEO_BITRATE=894104
      ID_VIDEO_WIDTH=464
      ID_VIDEO_HEIGHT=352
      ID_VIDEO_FPS=25.000
      ID_VIDEO_ASPECT=0.0000
      ID_AUDIO_CODEC=mp3
      ID_AUDIO_FORMAT=85
      ID_AUDIO_BITRATE=96000
      ID_AUDIO_RATE=48000
      ID_AUDIO_NCH=2
      ID_LENGTH=2615

      [tcprobe] RIFF data, AVI video
      [avilib] V: 25.000 fps, codec=DIV3, frames=65378, width=464, 
height=352
      [avilib] A: 48000 Hz, format=0x55, bits=0, channels=2, bitrate=96 
kbps,
      [avilib]    65362 chunks, 31379072 bytes
      [tcprobe] summary for 1.avi, (*) = not default, 0 = not detected
      import frame size: -g 464x352 [720x576] (*)
           frame rate: -f 25.000 [25.000] frc=3
          audio track: -a 0 [0] -e 48000,0,2 [48000,16,2] -n 0x55
[0x2000] (*)
               bitrate=96 kbps
               length: 65378 frames, frame_time=40 msec,
      duration=0:43:35.120

I've been told I should use an audio rate of 48000 for best
transfer to the camcorder, and I believe the frame rate of 25fps is
correct for PAL, so I ran the following mencoder command to create
a type-2 AVI file:

      mencoder -o 1m.avi -vop scale=720:576 -oac pcm -ovc libdv -endpos
00:01:00 1.avi

The 1m.avi file thus produced showed these characteristics:

      ID_FILENAME=1m.avi
      ID_VIDEO_FORMAT=dvsd
      ID_VIDEO_BITRATE=28800000
      ID_VIDEO_WIDTH=720
      ID_VIDEO_HEIGHT=576
      ID_VIDEO_FPS=25.000
      ID_VIDEO_ASPECT=0.0000
      ID_AUDIO_CODEC=pcm
      ID_AUDIO_FORMAT=1
      ID_AUDIO_BITRATE=1536000
      ID_AUDIO_RATE=48000
      ID_AUDIO_NCH=2
      ID_LENGTH=59

      [tcprobe] RIFF data, AVI video
      [avilib] V: 25.000 fps, codec=dvsd, frames=1498, width=720, height=576
      [avilib] A: 48000 Hz, format=0x01, bits=16, channels=2,
bitrate=1536 kbps,
      [avilib]    121 chunks, 11616000 bytes
      [tcprobe] summary for 1m.avi, (*) = not default, 0 = not detected
      import frame size: -g 720x576 [720x576]
           frame rate: -f 25.000 [25.000] frc=3
          audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x1
[0x2000] (*)
                           bitrate=1536 kbps
               length: 1498 frames, frame_time=40 msec, duration=0:00:59.920

And it played perfectly with mplayer - no audio distortion, good sync.

I ran libdv's 'dvavi' to produce the final raw-dv file:

      #libdv-0.99/encodedv/dvavi 1m.avi > 1.dv
      Found audio channel: format: ft=1
      Opening audio source with:
      Channels: 2
      Frequency: 48000
      Bytes per second: 192000
      Byte alignment: 4
      Bits per sample: 16

which had these characteristics:

      ID_FILENAME=1.dv
      ID_VIDEO_FORMAT=DVSD
      ID_VIDEO_BITRATE=0
      ID_VIDEO_WIDTH=720
      ID_VIDEO_HEIGHT=576
      ID_VIDEO_FPS=25.000
      ID_VIDEO_ASPECT=0.0000
      ID_AUDIO_CODEC=libdv
      ID_AUDIO_FORMAT=RADV
      ID_AUDIO_BITRATE=28800000
      ID_AUDIO_RATE=48000
      ID_AUDIO_NCH=2
      ID_LENGTH=0

      [tcprobe] Digital Video (PAL)
      [tcprobe] summary for 1.dv, (*) = not default, 0 = not detected
      import frame size: -g 720x576 [720x576]
           aspect ratio: 4:3 (*)
           frame rate: -f 25.000 [25.000] frc=3
          audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x1
[0x2000] (*)
                       bitrate=1536 kbps

and mplayer could play this file, also, perfectly.  I then
downloaded the file to the camcorder, and thence to my VCR,
using 'dvconnect -s', with absolutely no problems.

I'm at a loss as to why I can't reproduce this success with my
second test video sample.  It's quite different from the first,
in that it is an NTSC-format file, I gather - 23.97fps, audio
rate 44100 HZ - but I'd hoped that my mencoder step would obviate
any problems.

The second source file, 2.avi, showed these characteristics with
mplayer and transcode:

      ID_FILENAME=2.avi
      ID_VIDEO_FORMAT=DIV3
      ID_VIDEO_BITRATE=919240
      ID_VIDEO_WIDTH=512
      ID_VIDEO_HEIGHT=288
      ID_VIDEO_FPS=23.976
      ID_VIDEO_ASPECT=0.0000
      ID_AUDIO_CODEC=mp3
      ID_AUDIO_FORMAT=85
      ID_AUDIO_BITRATE=128000
      ID_AUDIO_RATE=44100
      ID_AUDIO_NCH=2
      ID_LENGTH=2650

      [tcprobe] RIFF data, AVI video
      [avilib] V: 23.976 fps, codec=DIV3, frames=63543, width=512, 
height=288
      [avilib] A: 44100 Hz, format=0x55, bits=0, channels=2, bitrate=127
kbps,
      [avilib]    63532 chunks, 42306735 bytes
      [tcprobe] summary for 2.avi, (*) = not default, 0 = not detected
      import frame size: -g 512x288 [720x576] (*)
           frame rate: -f 23.976 [25.000] frc=1 (*)
          audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x55
[0x2000] (*)
                               bitrate=127 kbps
               length: 63543 frames, frame_time=41 msec, 
duration=0:44:10.251

Different frame rate, different audio rate, different aspect ratio
(this was a 'widescreen' video?) but I thought I could eliminate
these differences with this mencoder command:

    mencoder -o 2m.avi -srate 48000 -ofps 25 -vop expand=720:576 -xy 1.4
-zoom -endpos 00:01:00 -oac pcm -ovc libdv 2.avi

using the -vop 'expand' option widen the picture to fill up to the
width of the PAL resolution while retaining the aspect ratio.

This seemed to work; the characteristics of the resultant 2m.avi file
were:

      ID_FILENAME=2m.avi
      ID_VIDEO_FORMAT=dvsd
      ID_VIDEO_BITRATE=27647224
      ID_VIDEO_WIDTH=720
      ID_VIDEO_HEIGHT=576
      ID_VIDEO_FPS=25.000
      ID_VIDEO_ASPECT=0.0000
      ID_AUDIO_CODEC=pcm
      ID_AUDIO_FORMAT=1
      ID_AUDIO_BITRATE=1536000
      ID_AUDIO_RATE=48000
      ID_AUDIO_NCH=2
      ID_LENGTH=59

      [tcprobe] RIFF data, AVI video
      [avilib] V: 25.000 fps, codec=dvsd, frames=1499, width=720, height=576
      [avilib] A: 48000 Hz, format=0x01, bits=16, channels=2,
bitrate=1536 kbps,
      [avilib]    121 chunks, 11616000 bytes
      [tcprobe] summary for 2m.avi, (*) = not default, 0 = not detected
      import frame size: -g 720x576 [720x576]
           frame rate: -f 25.000 [25.000] frc=3
          audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x1
[0x2000] (*)
                           bitrate=1536 kbps
               length: 1499 frames, frame_time=40 msec, duration=0:00:59.960

i.e. 25fps, audio rate 48000, and the file played perfectly with mplayer.

I converted it into 'raw' dv with dvavi:

      #libdv-0.99/encodedv/dvavi 2m.avi > 2.dv
      Found audio channel: format: ft=1
      Opening audio source with:
      Channels: 2
      Frequency: 48000
      Bytes per second: 192000
      Byte alignment: 4
      Bits per sample: 16
      AVI: Short read!

And the resultant DV file had these characteristics:

      ID_FILENAME=2.dv
      ID_VIDEO_FORMAT=DVSD
      ID_VIDEO_BITRATE=0
      ID_VIDEO_WIDTH=720
      ID_VIDEO_HEIGHT=576
      ID_VIDEO_FPS=25.000
      ID_VIDEO_ASPECT=0.0000
      ID_AUDIO_CODEC=libdv
      ID_AUDIO_FORMAT=RADV
      ID_AUDIO_BITRATE=28800000
      ID_AUDIO_RATE=48000
      ID_AUDIO_NCH=2
      ID_LENGTH=0

      [tcprobe] Digital Video (PAL)
      [tcprobe] summary for 2.dv, (*) = not default, 0 = not detected
      import frame size: -g 720x576 [720x576]
           aspect ratio: 4:3 (*)
           frame rate: -f 25.000 [25.000] frc=3
          audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x1
[0x2000] (*)
                                   bitrate=1536 kbps

which looked to me to be identical to the 2m.avi file going
in.

However there's something badly wrong with the DV file;
when I play it with mplayer the video shudders and moves
up about a quarter-screen every couple of seconds, plus
the sound changes 'tone' (sounds normal, then goes
high-pitched and 'metallic') at the same time.  Libdv's
'playdv' plays the picture in the middle of the window, but
with a bad 'jitter' every couple of seconds.

When I use transcode to create the 'raw DV' file from the
type-2 AVI, rather than 'dvavi', using the command:

      transcode -i 2m.avi -o 2trans.dv -y dvraw,dvraw

playing the created file 2trans.dv shows the picture correctly
but the sound lags badly behind.

Any help would be very welcome.  I've tried to think things
out and use the options in the various man pages, but can't
see what else there is to do - nor what could be causing
this problem.  But if this is just a case of converting
NTSC to PAL - if it is - it must be something that other
people have come across and successfully achieved?

Thanks,


Brad
b_rosser at yahoo.com





More information about the MPlayer-users mailing list