Some line of shell script to convert VCD to mpg

Posted on September 7, 2014, 9:29 pm


Because of my TV does not support the .DAT, and I have hundred of VCD file so the only way to read these files on the other devices is to convert these files to a format that's supported by the target devices. Most of devices can read (.mpg, *.avi etc) so today I share with you how to convert these files on linux, by using “avconv” with some line of code to automate the converting process.

Get the below script and make some change for your own :)

#!/bin/sh
#

source="/home/psph-linux/Desktop/vcd_2_mpg"
destination="/home/psph-linux/Desktop/vcd_2_mpg"
path=$1

for i in `ls $path`
do
 `cd $source/$path`
 `avconv -i $source/$path/$i -target vcd $destination/$path/$i.mpg`
 echo $i "source = ${source}"
done

If you want to convert one by one use the command line below

`avconv -i $source -target vcd $destination`

Blog Archive

  • 2023-May (1)
  • 2023-February (1)
  • 2020-October (1)
  • 2020-May (1)
  • 2020-February (2)
  • 2019-December (5)
  • 2019-November (1)
  • 2018-July (1)
  • 2017-December (1)
  • 2017-November (1)
  • 2017-June (1)
  • 2016-September (5)
  • 2016-August (3)
  • 2016-June (1)
  • 2015-September (1)
  • 2015-May (1)
  • 2015-February (2)
  • 2014-December (1)
  • 2014-November (2)
  • 2014-September (3)
  • 2014-August (1)
  • 2014-June (1)
  • 2014-May (1)
  • 2014-March (1)
  • 2013-December (2)
  • 2013-October (2)
  • 2013-July (1)
  • 2013-June (3)
  • 2013-May (4)
  • 2013-March (1)
  • 2012-December (2)
  • 2012-November (1)
  • 2012-October (1)
  • 2012-September (2)
  • 2012-August (2)
  • 2012-July (2)
  • 2012-June (1)
  • 2012-May (2)
  • 2012-March (2)
  • 2012-February (2)
  • 2012-January (5)
  • 2011-December (2)
  • 2011-November (4)
  • 2011-October (5)
  • 2011-September (2)
  • 2011-August (1)
  • 2011-June (2)
  • 2011-May (1)
  • 2011-April (9)
  • 2011-March (3)
  • 2011-February (12)
  • 2011-January (16)
  • 2010-December (17)
  • 2010-November (6)
  • 2010-October (10)
  • 2010-September (8)