Convert vcd dat file to mpeg on ubuntu

4 Flares Filament.io 4 Flares ×

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.

Last Updated On : 28th September 2011

Subscribe to get updates delivered to your inbox

About Silver Moon

Php developer, blogger and Linux enthusiast. He can be reached at m00n.silv3r@gmail.com. Or find him on Google+

4 Flares Twitter 0 Facebook 4 Google+ 0 LinkedIn 0 StumbleUpon 0 Filament.io 4 Flares ×