Convert MPEG2 transport stream to DVD

My method for transforming an MPEG2 transport stream into a DVD ISO:

ffmpeg -i capture.mpg -vn -acodec copy -f mp2 capture.mpg.mp2
ffmpeg -i capture.mpg -an -vcodec copy -f mpeg2video capture.mpg.m2v
mplex -f 8 -V -o capture.mpg.vob capture.mpg.m2v capture.mpg.mp2
rm capture.mpg.m2v capture.mpg.mp2
dvdauthor -o capture.mpg.dvd -t capture.mpg.vob
dvdauthor -o capture.mpg.dvd -T
rm capture.mpg.vob
mkisofs -dvd-video -v -V dvd -o capture.mpg.iso capture.mpg.dvd
rm -r capture.mpg.dvd

It seems the only reliable way is to demultiplex and then multiplex the video/audio with mplex. dvdauthor can’t seem to understand ffmpeg’s own ‘dvd’ MPEG output. If your end result has video/audio out of sync you can figure out what the sync delay should have been with mplayer/vlc and then use that value with mplex -O

This method requires ffmpeg, mjpegtools, dvdauthor and cdrtools from macports.