[mythtv-users] Lossless remux ISO to MKV for .22 video storage groups

Joel Means means.joel at gmail.com
Wed Oct 21 21:53:17 UTC 2009


On Wed, Oct 21, 2009 at 3:36 PM, Joel Means <means.joel at gmail.com> wrote:
> On Wed, Oct 21, 2009 at 3:11 PM, Johnny <jarpublic at gmail.com> wrote:
>>
>> This is great. I didn't even know that had a command line interface.
>> One question, the ISOs I have converted create several MKV files, one
>> for each title on the DVD (extras, intros, etc). Was this a problem
>> for you? Was title00.mkv always the main movie, or did you have to go
>> back and do some manual clean up?
>
> Oh, yeah.  When I ripped my DVD's to iso's, I only ripped the main
> movie, so mine only had one title.  You could probably add something
> to the script to find the longest title and move only that one to
> ${DIRNAME}/${OUTFILE}.  It seems like I have used some program that
> will find you the longest title in a DVD iso, but I can't recall off
> the top of my head what that was.
> Joel
>

Try this out on one with multiple titles.  I don't have one around to
test it for sure, but it should grab the longest track.
Joel

-------------------------------------------------------------------------------------------
#!/bin/bash

if [ "${1}" = "" ]; then
   echo "You must provide an iso file as an input file"
   exit 1
fi

if [ ! "`echo ${1} | grep -o ".iso"`" = ".iso" ]; then
   echo "You must provide an iso file as an input file"
   exit 1
fi

INFILE="${1}"
MOVIE=`basename "${INFILE}" .iso`
DIRNAME="${PWD}/`dirname \"${INFILE}\"`"
OUTFILE="${MOVIE}.mkv"
LONG_TRACK=`lsdvd -q ID4.iso | grep Longest | cut -d":" -f2 | sed 's/ //'`
LONG_TRACK=$(( ${LONG_TRACK} - 1 ))
if [ ${LONG_TRACK} -lt 10 ]; then
  LONG_TRACK=`echo ${LONG_TRACK} | sed 's/^/0/'`
fi
echo "converting ${INFILE} to ${OUTFILE}"

/usr/bin/makemkvcon mkv iso:"${DIRNAME}/${MOVIE}.iso" 0 "${DIRNAME}" > /dev/null
mv "${DIRNAME}"/title${LONG_TRACK}.mkv "${DIRNAME}/${OUTFILE}"


More information about the mythtv-users mailing list