[mythtv-users] Some DVB-T mpeg-ts to NTSC DVD scripts some might find usefull

Tom Dexter digitalaudiorock at gmail.com
Fri Aug 8 17:54:48 UTC 2008

As I mentioned in another thread, I've attached two perl scripts I've
been using to create NTSC DVD directories from U.S. broadcast DVB-T
mpeg-ts files.  They both demux with projectx, thus have been pretty
reliable for keeping audio/video sync, even when reception has been
less than ideal.  I figured someone might find them useful, in spite
of that fact that mytharchive now can use projectx.  I like
downloading from mythweb and creating DVDs on my everyday (non-myth)
system, and they've been great for that.

No guarantees of any sort of course.  They definitely have
limitations...I've listed the ones I'm aware of.  I don't claim to be
anything close to an expert on video issues.  All I can say is that
they've been working well in my situation.  I record both SD and HD
DVB-T (mostly HD), and they've been working for both, including 1080i
and 720p HD.

The actual video conversion with mencoder was based on the NTSC DVD
recommendations here:


The -c (--crop) option is especially useful, and is for cropping the
black bars off to make a 4:3 DVD from those shows that are broadcast
in HD resolution with back bars.

Here are the required programs:
makemenu (from the tovid package, only needed for --menu)
growisofs (only needed if --burn is used)

Here are the limitations I'm aware of:
* Intended only to create NTSC DVDs from U.S. DVB-T mpeg-ts files.
* There is NO check made for necessary disk space, and NO attempt to
estimate whether the resulting DVD directory will actually fit on a
DVD-R.  The scripts do however get rid of temp files as soon as they
are no longer needed (unless the options to keep them are used).
* Audio:  If more than one audio stream exists, only the first is
used.  Also, the audio stream is used as-is with no conversion.  In
the case of shows I record, the ac3 streams have always been suitable
for DVD without any conversion.  I'm guessing this may not always be
the case.

There are two programs: ts2dvd and ts2dvdsplit.  The functionality of
the two had enough differences that I didn't attempt to combine them
into one, even though there's a good bit of duplicate code.  ts2dvd is
for creating one DVD from one or more files (on title per file) with
an optional menu (a simple text menu created with makemenu using the
file names without the extension) and an option to burn the DVD.
ts2dvdsplit is for splitting one large file into multiple DVDs at
specified timestamps.

Note that both assume 16:9 unless --43 (or --crop, which implies 4:3)
are specified.

Here's the -h output of each:
ts2dvd -h
Syntax: ts2dvd [options] video_file(s)

Creates (and optionally burns) an NTSC DVD directory structure for one
or more mpeg
transport stream files.  It creates one title per file.  If --menu is
used, the file
names (without the file extension) will be used for the entries in a
simple text menu
created with makemenu (from the tovid package).  Unless --nochapt is
specified, chapter
points will be created at five minute intervals.

        --help, -h: Help.
        --title, -t: Title for menu (not used without --menu)
        --outdir, -o: Output dir for DVD.  Defaults to 'DVD'
        --burn, -b: Burn DVD with growisofs
        --dvd-device, -d: DVD device (for --burn option).  Defaults to /dev/dvd
        --keep, -k: Keep vob files plus xml and menu mpg
        --keepall, -a: Keep all interim files created during conversion
        --crop, -c: Crop to 4:3 (implies --43)
        --nochapt, -n: No chapters
        --menu, -m: Add menus
ts2dvdsplit -h
Syntax: ts2dvdsplit [options] video_file

Creates multiple NTSC DVD directory structures from one mpeg transport
stream file, split
at the time stamps specified with --splits..  Unless --nochapt is
specified, chapter
points will be created at five minute intervals.

        --help, -h: Help.
        --splits, -s: Mandatory.  Split points in the form
h:m:s{.nn}[,h:m:s{.nn}...]. (Don't specify 0:0:0!)
        --outdir, -o: Output dir for DVD.  Defaults to 'DVD'. Appends
_1, _2 etc.
        --keep, -k: Keep vob and xml files
        --keepall, -a: Keep all interim files created during conversion
        --crop, -c: Crop to 4:3 (implies --43)
        --nochapt, -n: No chapters
        --43, -4: 4:3

Various notes:

The files specified, as well as the output directory specified, can be
anywhere you want.  Both will be relative to the current working
directory unless fully qualified paths are used.  The temp files are
all created in the current working directory, and are all prefixed
with tmp_<pid>, where <pid> is the process id of the script.  The
exceptions are the vob file(s), which use the original file name(s)
with a .vob extension.  All the temp files (including the vob files)
are deleted unless the --keep (-k) and/or --keepall (-a) are used.

Feel free to use them and/or hack them up to your hearts content.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts2dvd
Type: application/octet-stream
Size: 7964 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20080808/979edb2a/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts2dvdsplit
Type: application/octet-stream
Size: 7222 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20080808/979edb2a/attachment-0003.obj 

More information about the mythtv-users mailing list