Convert vcd dat file to mpeg on ubuntu

By | September 28, 2011

VCDs that are played on vcd players often contain the video in dat format. The dat format is internally mpeg only but has some additional header information attached. So the mpeg portion has to be ripped off to get the mpeg format. Once converted to mpeg format, it can be processed inside any video editor.

On ubuntu there are many tools like vcdimager, mencoder etc that can do the job. Lets try them

Vcdimager

To record or rip a vcd on ubuntu :

1. Install vcdimage by running the command "sudo apt-get install vcdimager" in the terminal.
2. Insert vcd into drive.
3. Run command "vcdxrip" in the terminal.

It will create the avseq**.mpg files in your home folder.
Now the mpg files can be used with ffmpeg to create other formats.

Mencoder

Put the vcd inside the driver and run the mplayer command as follows

mplayer vcd://1

It will show track information of the vcd

desktop:~$ mplayer vcd://1
MPlayer 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing vcd://1.
track 01:  adr=1  ctrl=4  format=2  00:02:00  mode: 1
track 02:  adr=1  ctrl=4  format=2  00:18:68  mode: 1
track 03:  adr=1  ctrl=4  format=2  01:05:02  mode: 1
track 04:  adr=1  ctrl=4  format=2  01:18:22  mode: 1
track 05:  adr=1  ctrl=4  format=2  44:20:67  mode: 1


Exiting... (End of file)

Now it is showing that the vcd has 5 tracks. So we can extract each track individually using mencoder as follows

desktop:~$ mencoder vcd://4 -o happy.mpeg -oac copy -ovc copy
MEncoder 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team

WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
track 01:  adr=1  ctrl=4  format=2  00:02:00  mode: 1
track 02:  adr=1  ctrl=4  format=2  00:18:68  mode: 1
track 03:  adr=1  ctrl=4  format=2  01:05:02  mode: 1
track 04:  adr=1  ctrl=4  format=2  01:18:22  mode: 1
track 05:  adr=1  ctrl=4  format=2  44:20:67  mode: 1
success: format: 2  data: 0xCBF960 - 0x1b9f9c74
MPEG-PS file format detected.
VIDEO:  MPEG1  352x288  (aspect 8)  25.000 fps  1150.0 kbps (143.8 kbyte/s)
[V] filefmt:2  fourcc:0x10000001  size:352x288  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 224.0 kbit/15.87% (ratio: 28000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
videocodec: framecopy (352x288 24bpp fourcc=10000001)
audiocodec: framecopy (format=50 chans=2 rate=44100 bits=16 B/s=28000 sample-1)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos:   0.9s     22f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.084 [0:224]
Skipping frame!
Pos:   2.3s     59f ( 0%)  0.00fps Trem:   5min 327mb  A-V:0.080 [1184:224]
Skipping frame!
Writing index...25f (100%) 119.07fps Trem:   0min 423mb  A-V:0.037 [1150:224]
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream: 1150.062 kbit/s  (143757 B/s)  size: 371027110 bytes  2580.920 secs  64525 frames

Audio stream:  224.000 kbit/s  (28000 B/s)  size: 72266606 bytes  2580.950 secs

Now it should create happy.mpeg in the home directory which is the selected track in mpeg video format.

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

One Comment

Convert vcd dat file to mpeg on ubuntu
  1. Vincent Then

    Thank you very much. I used the vcdimager suggestion. Solved one of my problems of coverting from Win7 to Linux Mint.

Leave a Reply

Your email address will not be published. Required fields are marked *