[mythtv-users] DVD Burning

Tom Kelly tv at ancilla.ca
Fri Feb 10 17:39:07 UTC 2006


I've hacked mpeg2cut (that comes with nuvexport) to work
with avidemux2 2.1.0.  The newest version of avidemux2 uses
a different "workbench" file format, and has some different
command line options.

Below is the section of my mpeg2cut that builds the .cut file
and the calls to avidemux2.  I'm not posting the whole thing
because I've made a bunch of other changes to mpeg2cut that are
probably peculiar to me.  I've commented out (rather than removed)
the original avidemux2 invocations so you can see what the changes are.

Tom

#if [ ! -f ${FILENAME}.idx ]
#then
#    echo Indexing the file with avidemux2
#    nice -n 19 avidemux2 --index-mpeg ${FILENAME} ${OUTPUTBASE}.idx C0 \
##        --audio-codec MP2 --quit  2> /dev/null > /dev/null
#   nice -n 19 avidemux2 --autoindex --audio-codec MP2 --load ${OUTPUTBASE}.nuv  --quit  #2> /dev/null > /dev/null
#fi

cat > "${OUTPUTBASE}".cut << EOF
//AD  <- Needed to identify//
//--automatically built--
//--Project: test

var app = new Avidemux();

//** Video **
// 01 videos source
app.load("${OUTPUTBASE}.nuv.idx");
app.clearSegments();
EOF

cat /dev/null > "${OUTPUTBASE}".cut2

count=0
for i in ${CUTLIST}
do
    START=`echo $i | cut -d '-' -f 1`
    END=`echo $i | cut -d '-' -f 2`

    if [ .${START}. = .. ]
    then
        START=0
    fi

    if [ ${START} -ge ${LASTFRAME} ]
    then
        continue
    fi

    if [ .${END}. = .. ]
    then
        END=${LASTFRAME}
    fi
    LENGTH=$((${END} - ${START} + 1))

    cat >> "${OUTPUTBASE}".cut2 << EOF
app.addSegment(0, ${START}, ${LENGTH});
EOF
    count=$((${count} + 1))
done
#echo ${count} segments >> "${OUTPUTBASE}".cut

cat "${OUTPUTBASE}".cut2 >> "${OUTPUTBASE}".cut
cat >> "${OUTPUTBASE}".cut << EOF

app.rebuildIndex();

//** Postproc **
app.video.setPostProc(3,3,0);

//** Filters **

//** Video Codec conf **
app.video.codec("Copy","CQ=4","0 ");

//** Audio **
app.audio.reset();
app.audio.codec("copy",128);
app.audio.normalize=false;
app.audio.delay=0;
app.setContainer("ES");
setSuccess(1);
EOF

echo Cutting out commercials and edits with avidemux2
#nice -n 19 avidemux2 --load-workbench "${OUTPUTBASE}".cut \
#    --audio-codec MP2 --save-raw-video "${OUTPUTBASE}".m2v \
#    --save-raw-audio "${OUTPUTBASE}".mp2 --quit  #2> /dev/null > /dev/null
nice -n 19 avidemux2 --autoindex --audio-codec MP2 --load "${OUTPUTBASE}".nuv  \
    --run "${OUTPUTBASE}".cut --save-raw-video "${OUTPUTBASE}".m2v \
    --save-raw-audio "${OUTPUTBASE}".mp2 --quit  #2> /dev/null > /dev/null


James Pifer wrote:
>>Oh yea, duh. I normally use avidemux2 to create a raw video file "vid" and a
>>soundtrack "aud". You could do the same thing by something like this:
>>
>>mpeg2desc -a0 < $source_file_name > aud 
>>mpeg2desc -v0 < $source_file_name > vid 
>>
>>but I prefer to use avidemux because I can trim and cut commercials before
>>writing the files. I find it easier and faster than using the cutlist and
>>nuvexport. 
>>
>>The new version of avidemux2 has changed the menus around a bit and its not
>>so easy to figure out how to export a raw video file. If you have problems I
>>will walk thru the steps and write it down as I go.
>>
> 
> 
> Thanks. I use avidemux2 as well, and get thrown sometimes by the new
> interface. I'll give this a shot. 
> 
> James
> 
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


More information about the mythtv-users mailing list