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 134.95.192.66:
http://freevo.sourceforge.net/cgi-bin/moin.cgi/TipsAndTricks

------------------------------------------------------------------------------
@@ -230,6 +230,127 @@
 Notice the hostname xp or storage before the path, it tries to ping the hostname and 
when succesfull the entry shows up in the menu, if not succesfull it doesn't show up 
and the filesystem isn't mounted. 
 
 
+== Transcoding shows that are recorded from DVB ==
+
+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"
+
+TRANSCODER="${HOME}/commands/transcoder"
+THUMBNAILER="${HOME}/commands/thumbnailer"
+
+
+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}"
+
+                ${TRANSCODER} "${CAPTURED_FILE}" "${TRANSCODED_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
+
+                        ${THUMBNAILER} "${TRANSCODED_FILE}" "${THUMBNAIL_FILE}"
+
+                        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.
+
+
+
+
 
 
 


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Freevo-wikilog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-wikilog

Reply via email to