Dear Wiki user, You have subscribed to a wiki page or wiki category on "Freevo Wiki" for change notification.
The following page has been changed by 203.173.18.35: http://freevo.sourceforge.net/cgi-bin/moin.cgi/DVB The comment on the change is: Added some information about transcoding captured DVB stream ------------------------------------------------------------------------------ @@ -56,3 +56,116 @@ VCR_CMD = CONF.mplayer + ' -dumpstream -dumpfile %(filename)s "dvb://%(channel)s"' TV_RECORDFILE_SUFFIX = '.ts' }}} + + +=== Transcoding === +After programs have been recorded, you can transcode them to save some space. Here's one that I use to transcode to ogm. +I'm using ogm since you need to extract the audio to normalize it anyway, so I might as well use the ogg container. +The other thing to note is the -mc 10, which tells mencoder to trust the A/V sync in the input stream, rather than trying +to correct the sync itself. + +This video bitrate is rather high for the size, it will probably work just as well at 800kbit. + +{{{ +#!/bin/bash -x + +NICE="20" +VBITRATE="1100" +AQUALITY="3" + +VCODEC_OPTS="vbitrate=$VBITRATE:vhq:keyint=250" +ACODEC_OPTS="preset=$ABITRATE" + +VFILTER="pp=fd,scale=480:272" + +EXTRA_OPTS="-aspect 16:9 -mc 10" + +WAV_FILE="${1}.wav" +OGG_FILE="${1}-audio.ogg" +AVI_FILE="${1}-video.avi" + +rm -f frameno.avi "$WAV_FILE" "$OGG_FILE" "$AVI_FILE" + +nice -n $NICE mencoder ${EXTRA_OPTS} -ovc frameno -oac copy -o frameno.avi "$1" && \ +nice -n $NICE mplayer ${EXTRA_OPTS} -vc dummy -vo null -hardframedrop -ao pcm -aofile "$WAV_FILE" "$1" && \ +nice -n $NICE normalize "$WAV_FILE" && \ +nice -n $NICE oggenc "-q${AQUALITY}" "-o${OGG_FILE}" "${WAV_FILE}" && \ +nice -n $NICE mencoder ${EXTRA_OPTS} -vf $VFILTER -ovc lavc -lavcopts ${VCODEC_OPTS}:vpass=1 -oac copy -o /dev/null "$1" && \ +nice -n $NICE mencoder ${EXTRA_OPTS} -vf $VFILTER -ovc lavc -lavcopts ${VCODEC_OPTS}:vpass=2 -oac copy -o "${AVI_FILE}" "$1" && \ +nice -n $NICE ogmmerge -o "$2" -A "$AVI_FILE" "$OGG_FILE" && \ +rm -f divx2pass.log frameno.avi "$WAV_FILE" "$OGG_FILE" "$AVI_FILE" || \ +( echo "Transcode Failed" && \ +exit 10 ) + +# done +echo "Transcode Successful" +}}} + +Here's another script I use to generate the thumbnails: +{{{ +#!/bin/bash -x + +INPUT="$1" +OUTPUT="$2" + +TEMPFILE="/tmp/thumnailer$$" + +nice -n 20 transcode -V -i "${INPUT}" -y jpg,null -o "${TEMPFILE}" -c 2000-2001 +mv "${TEMPFILE}000000.jpg" "${OUTPUT}" +}}} + +This one is a daemon I start at boot time to monitor the recordings directory and transcode the files after the capture is complete. +It also updates the FXD with the extension of the transcoded file. + +{{{ +#!/bin/bash + +CAPTURE_EXTENSION="ps" +TRANSCODED_EXTENSION="ogm" +THUMBNAIL_EXTENSION="jpg" + +RECORDING_DIR="${HOME}/recordings" + +cd "$RECORDING_DIR" + +while ((1)) ; do + echo Sleeping + sleep 300 + echo Waking up + date + for CAPTURED_FILE in `find . -mmin +5 -name "*.${CAPTURE_EXTENSION}"` ; do + echo "Processing File ${CAPTURED_FILE}" + TRANSCODED_FILE=`echo ${CAPTURED_FILE} | sed "s/${CAPTURE_EXTENSION}\$/${TRANSCODED_EXTENSION}/"` + FXD_FILE=`echo ${CAPTURED_FILE} | sed "s/${CAPTURE_EXTENSION}\$/fxd/"` + THUMBNAIL_FILE=`echo ${CAPTURED_FILE} | sed "s/${CAPTURE_EXTENSION}\$/${THUMBNAIL_EXTENSION}/"` + echo "Transcoded File is ${TRANSCODED_FILE}" + + if [ -e ${TRANSCODED_FILE} ] ; then + echo "Transcoded file already exists! - deleting it" + rm "${TRANSCODED_FILE}" + fi + echo "Transcoding file ${CAPTURED_FILE}" + + /home/tv/commands/transcoder "${CAPTURED_FILE}" "${TRANSCODED_FILE}" + /home/tv/commands/thumbnailer "${TRANSCODED_FILE}" "${THUMBNAIL_FILE}" + + if [ $? = 0 ] ; then + echo "Transcoding Success" + + if [ -e ${FXD_FILE} ] ; then + echo "Fixing FXD" + sed -i "s/\\.${CAPTURE_EXTENSION}/\\.${TRANSCODED_EXTENSION}/" "${FXD_FILE}" + fi + + echo "Deleting ${CAPTURED_FILE}" + rm -f "${CAPTURED_FILE}" + else + echo "Failed to transcode ${CAPTURED_FILE} !!!" + rm "${TRANSCODED_FILE}" + fi + done +done +}}} + + +Hopefully that will give you a starting point to create your own transcoding setup. ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Freevo-wikilog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-wikilog
