Ok, basically it goes like this
my script generates a authentic looking comskip file by pulling data from mythconverg database like this:
Code:
#####COMSKIP DATA#####
#Remove old and generate a comskip Start list
rm $mythicalLibrarian/markupstart.txt
mysql -u$MySQLuser -p$MySQLpass -e "use '$MySQLMythDb' ; select mark from recordedmarkup where starttime like '$ShowStartTime' and chanid like '$ChanID' and type like "4" ; " |replace "mark" ""|replace " " "">>$mythicalLibrarian/markupstart.txt
#Remove old and generate comskip Stop list
rm $mythicalLibrarian/markupstop.txt
mysql -u$MySQLuser -p$MySQLpass -e "use '$MySQLMythDb' ; select mark from recordedmarkup where starttime like '$ShowStartTime' and chanid like '$ChanID' and type like "5" ; " |replace "mark" ""|replace " " "">>$mythicalLibrarian/markupstop.txt
#Set up counter, remove old markup data and generate new markup file from markupstart and stop
if [ "$CommercialMarkup" = "Enabled" ]; then
mythicalLibrarianCounter=1
echo "FILE PROCESSING COMPLETE">"$mythicalLibrarian"/markupframes.txt
echo "------------------------">>"$mythicalLibrarian"/markupframes.txt
while read line
do
mythicalLibrarianCounter=`expr $mythicalLibrarianCounter + 1`;
StartData=`sed -n "$mythicalLibrarianCounter"p "$mythicalLibrarian/markupstart.txt"`
StopData=`sed -n "$mythicalLibrarianCounter"p "$mythicalLibrarian/markupstop.txt"`
if [ "$StopData" != "" ]; then
echo "$StartData $StopData">>"$mythicalLibrarian"/markupframes.txt
CommercialMarkup=Created
echo "COMMERCIAL DATA START:$StartData STOP:$StopData"
fi
done <"$mythicalLibrarian/markupstop.txt"
fi
fi
The comskip file looks like this:
Code:
FILE PROCESSING COMPLETE
------------------------
0 6807
21966 25283
36852 41520
So that leaves an orphaned file when mythTV removes it's file
So I added a tracker which keeps track of every comskip file generated by my script.
Code:
#####MAINTENANCE#####
#Loop through the list of created comskip files and remove orphans.
while read line
do
mythicalLibrarianCounter=`expr $mythicalLibrarianCounter + 1`;
FileToCheck=`sed -n "$mythicalLibrarianCounter"p "$mythicalLibrarian/comskiplog.tracking"`
FileToCheckOriginalDirName=`dirname "$FileToCheck"`
FileToCheckFileBaseName=${FileToCheck##*/}
File
if [ "$FileToCheck" != "" ]; then
FileToCheckLS=`ls "$FileToCheckOriginalDirName"|grep "$FileToCheckFileBaseName\."|sed -n 2p`
if [ "$FileToCheckLS" = "" ]; then
rm FileToCheck
else
echo $FileToCheck>>"$mythicalLibrarian/comskiplog.tracking2"
fi
fi
done <"$mythicalLibrarian/comskiplog.tracking"
#Replace old comskip tracking log with new one after maintenance operation.
rm "$mythicalLibrarian/comskiplog.tracking"
mv "$mythicalLibrarian/comskiplog.tracking2" "$mythicalLibrarian/comskiplog.tracking"
Basically, every time the program starts, it's going to validate all comskip files it has generated to see if it has a movie counterpart. I'm now debugging it.
I've noticed that the XBMC comskip has a pretty rough transition. It just cuts to the next word.
Is it possible to do a .05 fade to black, .1 black, then a .05 fade back up? Or maybe at least validate the frame is black and do a correction within .5 seconds?
Comskips are generated by looking for a certain percentage of black frame. When the movie is played through a different player, the timing is different because the framerate is calculated differently. Since we are taking sources from all different places, and calculating our own framerate, it should be double checked for accuracy or give a refined look to the glitch.