Convert Video

Convert TS (from Satellite Box) to MPG

Free-To-Air Satellite Receivers often come now with recording capability via a USB port. A Memory stick, or external hard-drive can be used as the destination for the recordings.

These recordings will be in TS format, which is fine for playing back on the Satellite Box, and can be played in programs such as VLC Media Player, but what if you want to share the file in a more common format?…or burn it to DVD? Here is one way to convert the file into an MPG which can be further converted into DVD VOB files with programs such as DeVeDe.

  1. Open to load the TS file. AviDemux will ask if you want to index the file…choose YES.
  2. Choose the Auto menu and pick DVD. Change “Source aspect ratio:” to 16:9.
  3. I also found it necessary to shift the audio, otherwise it was not in time with the video. To do this, make sure the checkbox by the word “Shift” under the Audio heading (at the left of the program window) is checked and enter the value of -700 (that’s what worked best for me…you’ll have to experiment).
  4. Click “Save” on the button bar, and give the file a name ending with “.mpg”.

If the video is an hour long, this could take a while, especially on a slower computer. The MPG can then be converted to DVD disc in a program such as DeVeDe.

By practic on August 3, 2011 | | 1 comment

Convert AVI to DVD via Commandline

Firstly, you’ll need to download a few things:

mencoder (sudo apt-get install mencoder)
ffmpeg (sudo apt-get install ffmpeg)
dvdauthor (sudo apt-get install dvdauthor)

Now make a new file and paste this in:

#!/bin/bash
## Movie - AVI to DVD Script
## Created by Paul (realtimeedit.com/blog/), 7th October 2007.
echo "Directory?"
read output_file_directory
echo "AVI file name for conversion?"
read input_file_one

##START
cat $input_file_one > dvd.avi
mencoder -o finalmovie.avi -noidx -oac copy -ovc copy dvd.avi
ffmpeg -i finalmovie.avi -y -target ntsc-dvd -sameq -aspect 16:9 finalmovie.mpg
dvdauthor --title -o dvd -f finalmovie.mpg
dvdauthor -o dvd -T
mkisofs -dvd-video -o dvd.iso dvd/
echo "Now burn dvd.iso to a DVD"
##END

Save that as dvd_script in the same folder as the AVI. Now open Terminal and use this command to go to the folder you just saved dvd_script in:

cd /path/of/movie/folder/

Then we can run the script. Type this in Terminal:

./dvd_script

It should say “Directory?”, then enter where the file is, for example, “/home/user/movie/”. Then press Enter and put in the file name, for example, “themovie.avi” — now let it go. It should take some time, unless you’re on a computer from the future.

After that you can put “dvd.iso” onto a DVD with the program of your choice.

By practic on | | A comment?

Convert RM to AVI with mencoder

First make sure mencoder is installed. The syntax is very simple. This command line encodes the sample.rm file with the libav codec (the best divx codec for both performance and quality) and the soundtrack with mp3lame:

mencoder -ovc lavc sample.rm -oac mp3lame -o sample.avi
By practic on August 1, 2011 | | 1 comment

Convert Video to different format

For converting just one format to another, you can use ffmpeg:

ffmpeg -i myfirstvideo.mpeg myoutputvideo.avi

The program has its own defaults in terms of compression, etc., but there are extra flags that can be added to change resolution, sound quality, and so forth. Frequently I use the -sameq for matching quality of original to conversion.

This script loops through a whole directory of mpg and converts them to avi (at 1000K quality):

for f in *.mpg; do ffmpeg -i "$f" -vcodec libxvid -acodec libmp3lame -b 1000000 "${f%.mpg}.avi"; done

Note: This is case sensitive! *.mpg is not the same as *.MPG

By practic on | | A comment?