I am able to shrink 1 hour of video to approximately 150 MB at 200 kbit with ffmpeg using h264.&nbsp; Seems to work well except with seeking.&nbsp; I wonder if this is a keyframe issue.&nbsp; When I forward or rewind, there is distortion for a few seconds and then the video fixes itself.&nbsp; If I forward or rewind before the video is fixed, the progress bar seems to jump back.&nbsp; Seeking is more reliable when the distrotion is allowed to clear first.&nbsp; Also, I cannot jump to the very first frame of the recording.&nbsp; If I exit the recording and play it again, I start on the first frame.&nbsp; Here is a copy of my latest script.&nbsp; Single pass for now (hoping to go to 2 pass).&nbsp; I was wondering if anyone could give me any ideas as to how to fix this issue. <br>
<br>Thanks<br>Chris<br><br><br>#!/bin/bash<br>VIDEO_DIR=/mnt/VIDEO<br><br>#subq to 7 trellis to 2 threads 2<br>#need to clear the cutlist and generate it again<br><br><br><br><br>function convert-to-h264 ()<br>{<br>#argument is file only (no path)<br>
#need to dereference a symlink<br>inputfile=`ls -ld $VIDEO_DIR/$1 | awk -F&quot; &quot; &#39;{ print&nbsp; $NF }&#39;`<br><br>echo &quot;Will encode $inputfile&quot;<br>basedname=`echo $inputfile | sed &#39;s,^\(.*/\)\?\([^/]*\),\2,&#39;`<br>
vidformat=`mplayer -vo null -ao null -frames 0 -identify &quot;$inputfile&quot; 2&gt;/dev/null | grep &quot;ID_VIDEO_FORMAT&quot; | sed -e &#39;s/ID_VIDEO_FORMAT=//&#39;`<br><br><br><br>if !&nbsp; [ &quot;$vidformat&quot; == &quot;H264&quot; ]; then<br>
/usr/bin/ffmpeg -threads 2 -i&nbsp; $inputfile&nbsp; -acodec mp3 -ac 2 -ar 44100 -ab 128k -s 320x240 -vcodec h264 -sameq&nbsp; -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 7 -trellis 2 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 300k -maxrate 300k -bufsize 300k -rc_eq &#39;blurCplx^(1-qComp)&#39; -qcomp 0.6 -qmin 15 -qmax 51 -qdiff 4 -level 30 -aspect 320:240&nbsp; $inputfile.avi<br>
<br><br>mv $inputfile $inputfile.old<br>mv $inputfile.avi $inputfile<br><br><br>echo &quot;Building seek table&quot;<br>mythcommflag --rebuild -f &quot;$inputfile&quot;<br><br>echo &quot;Clearing the cut list&quot;<br>mythcommflag --clearcutlist -f $inputfile<br>
<br>echo &quot;Commercial skip to cutlist&quot;<br>mythcommflag --gencutlist -f $inputfile<br><br>filesize=$(wc -c $inputfile | awk &#39;{print $1}&#39;)<br>echo &quot;Updating database&quot;<br>mysql -umythtv -pmythtv -hmymythtv mythconverg -se&quot;UPDATE recorded SET cutlist=0,filesize=$filesize WHERE basename=\&quot;$basedname\&quot;;&quot;<br>
else<br>echo &quot;Already an H264&quot;<br><br>fi<br>}<br><br><br>CONVLIST=`mysql -umythtv -pmythtv -hmymythtv mythconverg -se&quot;select basename from recorded where title like \&quot;%$1%\&quot;;&quot;`<br><br>for i in ${CONVLIST[@]} ; do<br>
&nbsp; if ! test -L $VIDEO_DIR/$i ; then #its not a symnlink<br>&nbsp;&nbsp;&nbsp;&nbsp; #Check if this recording is done -mmin +5<br>&nbsp;&nbsp;&nbsp;&nbsp; filetoconvert=`find $VIDEO_DIR -name $i -mmin +5 | sed &#39;s,^\(.*/\)\?\([^/]*\),\2,&#39;`<br>&nbsp;&nbsp;&nbsp;&nbsp; if [ -z &quot;$filetoconvert&quot; ]; then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;$i is not finnished recording...Skipping&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;Moving $i to /mnt/VIDEO1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $VIDEO_DIR/$i /mnt/VIDEO1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -sf /mnt/VIDEO1/$i $VIDEO_DIR/$i<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; convert-to-h264 $i<br>&nbsp;&nbsp;&nbsp;&nbsp; fi<br>&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;$i is already a symlink...Skipping&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; convert-to-h264 $i<br>&nbsp; fi<br><br><br><br><br>done<br>&nbsp; [root@mygamepc cmisip]# cat /usr/local/bin/RECconv2.sh<br>
#!/bin/bash<br>VIDEO_DIR=/mnt/VIDEO<br><br>#subq to 7 trellis to 2 threads 2<br>#need to clear the cutlist and generate it again<br><br><br><br><br>function convert-to-h264 ()<br>{<br>#argument is file only (no path)<br>#need to dereference a symlink<br>
inputfile=`ls -ld $VIDEO_DIR/$1 | awk -F&quot; &quot; &#39;{ print&nbsp; $NF }&#39;`<br><br>echo &quot;Will encode $inputfile&quot;<br>basedname=`echo $inputfile | sed &#39;s,^\(.*/\)\?\([^/]*\),\2,&#39;`<br>vidformat=`mplayer -vo null -ao null -frames 0 -identify &quot;$inputfile&quot; 2&gt;/dev/null | grep &quot;ID_VIDEO_FORMAT&quot; | sed -e &#39;s/ID_VIDEO_FORMAT=//&#39;`<br>
<br><br><br>if !&nbsp; [ &quot;$vidformat&quot; == &quot;H264&quot; ]; then<br>/usr/bin/ffmpeg -threads 2 -i&nbsp; $inputfile&nbsp; -acodec mp3 -ac 2 -ar 44100 -ab 128k -s 320x240 -vcodec h264 -sameq&nbsp; -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 7 -trellis 2 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 300k -maxrate 300k -bufsize 300k -rc_eq &#39;blurCplx^(1-qComp)&#39; -qcomp 0.6 -qmin 15 -qmax 51 -qdiff 4 -level 30 -aspect 320:240&nbsp; $inputfile.avi<br>
<br><br>mv $inputfile $inputfile.old<br>mv $inputfile.avi $inputfile<br><br><br>echo &quot;Building seek table&quot;<br>mythcommflag --rebuild -f &quot;$inputfile&quot;<br><br>echo &quot;Clearing the cut list&quot;<br>mythcommflag --clearcutlist -f $inputfile<br>
<br>echo &quot;Commercial skip to cutlist&quot;<br>mythcommflag --gencutlist -f $inputfile<br><br>filesize=$(wc -c $inputfile | awk &#39;{print $1}&#39;)<br>echo &quot;Updating database&quot;<br>mysql -umythtv -pmythtv -hmymythtv mythconverg -se&quot;UPDATE recorded SET cutlist=0,filesize=$filesize WHERE basename=\&quot;$basedname\&quot;;&quot;<br>
else<br>echo &quot;Already an H264&quot;<br><br>fi<br>}<br><br><br>CONVLIST=`mysql -umythtv -pmythtv -hmymythtv mythconverg -se&quot;select basename from recorded where title like \&quot;%$1%\&quot;;&quot;`<br><br>for i in ${CONVLIST[@]} ; do<br>
&nbsp; if ! test -L $VIDEO_DIR/$i ; then #its not a symnlink<br>&nbsp;&nbsp;&nbsp;&nbsp; #Check if this recording is done -mmin +5<br>&nbsp;&nbsp;&nbsp;&nbsp; filetoconvert=`find $VIDEO_DIR -name $i -mmin +5 | sed &#39;s,^\(.*/\)\?\([^/]*\),\2,&#39;`<br>&nbsp;&nbsp;&nbsp;&nbsp; if [ -z &quot;$filetoconvert&quot; ]; then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;$i is not finnished recording...Skipping&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;Moving $i to /mnt/VIDEO1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv $VIDEO_DIR/$i /mnt/VIDEO1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -sf /mnt/VIDEO1/$i $VIDEO_DIR/$i<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; convert-to-h264 $i<br>&nbsp;&nbsp;&nbsp;&nbsp; fi<br>&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;$i is already a symlink...Skipping&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp; convert-to-h264 $i<br>&nbsp; fi<br><br><br><br><br>done<br><br>