burn a recorded mpeg-ts file to dvd in linux

Our old dreambox 7000 records movies in the mpeg-ts format (file extension:.ts). I wrote a Makefile to burn recorded files to dvd.

To produce a dvd out of a mpeg-ts file we need:

In Ubuntu you can install them by typing:

sudo apt-get install project-x dvdauthor mjpegtools growisofs

Dvdauthor demands to know the video format, so type

echo "PAL" > ~/.config/video_format

(replace PAL with NTSC if living in the USA or another NTSC-country)

Now you should have everything you need. Copy the makefile to the same folder you downloaded the ts-file(assuming, for simplicity, it’s named sample.ts) to. Now, to just burn it to dvd, one title, no menu, conserving all audio tracks, do

make sample.burn

The advantage of using a Makefile is that you can do each step manually. You can for example cut and demux the files with project-x by hand, or just produce the .mpg files, then use dvdstyler to create a complex menu and burn the dvd.

all:$(patsubst %.ts,%.dvd,$(wildcard *.ts))

MPLEX=mplex
MPLEXFLAGS=-f 8
DVDAUTHOR=dvdauthor
PROJECTX=projectx

DREAMBOX_BASEURL=root:dreambox@192.168.178.22/hdd/movie
.PRECIOUS: %.m2v %.ts %.mpg %.dvd

%.ts:
	wget ftp://$(DREAMBOX_BASEURL)/$@

%_proc.m2v: %.ts
	$(PROJECTX) -out . -name $*_proc $<

%.mpg: %_proc.m2v
	-rm $*_proc*.txt
	$(MPLEX) $(MPLEXFLAGS) -o $@ $*_proc*
	-rm $*_proc*

%.xml: %.mpg
	echo "<dvdauthor><vmgm /><titleset><titles><pgc><vob file=\"$<\" /></pgc></titles></titleset></dvdauthor>" > $*.xml

%.dvd: %.xml
	$(DVDAUTHOR) -x $*.xml -o $@ 

%.burn: %.dvd
	growisofs -Z /dev/dvd -dvd-video -V $* $</

filetype Makefile-movies (623 B, 2011-11-29)

This entry was posted in Computers and tagged , , . Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">