Jump to content

Automated Commercial Removal from TV Recordings


PhilWhite

Recommended Posts

PhilWhite

@@unhooked,

 

Thanks again for all the info.  I am reading the Porter's Handbook now and learning C basics and C#.  It will take me a while to produce anything, if I can get any part to work, but learning is always worth it.  Current plan is to translate comcut to C# and compile in mono.

Edited by PhilWhite
  • Like 1
Link to comment
Share on other sites

unhooked

@@unhooked,

 

Thanks again for all the info.  I am reading the Porter's Handbook now and learning C basics and C#.  It will take me a while to produce anything, if I can get any part to work, but learning is always worth it.  Current plan is to translate comcut to C# and compile in mono.

Yeah, you seem to be enjoying yourself.

Link to comment
Share on other sites

PhilWhite

@@unhooked,

 

Quick question.  I'm trying to understand everything in the comcut script but I am not completely sure about one of the constructions -- early in the script he uses a case statement and sets pathways to deal with $1.

 

The construction goes:

 

key="$1"

case $key in

       --ffmpeg=*)

       ffmpegPath="${key#*=}

       shift

       ;;

 

I think I understand most of it, but I am not entirely sure of the convention for the variable/parameter expansion of "key."  From what I understand, the following #* will cut the smallest part of the expansion in a general way -- which I assume is a way of cutting out the file extension (but maintaining the recording name and entire pathway, which is included in "$1").  But what is the purpose of the = after that?  Does it do something else?  I've searched for an answer and can't seem to find one easily. 

 

The other thing that bothered me about that section is that it is passed through a while loop triggered by the number of arguments passed being greater than 1.  Shouldn't that read greater than or equal to 1?

 

It is written: 

while [[ S# -gt 1 ]]

do

key="$1"

case $key in .....

 

I was wondering if that might be why I have seen different behavior in the script depending on if an output file is specified.

 

Bash has many ways of removing file extensions it appears.  From what I gather, this isn't so easy in C.  Basename and dirname exist in C (as you know, I'm sure), but I can't seem to discover if there is a trick, as in shell script, to strip off the extension using backticks and following with the file extension.  Does that come into play if you #define _GNU_source?  Would something like:

 

char var

var = basename($1 .ts)  (or path for $1)

 

-- where $1 stand in for the first argument and has a known .ts extension, work in C?  I think the answer is 'no' but thought I'd ask anyway.  I know I'm not following the proper convention (which I am only learning now), but I hope you understand the idea behind the question.

 

ETA:  or maybe never mind with the latter question since strip_ext looks like it will work with a few lines of code.

Edited by PhilWhite
Link to comment
Share on other sites

PhilWhite

I do have one thing to report.  I have been playing around with comcut because it seemed to act strangely with multiple recordings but only when you specify an outfile -- if you do not specify an outfile it simply overwrites the infile, "$1", with the commercial cuts; and I have yet to see that configuration fail.

 

With multiple recordings ending at the same time the lockfile didn't seem to work very well, and sometimes I would lose one conversion while at other times all the conversions failed.  There are a couple of extraneous commands in comcut that are a relic of it being an offshoot of comchap that I deleted, but that is of no real consequence, I think -- just mentioned it if anyone wants to clean up that script.

 

But the while loop for checking on the presence of a lockfile was nested in an if-then statement designed only to send a message that the lockfile is in use.  The trigger is the absence of an empty lockfile, while the trigger for locking the processing is the presence of the file.  I simply separated the if - then statement from the while loop, un-nested the while statement, and I was able to convert four simultaneous recordings with a specified outfile.  I need to see how this repeats, but I don't see why it would fail the way it is set up now.  The commercial cutting was poor on two of the programs, but one had a weather advisory ticker at the top of the screen, and that always interferes with the process using the comskip.ini file I use currently.  I'm looking into finding a more 'aggressive' option.

 

It's a simple fix that removes the need to use any while-if-then loops in your post-processing script, or the need to create a lockfile in the post-processing script as some have done.  But it does require changing the comcut script.  I'm not sure how reliable it is yet, though.

 

The other thing is that just as there is a basename command, there is also a dirname command; so it is easier to write the command to maintain the 'head' of the path in the post.sh variables.  I changed the directions for my post.sh to reflect that in post #70.

Link to comment
Share on other sites

unhooked

Case reads input, think of it like a nested if/then loop. Historically if was used to create menu scripts for user interaction. But here it's parsing command line arguments.

 

Comcut was written with slower systems in mind, that seems to be the only reason for the lockfile. Just so you don't smoke your system, but if you want to bypass the lock and do

multiple runs, just make sure all of those variables are defined so it doesn't clobber the temp files used when it's parsing the ts and spitting out chunks before it reassembles things.

Edited by unhooked
Link to comment
Share on other sites

unhooked

Case reads input, think of it like a nested if/then loop. Historically if was used to create menu scripts for user interaction. But here it's parsing command line arguments.

 

Comcut was written with slower systems in mind, that seems to be the only reason for the lockfile. Just so you don't smoke your system, but if you want to bypass the lock and do

multiple runs, just make sure all of those variables are defined so it doesn't clobber the temp files used when it's parsing the ts and spitting out chunks before it reassembles things.

I mean, you could probably change the lock file to something like /tmp/$1.lock and then check for the existence of that just to be sure it's not trying to process the same file twice, then go onto running a different job.

Link to comment
Share on other sites

PhilWhite

Case reads input, think of it like a nested if/then loop. Historically if was used to create menu scripts for user interaction. But here it's parsing command line arguments.

 

Comcut was written with slower systems in mind, that seems to be the only reason for the lockfile. Just so you don't smoke your system, but if you want to bypass the lock and do

multiple runs, just make sure all of those variables are defined so it doesn't clobber the temp files used when it's parsing the ts and spitting out chunks before it reassembles things.

Thanks.

 

I'm not sure my system is capable of 4 concurrent runs, but it does seem to handle 3 with no problems.  It seems to me as though there is something wrong in the logic since it does not appear to lock down the process.  When I have watched the files being generated at least 2 of them progress to the point where all the text files are created and also the edl file is read and different parts of the ts file are created before being reassembled.  A third run quickly follows before that whole process is completed, then the fourth gets into the picture a little later (when I have tested with four concurrent recordings).

 

There are no problems with ffmpeg dealing with multiple runs.

 

I was thinking of removing the lockfile from the case statement section next to see how that works.  Doesn't hurt to try.

 

ETA:  Or is it set up actually to be a lockfile to prevent the same file from being processed again -- each show has its own lockfile, but there is no lockfile for the process as a whole?

 

 

ETA: Update....watching the lock file, only one instance is created.  It looks like comcut is just wicked fast, at least with 30 minute shows.  I have done this twice now with four concurrent recordings (all 30 minute to get quicker results) and no failures in the process using a defined outfile.  The only change I made was separating an if-then statement from a while loop and it seems to have fixed the issue.  Not that I expect anyone to record four programs of equal length at one time, but just in case.  It appears there is no need for an extraneous lock file in the post-processing script, but it won't hurt either.  With the second set of recordings, even with quick processing, the commercial cutting (even with four concurrent shows) was spot on.

Edited by PhilWhite
Link to comment
Share on other sites

PhilWhite

I've been playing with comcut to learn how it works.  Nice script, but some of it is not really necessary when you already know where the supporting programs are located (comskip in /usr/local/bin, etc.), that there will be a an incoming file (since it is only being used in this situation once triggered for post-processing), and that there will not be an empty work-directory.  I tried to make it work in csh and now hate it; it works fine does not work in the older Bourne shell, so bash is still needed.  Unfortunately this script uses an array twice, and the older Bourne shell does not support the use of arrays.

 

You will have to change the pathways in the script for comskip, comskip.ini, and ffmpeg if they are in a different location.  Still learning C, but the only tricky parts (as far as I can tell) are variable expansion and how to read the edl file.

 

I have a means of extracting closed captioning but left the command out of this script.  There is a package for ccextractor, so the extraction process is simple.  I haven't yet tried remuxing the extracted .srt file in ffmpeg, but that doesn't look difficult either.

 
 
#!/usr/bin/env bash

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH

infile=$1
outfile="$infile"
comskipdir=${infile%/*}
edlfile="${infile%.*}.edl"
metafile="${infile%.*}.ffmeta"
logfile="${infile%.*}.log"
logofile="${infile%.*}.logo.txt"
txtfile="${infile%.*}.txt"

/usr/local/bin/comskip --output="$comskipdir" --ini=/Comskip/comskip.ini "$infile"

start=0
i=0
hascommercials=false
concat=""
totalcutduration=0
tempfiles=()

echo ";FFMETADATA1" > "$metafile"
# Reads in from $edlfile, see end of loop.
while IFS=$'\t' read -r -a line
do
  end="${line[0]}"
  startnext="${line[1]}"

  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]; then
    ((i++))

    hascommercials=true

    echo [CHAPTER] >> "$metafile"
    echo TIMEBASE=1/1000 >> "$metafile"
    echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo "title=Chapter $i" >> "$metafile"

    chapterfile="${infile%.*}.part-$i.ts"
    tempfiles+=("$chapterfile")
    concat="$concat|$chapterfile"

    duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss "$start" -t "$duration" -c copy -y "$chapterfile"

    totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk  '{print $1 + $2 - $3}'`

  fi

  start=$startnext
done < "$edlfile"

if $hascommercials ; then

  #dont forget to add the final part from last commercial to end of file
  end=`/usr/local/bin/ffmpeg -hide_banner -nostdin -i "$infile" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{ printf "%f", ($1*3600)+($2*60)+$3 }'`

  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]; then

    ((i++))

    echo [CHAPTER] >> "$metafile"
    echo TIMEBASE=1/1000 >> "$metafile"
    echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo "title=Chapter $i" >> "$metafile"

    chapterfile="${infile%.*}.part-$i.ts"
    tempfiles+=("$chapterfile")
    concat="$concat|$chapterfile"

    duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss "$start" -t "$duration" -c copy -y "$chapterfile"
  fi

  /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$metafile" -i "concat:${concat:1}" -c copy -map_metadata 0 -y "$outfile"
fi

for i in "${tempfiles[@]}"
do
  rm "$i"
done

export LD_LIBRARY_PATH="$ldPath"
rm "$edlfile"
rm "$metafile"
rm "$logfile"
rm "$logofile"
rm "$txtfile"

 

 

I also have a different post.sh file I am playing with, that only cuts commercials from some recordings and passes on the rest to ffmpeg to convert to mkv.  But it isn't working, so need to keep playing with it.  ETA: Yeah, ignorant me, grep is for contents inside files, find is for file names -- and file names is what I need -- so I need to search for the right way to use 'find' in this situation.

#!bin/sh

lockfile="/tmp/post.lock"
while [ -f "$lockfile" ]; do
    echo "Waiting"
    sleep 5
done
touch "$lockfile"

show=${1%.*}
a=`echo "$show".mkv`

/comcut "$1"

if [ `echo "$a" | grep -Eqw 'Colbert|Trevor'` ]
then
  break
else
   /usr/local/bin/ffmpeg -i "$1" -vf yadif -c:v libx264 -preset slow -crf 18 -max_muxing_queue_size 1024 -c:a copy "$a" 
fi

mv "$1" /media/ts_archive/
rm "$lockfile"
 
There are several other possible changes.  
Edited by PhilWhite
  • Like 1
Link to comment
Share on other sites

PhilWhite

Well, I thought it worked last night, but it hangs up now at tempfiles=() -- get syntax error, bad function name.  Will try to figure it out.

Link to comment
Share on other sites

unhooked

Well, I thought it worked last night, but it hangs up now at tempfiles=() -- get syntax error, bad function name.  Will try to figure it out.

tempfiles+=  vs tempfiles?

Link to comment
Share on other sites

PhilWhite

tempfiles-()   ...... then tempfiles+=("$chapterfile") works fine in Bash but not in sh.  ETA: actually tempfiles is there to easily remove the chapterfiles when the process is done.  It is an array that collects the chapterfiles as they are produced; you then remove them after the process is complete, so removing it is a mistake.  

 

Next problem is an error trying to read the edl file.  Does -a not exist as an option for 'read' in the Bourne shell?  If not, the whole reading setup will have to be changed.  In the Bash script things are set up to take advantage of the -a option -- the first line is separated into the two tokens from the edl file and assigned to line[0] and line[1], which are "$end" and "$startnext".  I think I see why Brett Sheleski used bash.  It's all much easier that way, not that he didn't put a huge amount of effort into this.  Very nice script.

 

ETA: OK, so arrays basically don't exist in the Bourne shell (aside from $1, $2, etc), so trying to make this work in the Bourne shell is probably more work than it is worth.  On to working with C and C#, which is going to take a much longer time.  The only other way around this is to use awk, but I haven't really learned how it works yet; and I'm not sure that will be able to solve the problem.

 

Well, at least, there is an easier way to write comcut in bash for use in this situation (and it is very situation specific).  And I found a simpler way to create the directory/showtitle for post sh scripts, which I added to one of the posts above.  I am trying out 'case' for directing programs to where I want them to go -- since I have more than one option to choose from.  Simple grep statements work well, but the pattern matching in case is more powerful.

Edited by PhilWhite
Link to comment
Share on other sites

PhilWhite

Again, if anyone is interested. this post.sh file actually works (finally) to determine which recordings proceed through conversion to mkv and also moves the completed files that you wish to move to another location of your choosing.  Files you do not wish to move will stay in their original folder.

 

So, it basically: 

  • cuts commercials from all recordings
  • returns the file (with commercials removed) to its original folder
  • avoids conversion to mkv for selected recordings
  • moves selected recordings after they are converted to mkv to another location so they won't clutter your Recent Recordings

 

This script strips the recording name to its directory name to ease comparison.  So, if you record an episode of "Home Improvement", Emby creates a folder "Home Improvement (1991)" with a subfolder for season which then contains the recording.  The commands strip away the basename of the show -- say Home Improvement S06E21 Insult to Injury.ts -- and also strips away the Season and the upstream path -- for instance, /media/Recordings.  What you are left with is a simpler string to match, and that string is invariable for all instances of that show.  If the name is found, you can avoid moving on to the next step -- calling ffmpeg. 

 

The latter portion basically does the same thing after the file is converted and moves it if a match is found.  You can redirect any number of shows where you want them with this approach.  Just add elif [match] then [command] as many times as you want and with whichever shows you want to redirect (just be sure to use the entire name of the directory, including year if it is there).  Oh, and I took the lockfile out of my version of comcut and put it in post.sh to better control the work flow.

 

Personally I move shows I don't want to watch soon into a bigger archive with all my old recordings in their own folders, so my mv commands look more like:

 

mv "$a" "./media/Recorded TV/Drunk History/"$d"

mv "$a" "./media/Recorded TV/Elementary/"$d"

 

But, I also do not keep tidy files separated into seasons.  You could maintain the "season" part of the path by not using `basename "$a"`, for instance; instead, you could use d=${a##*/}, which would create "show directory/season/show name" and then move it where you wish.

 

You can also remove the original .ts file if you convert to mkv, so that you are left with only one recording (if you have experience with it and are comfortable that conversions won't fail).  If you want to save a copy of the original recording, the safest path would be to cp "$1" wherever you want before the rest of the script kicks in.

 

ETA:  Forgot to mention, you can also add something like:

 

/usr/bin/find ./media/Recordings/ -type f -name "The Big Bang Theory*.nfo" -exec /bin/mv {} "./media/Recorded TV/The Big Bang Theory (2007)/" \;

 

if you want to move the .nfo file.  (and replace with .jpg if you want to move the .jpg file) that Emby generates with the recordings, so that you get metadata and picture along with it.  You could add commands to move season info and poster if you wish as well.

 

This version uses the Bourne shell; if you want to use csh the commands differ a little.

#!/bin/sh

lockfile="/tmp/post.lock"
while [ -f "$lockfile" ]; do
    echo "Waiting"
    sleep 5
done

touch "$lockfile"

show=${1%.*}
a=`echo "$show".mkv`
b=${1%/*}
c=${b%/*}
title=${c##*/}

/comcut "$1"

if [ "$title" == "I Am the Night" ]
then 
  echo "Not for conversion"
elif [ "$title" == "The Late Show With Stephen Colbert (2015)" ]
then
  echo "Not for conversion"
elif [ "$title" == "Home Improvement (1991)" ]
then
  echo "Not for conversion"
else
  /usr/local/bin/ffmpeg -i "$1" -vf yadif -c:v libx264 -preset slow -crf 18 -max_muxing_queue_size 1024 -c:a copy "$a"
fi
 
d=`basename "$a"`
if [ "$title" == "The Big Bang Theory (2007)" ]
then
  mv "$a" "./media/ts_archive/$d"
fi
 
rm "$lockfile"

Edited by PhilWhite
Link to comment
Share on other sites

  • 2 weeks later...
PhilWhite

OK, I do now have a working form of comcut that does not require bash.  I haven't started working on versions in C or C# yet, though.  This works in sh.

 

The current version has hard coded paths to ffmpeg, comskip, and comskip.ini, but replacing those with options you can add in your post.sh script is easy to replace.  It also does not have a mechanism to keep any of the log files/edl file/ffmetadata file, etc.  That is also easy to keep if needed.

 

Since arrays are not available in sh, I had to read the edl file differently and the concatenation step had to be expanded; and it requires a few additional variables.  Cleanup had to change as well.  But it works.

#!/bin/sh

PATH=$PATH:/usr/local/bin:/usr/bin

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH

infile=$1
outfile="$infile"
comskipdir=${infile%/*}
show="${infile%.*}"
edlfile="${show}.edl"
metafile="${show}.ffmeta"
logfile="${show}.log"
logofile="${show}.logo.txt"
txtfile="${show}.txt"

i=0
start=0
hascommercials=false
chapterfile=""
totalcutduration=0
temp1="${show}.1.ts"
temp2="${show}.2.ts"

/usr/local/bin/comskip --output="$comskipdir" --ini=/Comskip/comskip.ini "$infile"

echo ";FFMETADATA1" > "$metafile"
# Reads in from $edlfile, see end of loop.
while IFS=$'\t\n' read -r end startnext c _; 
do
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))

    hascommercials=true

    echo [CHAPTER] >> "$metafile"
    echo TIMEBASE=1/1000 >> "$metafile"
    echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo "title=Chapter $i" >> "$metafile"

    chapterfile="${infile%.*}.part-$i.ts"
        
    duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss $start -t $duration -c copy -y "$chapterfile"

    totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk  '{print $1 + $2 - $3}'`
  fi
  start=$startnext
done < "$edlfile"

#dont forget to add the final part from last commercial to end of file
  end=`/usr/local/bin/ffmpeg -hide_banner -nostdin -i "$infile" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{ printf "%f", ($1*3600)+($2*60)+$3 }'`

  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))

    echo [CHAPTER] >> "$metafile"
    echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    echo "title = Chapter $i" >> "$metafile"

    chapterfile="${show}.part-$i.ts"
    
    duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss $start -t $duration -c copy -y "$chapterfile"
  fi
    
    /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$show.part-1.ts" -c copy -y "$temp1"

i=2
while [ -e "$show.part-$i.ts" ]
do
  cp "$temp1" "$temp2"
  /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "concat:$temp2|$show.part-$i.ts" -c copy -y "$temp1"
  i=$((i + 1))
done
  
  /usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$metafile" -i "$temp1" -c copy -map_metadata 0 -y "$outfile"
      
export LD_LIBRARY_PATH="$ldPath"
rm "$edlfile"
rm "$metafile"
rm "$logfile"
rm "$logofile"
rm "$txtfile"
rm "$temp1"
rm "$temp2"
rm "${show}".part-*.ts

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
PhilWhite

And here is another version of comcut that works in sh.  This uses a function to do most of the work and also uses ffmpeg's concat demuxer method to concatenate the files (which I think is more elegant than the work-around in the previous version).  I moved the working directory to /tmp to avoid an issue with the concat demuxer, which I kind of like.  This version still uses absolute paths to comskip, ffmpeg and comskip.ini rather than passing along the optional paths from comcut and it also still simply removes the working files at the end rather than providing the option to retain them with an optional command in comcut.

#!/bin/sh

PATH=$PATH:/usr/local/bin:/usr/bin

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH


infile=$1
outfile="$infile"
show=`basename "$infile"`
edlfile="/tmp/${show%.*}.edl"
metafile="/tmp/${show%.*}.ffmeta"
logfile="/tmp/${show%.*}.log"
logofile="/tmp/${show%.*}.logo.txt"
txtfile="/tmp/${show%.*}.txt"
showfile="/tmp/${show%.*}_a.txt"
chapterfile=""

i=0
start=0
hascommercials=false
totalcutduration=0

writefiles()
    {
	echo [CHAPTER] >> "$metafile"
    	echo TIMEBASE=1/1000 >> "$metafile"
    	echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo "title=Chapter $i" >> "$metafile"
        printf "file '%s'\n" "$chapterfile" >> "$showfile"
    	duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    	/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss $start -t $duration -c copy -y "$chapterfile"
    }


/usr/local/bin/comskip --output=/tmp --ini=/Comskip/comskip.ini "$infile"

echo ";FFMETADATA1" > "$metafile"
# Reads in from $edlfile, see end of loop.
while IFS=$'\t\n' read -r end startnext c _; 
do
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    hascommercials=true
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
    totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk  '{print $1 + $2 - $3}'`
  fi
  start=$startnext
done < "$edlfile"

#dont forget to add the final part from last commercial to end of file
if [ $hascommercials=true ]
  then
  end=`/usr/local/bin/ffmpeg -hide_banner -nostdin -i "$infile" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{ printf "%f", ($1*3600)+($2*60)+$3 }'`
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
  fi
fi
    
/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -f concat -safe 0 -i "$showfile" -c copy -y "$outfile"

       
export LD_LIBRARY_PATH="$ldPath"
rm "$edlfile"
rm "$metafile"
rm "$logfile"
rm "$logofile"
rm "$txtfile"
rm /tmp/part-*.ts
rm "$showfile"
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
Baenwort

So it looks like I may have to redo my entire commercial removal setup as I'm getting little help in resolving an issue with upgrading from 4.0.2.0 to the recently released newer versions. 

 

Do you have more instructions for how to use the code you've been posting? Do I just place it in a post.sh and link it in Emby's post process tab?

Link to comment
Share on other sites

PhilWhite

So it looks like I may have to redo my entire commercial removal setup as I'm getting little help in resolving an issue with upgrading from 4.0.2.0 to the recently released newer versions. 

 

Do you have more instructions for how to use the code you've been posting? Do I just place it in a post.sh and link it in Emby's post process tab?

Hi Baenwort.  Sorry to hear about your problems.  I ran into the same or similar issue when I tried to update to 4.0.2.0 in one of my play jails.  Turns on and then turns off immediately, probably because I am using chrome also.

 

I can see three options.  First is recreate all the steps in the original post, but that would be silly.

 

Second, if you had to delete your jail and start over, would be to use the instructions in post 70 -- which will install all the components to your jail in a few steps.

 

If you still have all the needed bits (comskip, ffmpeg, comskip.ini), then you can certainly try to use this stripped down version of comcut as a post.sh script -- but with a few caveats.

 

It uses direct paths for ffmpeg, comskip and comskip.ini.  You can change the paths in the script to suit your needs or ensure that comskip and ffmpeg are in /usr/local/bin and comskip.ini in /Comskip.

 

The relevant line to alter, if needed, is: /usr/local/bin/comskip --output=/tmp --ini=/Comskip/comskip.ini "$infile"

 

and any call to ffmpeg (I think there are three or four).

 

If you want to use it as a post.sh file, then you don't need to make any other changes to it if you want to end up with a .ts file with commercials removed; but I think adding a lock file for safety would be a good idea since I can't vouch for its behavior when multiple recordings end at the same time.  For simply cutting commercials it does its job in only a few minutes, though.

 

If you want to convert recordings to .mp4 or .mkv, then you need to add a few other lines.  A more complete version would be:

#!/bin/sh

PATH=$PATH:/usr/local/bin:/usr/bin

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH

lockfile="/tmp/post.lock"
while [ -f "$lockfile" ]; do
    echo "Waiting"
    sleep 5
done

touch "$lockfile"


infile=$1
outfile="$infile"
show=`basename "$infile"`
edlfile="/tmp/${show%.*}.edl"
metafile="/tmp/${show%.*}.ffmeta"
logfile="/tmp/${show%.*}.log"
logofile="/tmp/${show%.*}.logo.txt"
txtfile="/tmp/${show%.*}.txt"
showfile="/tmp/${show%.*}_a.txt"
chapterfile=""
a=${1%.*}
b=`echo "$a".mkv`

i=0
start=0
hascommercials=false
totalcutduration=0

writefiles()
    {
	echo [CHAPTER] >> "$metafile"
    	echo TIMEBASE=1/1000 >> "$metafile"
    	echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo "title=Chapter $i" >> "$metafile"
        printf "file '%s'\n" "$chapterfile" >> "$showfile"
    	duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    	/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss $start -t $duration -c copy -y "$chapterfile"
    }


/usr/local/bin/comskip --output=/tmp --ini=/Comskip/comskip.ini "$infile"

echo ";FFMETADATA1" > "$metafile"
# Reads in from $edlfile, see end of loop.
while IFS=$'\t\n' read -r end startnext c _; 
do
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    hascommercials=true
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
    totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk  '{print $1 + $2 - $3}'`
  fi
  start=$startnext
done < "$edlfile"

#dont forget to add the final part from last commercial to end of file
if [ $hascommercials=true ]
  then
  end=`/usr/local/bin/ffmpeg -hide_banner -nostdin -i "$infile" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{ printf "%f", ($1*3600)+($2*60)+$3 }'`
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
  fi
fi
    
/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -f concat -safe 0 -i "$showfile" -c copy -y "$outfile"

       
export LD_LIBRARY_PATH="$ldPath"
rm "$edlfile"
rm "$metafile"
rm "$logfile"
rm "$logofile"
rm "$txtfile"
rm /tmp/part-*.ts
rm "$showfile"

/usr/local/bin/ffmpeg -i "$outfile" -vf yadif -c:v libx264 -preset slow -crf 18 -max_muxing_queue_size 1024 -c:a copy "$b"
rm "$lockfile"

I haven't tried it as a post.sh file, only from the command line in my tests, but I don't see why it wouldn't work.  I hope this helps.

Link to comment
Share on other sites

Baenwort

Have you reported your 4.0.2.0 problems to them? They seem to think it is isolated to a few people as their sole tester @@sluggo45 was coming from the beta versions and had no problem.

 

I currently end my post.sh with a handbrake call to re-encode to a .mkv file and then delete the original .ts file so I'd likely need to do the same again or develop a ffmpeg call that performs the same. Right now I encode the video to x264 and copy the audio along with a version that is encoded to AAC stereo and then I strip the subs out to a .srt file.  Can all of that be done with a ffmpeg call? I've never directly called ffmpeg but instead worked via Handbrake. 

Link to comment
Share on other sites

PhilWhite

Have you reported your 4.0.2.0 problems to them? They seem to think it is isolated to a few people as their sole tester @@sluggo45 was coming from the beta versions and had no problem.

 

I currently end my post.sh with a handbrake call to re-encode to a .mkv file and then delete the original .ts file so I'd likely need to do the same again or develop a ffmpeg call that performs the same. Right now I encode the video to x264 and copy the audio along with a version that is encoded to AAC stereo and then I strip the subs out to a .srt file.  Can all of that be done with a ffmpeg call? I've never directly called ffmpeg but instead worked via Handbrake. 

Haven't reported it yet because I haven't looked at the logfile yet.  I think something important is missing.  I may be able to get to that issue in a few days.

 

The ffmpeg call that I use just copies the native audio, so you should be fine with it; and it encodes video to x264 as well, so that should be about the same.  Handbrake, it turns out, is just a gui wrapper for ffmpeg, so it's basically the same thing.  You could just replace the added ffmpeg call in the above with your usual calls in your old post.sh.  It's all about the same.  The calls to strip out subtitles to a .srt file would be the same as you currently use.  You can do that with ffmpeg (sluggo45 provided an example earlier in the thread) or use another pkg (forgot the name).

 

When I first started playing with it I just used the original comcut script and added my post.sh commands to the end.  The only change you would make would be to change "$1" to "$outfile" as input in your Handbrake call.  That should replace the .ts file with the new .mkv file (but I haven't paid attention to that for a while so I am not sure it replaces the original recording.  If not, then add another command: rm "$1" after you run the conversion and strip the subtitles (and before you release the lock file).

Link to comment
Share on other sites

  • 2 weeks later...
PhilWhite

Last update for a while probably.  I created a new script for installing all the needed components (there are two options, the original called package.sh and the new one called package2.sh); it uses the pared-down version of Brett Sheleski's comcut with a call to ffmpeg to convert files to .mkv.  You could use this as your post-processing file if you wish; just place it (called post3.sh) in the post-processing section of the DVR in the emby dashboard.  I left the package installer script in csh for no particular reason other than laziness.

 

To install, just do the usual -- open a shell in Freenas, then iocage console <jailname>, then cd /, then:

fetch -o - https://raw.githubusercontent.com/pawhite/Commercialcut/master/package2.sh | csh

And that should install everything.  This version removes bash and the need to clone comchap/comcut.  Most of the packages that need to be installed are simply there to enable comskip to be compiled and to work.

 

The script looks like this:

#!/bin/csh

set path = ($path /usr/local/bin)

cd /
pkg install -y git
pkg install -y argtable
pkg install -y autoconf
pkg install -y automake
pkg install -y libtool
pkg install -y ffmpeg

echo y | pkg set -o devel/pkg-config:devel/pkgconf
echo y | pkg install -f devel/pkgconf

setenv CC clang

/usr/local/bin/git clone https://github.com/erikkaashoek/Comskip
fetch https://raw.githubusercontent.com/pawhite/Commercialcut/master/post3.sh
chmod +x /post3.sh

cd /Comskip
./autogen.sh
./configure
make install

fetch https://raw.githubusercontent.com/pawhite/Commercialcut/master/comskip.ini
 

and the new post3.sh looks like this:

#!/bin/sh

PATH=$PATH:/usr/local/bin:/usr/bin

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH

lockfile="/tmp/post.lock"
while [ -f "$lockfile" ]; do
    echo "Waiting"
    sleep 5
done

touch "$lockfile"

infile=$1
outfile="$infile"
show=`basename "$infile"`
edlfile="/tmp/${show%.*}.edl"
metafile="/tmp/${show%.*}.ffmeta"
logfile="/tmp/${show%.*}.log"
logofile="/tmp/${show%.*}.logo.txt"
txtfile="/tmp/${show%.*}.txt"
showfile="/tmp/${show%.*}_a.txt"
chapterfile=""
a="${infile%.*}.mkv"

i=0
start=0
hascommercials=false
totalcutduration=0

writefiles()
    {
	echo [CHAPTER] >> "$metafile"
    	echo TIMEBASE=1/1000 >> "$metafile"
    	echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo "title=Chapter $i" >> "$metafile"
        printf "file '%s'\n" "$chapterfile" >> "$showfile"
    	duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    	/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss $start -t $duration -c copy -y "$chapterfile"
    }


/usr/local/bin/comskip --output=/tmp --ini=/Comskip/comskip.ini "$infile"

echo ";FFMETADATA1" > "$metafile"
# Reads in from $edlfile, see end of loop.
while IFS=$'\t\n' read -r end startnext c _; 
do
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    hascommercials=true
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
    totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk  '{print $1 + $2 - $3}'`
  fi
  start=$startnext
done < "$edlfile"

#dont forget to add the final part from last commercial to end of file
if [ $hascommercials=true ]
  then
  end=`/usr/local/bin/ffmpeg -hide_banner -nostdin -i "$infile" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{ printf "%f", ($1*3600)+($2*60)+$3 }'`
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
  fi
fi
    
/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -f concat -safe 0 -i "$showfile" -c copy -y "$outfile"

/usr/local/bin/ffmpeg -i "$outfile" -vf yadif -c:v libx264 -preset slow -crf 18 -max_muxing_queue_size 1024 -c:a copy "$a"

export LD_LIBRARY_PATH="$ldPath"
rm "$edlfile"
rm "$metafile"
rm "$logfile"
rm "$logofile"
rm "$txtfile"
rm /tmp/part-*.ts
rm "$showfile"
rm "$lockfile"

My post.sh file looks like this now but with added commands to move files around where I want them.  You can put whatever commands are in your post.sh file into this option (like a call to Handbrake instead of the last call to ffmpeg) or whatever else you would like.  I would simply add them prior to resetting the library path and removing the other files at the end but after the call the ffmpeg to create "outfile".  "Outfile" will be the input for ffmpeg or handbrake.  You can call the output anything -- this example uses "a" as the variable name.

 

I haven't actually tested this aside from making sure that it installs everything.

 

ETA: OK, tested, and all works.  Components installed, cuts commercials and converts to mkv (and removes the original .ts file).

Edited by PhilWhite
  • Like 1
Link to comment
Share on other sites

  • 7 months later...
Baenwort

Last update for a while probably.  I created a new script for installing all the needed components (there are two options, the original called package.sh and the new one called package2.sh); it uses the pared-down version of Brett Sheleski's comcut with a call to ffmpeg to convert files to .mkv.  You could use this as your post-processing file if you wish; just place it (called post3.sh) in the post-processing section of the DVR in the emby dashboard.  I left the package installer script in csh for no particular reason other than laziness.

 

To install, just do the usual -- open a shell in Freenas, then iocage console <jailname>, then cd /, then:

fetch -o - https://raw.githubusercontent.com/pawhite/Commercialcut/master/package2.sh | csh

And that should install everything.  This version removes bash and the need to clone comchap/comcut.  Most of the packages that need to be installed are simply there to enable comskip to be compiled and to work.

 

The script looks like this:

#!/bin/csh

set path = ($path /usr/local/bin)

cd /
pkg install -y git
pkg install -y argtable
pkg install -y autoconf
pkg install -y automake
pkg install -y libtool
pkg install -y ffmpeg

echo y | pkg set -o devel/pkg-config:devel/pkgconf
echo y | pkg install -f devel/pkgconf

setenv CC clang

/usr/local/bin/git clone https://github.com/erikkaashoek/Comskip
fetch https://raw.githubusercontent.com/pawhite/Commercialcut/master/post3.sh
chmod +x /post3.sh

cd /Comskip
./autogen.sh
./configure
make install

fetch https://raw.githubusercontent.com/pawhite/Commercialcut/master/comskip.ini
 

and the new post3.sh looks like this:

#!/bin/sh

PATH=$PATH:/usr/local/bin:/usr/bin

#LD_LIBRARY_PATH is set and will mess up ffmpeg, unset it, then re-set it when done
ldPath=${LD_LIBRARY_PATH}
unset LD_LIBRARY_PATH

lockfile="/tmp/post.lock"
while [ -f "$lockfile" ]; do
    echo "Waiting"
    sleep 5
done

touch "$lockfile"

infile=$1
outfile="$infile"
show=`basename "$infile"`
edlfile="/tmp/${show%.*}.edl"
metafile="/tmp/${show%.*}.ffmeta"
logfile="/tmp/${show%.*}.log"
logofile="/tmp/${show%.*}.logo.txt"
txtfile="/tmp/${show%.*}.txt"
showfile="/tmp/${show%.*}_a.txt"
chapterfile=""
a="${infile%.*}.mkv"

i=0
start=0
hascommercials=false
totalcutduration=0

writefiles()
    {
	echo [CHAPTER] >> "$metafile"
    	echo TIMEBASE=1/1000 >> "$metafile"
    	echo START=`echo "$start  $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo END=`echo "$end $totalcutduration" | awk  '{printf "%i", ($1 - $2) * 1000}'` >> "$metafile"
    	echo "title=Chapter $i" >> "$metafile"
        printf "file '%s'\n" "$chapterfile" >> "$showfile"
    	duration=`echo "$end" "$start" | awk  '{printf "%f", $1 - $2}'`
    	/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -i "$infile" -ss $start -t $duration -c copy -y "$chapterfile"
    }


/usr/local/bin/comskip --output=/tmp --ini=/Comskip/comskip.ini "$infile"

echo ";FFMETADATA1" > "$metafile"
# Reads in from $edlfile, see end of loop.
while IFS=$'\t\n' read -r end startnext c _; 
do
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    hascommercials=true
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
    totalcutduration=`echo "$totalcutduration" "$startnext" "$end" | awk  '{print $1 + $2 - $3}'`
  fi
  start=$startnext
done < "$edlfile"

#dont forget to add the final part from last commercial to end of file
if [ $hascommercials=true ]
  then
  end=`/usr/local/bin/ffmpeg -hide_banner -nostdin -i "$infile" 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F: '{ printf "%f", ($1*3600)+($2*60)+$3 }'`
  if [ `echo "$end" | awk '{printf "%i", $0 * 1000}'` -gt `echo "$start" | awk '{printf "%i", $0 * 1000}'` ]
    then
    i=$((i + 1))
    chapterfile=/tmp/part-$i.ts
    writefiles $end $start $totalcutduration $i "$metafile" "$chapterfile" "$showfile"
  fi
fi
    
/usr/local/bin/ffmpeg -hide_banner -loglevel error -nostdin -f concat -safe 0 -i "$showfile" -c copy -y "$outfile"

/usr/local/bin/ffmpeg -i "$outfile" -vf yadif -c:v libx264 -preset slow -crf 18 -max_muxing_queue_size 1024 -c:a copy "$a"

export LD_LIBRARY_PATH="$ldPath"
rm "$edlfile"
rm "$metafile"
rm "$logfile"
rm "$logofile"
rm "$txtfile"
rm /tmp/part-*.ts
rm "$showfile"
rm "$lockfile"

My post.sh file looks like this now but with added commands to move files around where I want them.  You can put whatever commands are in your post.sh file into this option (like a call to Handbrake instead of the last call to ffmpeg) or whatever else you would like.  I would simply add them prior to resetting the library path and removing the other files at the end but after the call the ffmpeg to create "outfile".  "Outfile" will be the input for ffmpeg or handbrake.  You can call the output anything -- this example uses "a" as the variable name.

 

I haven't actually tested this aside from making sure that it installs everything.

 

ETA: OK, tested, and all works.  Components installed, cuts commercials and converts to mkv (and removes the original .ts file).

 

Thanks for this @@PhilWhite.

 

If I want to switch from cutting the commercials to marking them as chapters so they can be skipped I would install comchap and replace mentions of comcut with comchap? I would use package.sh instead of your newer second one as I don't see a mention of Comcut in version 2 or post3.sh?

 

Also, it looks like in comskip.ini you have a extra line end that breaks line 71 

cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\"" 

into two lines. This used to cause a problem in the older version of comskip.ini you started with. I submitted a pull request on git?

Edited by Baenwort
Link to comment
Share on other sites

PhilWhite

Thanks for this @@PhilWhite.

 

If I want to switch from cutting the commercials to marking them as chapters so they can be skipped I would install comchap and replace mentions of comcut with comchap? I would use package.sh instead of your newer second one as I don't see a mention of Comcut in version 2 or post3.sh?

 

Also, it looks like in comskip.ini you have a extra line end that breaks line 71 

cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\"" 

into two lines. This used to cause a problem in the older version of comskip.ini you started with. I submitted a pull request on git?

 

Hi Baenwort, happy New Year.

 

Yes, if you want to mark commercials and not cut them, then use comchap.

 

This version does not call on comcut because it is my altered version of comcut that does not require bash to run.  I was trying to pare down the number of dependencies to set this up.

 

I'll have to look at comskip.ini, thanks.

Link to comment
Share on other sites

Baenwort

Hi Baenwort, happy New Year.

 

Yes, if you want to mark commercials and not cut them, then use comchap.

 

This version does not call on comcut because it is my altered version of comcut that does not require bash to run.  I was trying to pare down the number of dependencies to set this up.

 

I'll have to look at comskip.ini, thanks.

 

I've also run into a problem with your closing rm "/tmp/part-*.ts" does not work when executed from the script. 

 

When I run it manually from the shell it works correctly but when using the post3.sh it throws an error about the /tmp/part-*.ts which is odd to me as I've never run across a command that works in the CLI but doesn't when placed in a .sh and run that way.

 

My solution is to replace it with a looping if statement that rolls backwards from the $i variable you used in the merging of the part files and exits when $i is no longer greater than 0.

Edited by Baenwort
Link to comment
Share on other sites

PhilWhite

I've also run into a problem with your closing rm "/tmp/part-*.ts" does not work when executed from the script. 

 

When I run it manually from the shell it works correctly but when using the post3.sh it throws an error about the /tmp/part-*.ts which is odd to me as I've never run across a command that works in the CLI but doesn't when placed in a .sh and run that way.

 

My solution is to replace it with a looping if statement that rolls backwards from the $i variable you used in the merging of the part files and exits when $i is no longer greater than 0.

Good solution.

 

Not sure why that throws an error.  I've not seen one, and it removes all those files, which is why I left it in that form.  Might be best to switch to the loop, though, since it caused an error on your system.

 

My youngest has been learning C# for work, so I might get her to translate this to C#.  I got bogged down learning C and lost interest, I'm afraid.

Link to comment
Share on other sites

  • 2 weeks later...
Baenwort

So I had my first failed encode last night. The commercial cutting was successful but the encoding to 264 failed. However, there is no escape from the clean up at the bottom if ffmpeg or handbrake throw an error. This resulted in the .ts being discarded and the failed (1/4 size) mp4 file being left behind.

root@emby_2:/ # sh post3.sh "/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts"
Comskip 0.82.010, made using ffmpeg
Donator build
The commandline used was:
/usr/local/bin/comskip --output=/tmp --ini=/Comskip/comskip.ini "/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts"

Setting ini file to /Comskip/comskip.ini as per commandline
Using /Comskip/comskip.ini for initiation values.
Mpeg:   /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts
Exe     comskip.exe
Logo:   /tmp/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.logo.txt
Ini:    /Comskip/comskip.ini

Detection Methods to be used:
        1) Black Frame
        2) Logo - Give up after 2000 seconds
        3) Resolution Change
        4) Aspect Ratio


ComSkip throttles back from -0001 to -0001.
The time is now 0022 so it's full speed ahead!

Settings
--------
[Main Settings]
;the sum of the values for which kind of frames comskip will consider as possible cutpoints: 1=uniform (black or any other color) frame, 2=logo, 4=scene change, 8=resolution change, 16=closed captions, 32=aspect ration, 64=silence, 255=all.
detect_method=43
;Set to 10 to show a lot of extra info, level 5 is also OK, set to 0 to disable
verbose=10
;Frame not black if any of the pixels of the frame has a brightness greater than this (scale 0 to 255)
max_brightness=60
maxbright=1
;Frame not pure black if a small number of the pixels of the frame has a brightness greater than this. To decide if the frame is truly black, comskip will also check average brightness (scale 0 to 255)
test_brightness=40
;
max_avg_brightness=25
;
max_commercialbreak=600
;
min_commercialbreak=25
;
max_commercial_size=125
;
min_commercial_size=4
;
min_show_segment_length=250
;
max_volume=0
;
max_silence=100
;
non_uniformity=500
[Detailed Settings]
min_silence=12
remove_silent_segments=0
noise_level=5
brightness_jump=200
fps=1
validate_silence=1
validate_uniform=1
validate_scenechange=1
global_threshold=1.05
disable_heuristics=4
cut_on_ac_change=1
[CPU Load Reduction]
thread_count=2
hardware_decode=0
play_nice_start=-1
play_nice_end=-1
play_nice_sleep=2
[Input Correction]
max_repair_size=200
ms_audio_delay=5
volume_slip=40
lowres=0
skip_b_frames=0
[Aspect Ratio]
ar_delta=0.08
cut_on_ar_change=1
[Global Removes]
padding=0
remove_before=0
remove_after=0
added_recording=14
delete_show_after_last_commercial=0
delete_show_before_first_commercial=0
delete_show_before_or_after_current=0
delete_block_after_commercial=0
min_commercial_break_at_start_or_end=39
always_keep_first_seconds=0
always_keep_last_seconds=0
[USA Specific]
intelligent_brightness=1
black_percentile=0.0076
uniform_percentile=0.003
score_percentile=0.71
[Main Scoring]
length_strict_modifier=3
length_nonstrict_modifier=1.5
combined_length_strict_modifier=2
combined_length_nonstrict_modifier=1.25
ar_wrong_modifier=2
ac_wrong_modifier=1
excessive_length_modifier=0.01
dark_block_modifier=0.3
min_schange_modifier=0.5
max_schange_modifier=2
logo_present_modifier=0.01
punish_no_logo=1
[Detailed Scoring]
punish=0
reward=0
punish_threshold=1.3
punish_modifier=2
reward_modifier=0.5
[Logo Finding]
border=10
give_up_logo_search=2000
delay_logo_search=0
logo_max_percentage_of_screen=0.12
ticker_tape=0
ticker_tape_percentage=0
top_ticker_tape=0
top_ticker_tape_percentage=0
ignore_side=0
ignore_left_side=0
ignore_right_side=0
subtitles=0
logo_at_bottom=0
logo_threshold=0.75
logo_percentage_threshold=0.25
logo_filter=0
aggressive_logo_rejection=0
edge_level_threshold=5
edge_radius=2
edge_weight=10
edge_step=1
num_logo_buffers=50
use_existing_logo_file=1
two_pass_logo=1
[Logo Interpretation]
connect_blocks_with_logo=1
logo_percentile=0.92
logo_fraction=0.4
shrink_logo=5
shrink_logo_tail=0
before_logo=0
after_logo=0
where_logo=0
min_black_frames_for_break=1
[Closed Captioning]
ccCheck=0
cc_commercial_type_modifier=4
cc_wrong_type_modifier=2
cc_correct_type_modifier=0.75
[Live TV]
live_tv=0
live_tv_retries=4
require_div5=0
div5_tolerance=-1
incommercial_frames=1000
[Output Control]
output_default=1
output_chapters=0
output_plist_cutlist=0
output_zoomplayer_cutlist=0
output_zoomplayer_chapter=0
output_scf=0
output_vcf=0
output_vdr=0
output_projectx=0
output_avisynth=0
output_videoredo=0
output_videoredo3=0
videoredo_offset=2
output_btv=0
output_edl=1
output_live=0
edl_offset=0
timeline_repair=1
edl_skip_field=0
output_edlp=0
output_bsplayer=0
output_edlx=0
output_cuttermaran=0
output_mpeg2schnitt=0
output_womble=0
output_mls=0
output_mpgtx=0
output_dvrmstb=0
output_dvrcut=0
output_ipodchap=0
output_framearray=0
output_debugwindow=0
output_tuning=0
output_training=0
output_false=0
output_aspect=0
output_demux=0
output_data=0
output_srt=0
output_smi=0
output_timing=0
output_incommercial=0
output_ffmeta=0
output_ffsplit=0
delete_logo_file=0
output_mkvtoolnix=0
cutscene_frame=0
cutscene_threshold=10
windowtitle="Comskip - %s"
cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\""
mpeg2schnitt_options="mpeg2schnitt.exe /S /E /R25 /Z %2 %1"
avisynth_options="LoadPlugin(\"MPEG2Dec3.dll\") \nMPEG2Source(\"%s\")\n"
dvrcut_options="dvrcut \"%s.dvr-ms\" \"%s_clean.dvr-ms\" "
[Sage Workarounds]
sage_framenumber_bug=0
sage_minute_bug=0
enable_mencoder_pts=0

Input #0, mpegts, from '/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts':
  Duration: 01:30:39.66, start: 1.400000, bitrate: 2158 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 704x480 [SAR 40:33 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
[mpeg2video @ 0x80ac16500] gray decoding requested but not enabled at configuration time
Frame Rate set to 29.970 f/s

Initial audio pts =      0.000
Format changed to [704 : 480]
Frame: 1        Ratio: 1.16     MinY: 1 MaxY: 480 MinX: 86 MaxX: 618
Frame: 1 Channels:  2
Resizing scene change array to accomodate 2000 frames.

Looking For Logo in frames 29 to 1450.
Edge count - 3128       Percentage of screen - 1.11%, Check: 0
Double checking - 1

Looking For Logo in frames 58 to 1479.
Edge count - 3130       Percentage of screen - 1.11%, Check: 1
Double checking - 2
Doublechecking frames 58 to 1479 for logo.
78901234567890123456789012345678901234567890123456789012345678901234567890123
369:
370:
371:
372:
373:        --
374:        -+        --
375:      ||++ |    -----
376:      ||++|||  ++-+---      ----
377:      ||++||| |++++++++   -------     --
378:      |||||| |++++++++++| +-++++++   -----    -
379:      ||||||||++++--++++|+++++++++| |-+---   -----
380:      ||||||||++++--++++|++++-+++++||++++++||-+---   -------
381:      ||||||||++|-++++++|+++---++++|++++++||+++++++|-++-+---  --------
382:      |||||||||||-+++||+|++|-+--|++|++||+++|++++++|+++++++++++---------
383:      |||||||||||-++|++|+++|+++++++|+||||++++|+++||++++--+++++++----+---
384:      |||||||||||++|+++|||||++-|||||||||||+|++|||||++++---++++++-----+++||
385:      ||||||||||||++||++||||+++||||||||||||||||||||+|||-++++++++----++++||
386:      ||||||||||||||++-+||||||||||||||||||++||||||||||| ++-++++-||||++++|
387:     ||||||||||||||+++-+|||||++||||||||||||+|| |||||||||++++++++||||+++||
388:     ||||||||||||||+++++|||||||||| ||||| | +|| ||||||||||+----++||||+++|
389:     ||||||||||||||+--++||||||||||||||||||-||| |||||||||++-  -++||||+++
390:     ||||||||||||||+--+|||||||||||||||||-|||||-|||||||||++-  ||||||||+|
391:     |||||||||||||||   |||||||||||||||||-|||+|+|||||||| +++|| |||||||||
392:     |||||||||||||||   |||||||||||||||||++ - |+|||||||| ++++|||||||||||
393:     |||||||||||||||  ||||||||||||||||||||| -|||||||||| +++||||||||||||
394:     |||||||||||||||  |||||||||||||||||||+|-- ||||||||||+++||||||||||||
395:     |||||||||||||||  |||||||||||||||||||||++ ||||||||||+++  ||||||||||
396:      |||||||||||||| -++|||||||||||||||||+|+||||||||||||+++  ||||||||||
397:     |||||||||||||||--++|||||||||||||||||+||||||||||||||++|  ||||||||||
398:     ||||||||||||||+-+++||||||||||||||||||||||||||||||||||    |||||||||
399:     ||||||||||||||+++++||||||||||||||||||||||||||||||||++--- |||||||||
400:     ||||||||||||||+++++||||++||+||||||| ||||||||||||||+++---||||||||||
401:     ||||||||||||+++++++||||+++||+|||||||||||||||||||||++++++|||||+++||
402:      |||||||||||++++|||||||++++|+||||||||||||||||||||+---+++|||||+++||
403:      |||||||||||+++++++||+|--- +++||||| | ++||+++||||+---+-+|||+++++||
404:      |||||||||+++---+++|||-+--++++|||+++| ++| |+++|+++--++++|||++++++-
405:     |||||||||||++--++++|++++++++++||||-+++-++-+++|+++---++++|+++++++---
406:     ||||||||++||++-++++|+||-++++++|+++++++++++++++++++--++++-------+-+ |
407:     ||||||||+|++||++++|+++++-++++||+++++---+-+-- ------------+-+|---+++||
408:     ||||||||++++++++++ +++++++++   --- ---------------+++-++-------+++||
409:     ||||||| +++++++++   ++++--+   ------------++++++++++-----++++++++++
410:     ||||||| |+++-+|||   ----------------++++++++------+++-++---+------
411:     |||||||  -------------------++-++++++--------+++++---------------
412:     |||||++|-- --------------+-++-+----++-+++++--+------------
413:     |||+|+++-----+-+++++++++----+++++++++------------ -
414:     |||+|+++--+++++++----+++-++++++++------------
415:      ||+++++-++-----++++++++-------------
416:      |++++-+-++++-----------------
417:        +++-+--------------
418:        ------------
419:         ------
420:
421:
422:
423:
Logo found at frame 1479        logoMinX=497    logoMaxX=573    logoMinY=369    logoMaxY=423
******************* End of Logo Processing ***************
Frame: 1        Ratio: 1.16     MinY: 1 MaxY: 480 MinX: 86 MaxX: 618
Frame: 1 Channels:  2
 0:00:02 - 1552 frames in 1.00 sStart logo cblock 000 seframe 290 fps), 0%
Frame   3438 (114.648s) - Black frame with brightness of 16,uniform of 0 and volume of -737987527
Frame   3439 (114.681s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame   3440 (114.715s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame   3441 (114.748s) - Black frame with brightness of 18,uniform of 1298 and volume of -1

End logo block 0        frame 3302      Length - 0:01:44.23
Strange video pts step of 1.43974 instead of 0.03337 at frame 3529
Frame   3551 (120.044s) - Black frame with brightness of 16,uniform of 0 and volume of 2898
Frame   3552 (120.078s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame   3553 (120.112s) - Black frame with brightness of 19,uniform of 733 and volume of -1

                                Nonlogo Length - 0:00:11.44
Start logo cblock 1     frame 3596
Frame  27070 (917.048s) - Black frame with brightness of 16,uniform of 0 and volume of 726
Frame  27071 (917.081s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  27072 (917.115s) - Black frame with brightness of 21,uniform of 2683 and volume of -1

End logo block 1        frame 26937     Length - 0:13:06.01
Strange video pts step of 1.03168 instead of 0.03337 at frame 27151
Frame: 27151    Ratio: 1.47     MinY: 1 MaxY: 480       MinX: 1 MaxX: 704
Frame  27188 (922.013s) - Black frame with brightness of 16,uniform of 0 and volume of 776
Frame  27189 (922.046s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  27190 (922.080s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  27191 (922.113s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  27192 (922.146s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  27193 (922.180s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  27194 (922.213s) - Black frame with brightness of 17,uniform of 825 and volume of -1

                                Nonlogo Length - 0:00:10.90
Start logo cblock 2     frame 27231
Frame  33455 (1131.122s) - Black frame with brightness of 20,uniform of 2308 and volume of 2801
Frame  33456 (1131.156s) - Black frame with brightness of 20,uniform of 1666 and volume of -1
Frame  33457 (1131.189s) - Black frame with brightness of 19,uniform of 827 and volume of -1
Frame  33458 (1131.222s) - Black frame with brightness of 17,uniform of 252 and volume of -1
Frame  33459 (1131.256s) - Black frame with brightness of 17,uniform of 57 and volume of -1
Frame  33460 (1131.289s) - Black frame with brightness of 16,uniform of 19 and volume of -1
Frame  33461 (1131.322s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33462 (1131.356s) - Black frame with brightness of 16,uniform of 5 and volume of -1
Frame  33463 (1131.389s) - Black frame with brightness of 16,uniform of 1 and volume of -1
Frame  33464 (1131.423s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33465 (1131.456s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33466 (1131.489s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33467 (1131.523s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33468 (1131.556s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33469 (1131.589s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33470 (1131.623s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33471 (1131.656s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33472 (1131.690s) - Black frame with brightness of 16,uniform of 74 and volume of -1
Frame  33473 (1131.723s) - Black frame with brightness of 16,uniform of 24 and volume of -1
Frame  33474 (1131.756s) - Black frame with brightness of 16,uniform of 8 and volume of -1
Frame  33475 (1131.790s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33476 (1131.823s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33477 (1131.856s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33478 (1131.890s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33479 (1131.923s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33480 (1131.956s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33481 (1131.990s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33482 (1132.023s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33483 (1132.057s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33484 (1132.090s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33485 (1132.123s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33486 (1132.157s) - Black frame with brightness of 16,uniform of 1 and volume of -1
Frame  33487 (1132.190s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33488 (1132.223s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33489 (1132.257s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33490 (1132.290s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33491 (1132.323s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33492 (1132.357s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33493 (1132.390s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33494 (1132.424s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33495 (1132.457s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33496 (1132.490s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33497 (1132.524s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33498 (1132.557s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33499 (1132.590s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  33500 (1132.624s) - Black frame with brightness of 16,uniform of 6 and volume of -1
Frame  33501 (1132.657s) - Black frame with brightness of 16,uniform of 43 and volume of -1
Frame  33502 (1132.691s) - Black frame with brightness of 16,uniform of 217 and volume of -1
Frame: 421571646Ratio: 1.1120.80MinY: 10MaxY: 480, 1.00 MinX: 88.00 fps)MaxX: 616
Frame  45775 (1542.200s) - Black frame with brightness of 16,uniform of 0 and volume of 591
Frame  45776 (1542.233s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  45777 (1542.266s) - Black frame with brightness of 18,uniform of 1358 and volume of -1

End logo block 2        frame 45642     Length - 0:10:09.34
Frame: 45866    Ratio: 1.47     MinY: 1 MaxY: 480       MinX: 1 MaxX: 704
Frame  45920 (1547.480s) - Black frame with brightness of 16,uniform of 0 and volume of 508
Frame  45921 (1547.514s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  45922 (1547.547s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  45923 (1547.581s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  45924 (1547.614s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  45925 (1547.648s) - Black frame with brightness of 22,uniform of 3441 and volume of -1
 0:25:42 - 47694 frames in 23.77 sec(2006.48 fps), 1.00 sec(1912.00 fps), 28%
                                Nonlogo Length - 0:00:11.22
Start logo cblock 3     frame 45965
Strange video pts step of 2.30561 instead of 0.03337 at frame 62701 fps), 37%
Frame  62702 (2107.441s) - Black frame with brightness of 16,uniform of 0 and volume of 3012
Frame  62703 (2109.747s) - Black frame with brightness of 16,uniform of 1 and volume of -1
Frame  62704 (2109.786s) - Black frame with brightness of 23,uniform of 2490 and volume of -1

End logo block 3        frame 62549     Length - 0:09:08.38

                                Nonlogo Length - 0:00:09.23
Start logo cblock 4     frame 62756
Frame  77020 (2588.993s) - Black frame with brightness of 16,uniform of 0 and volume of 1135
Frame  77021 (2589.027s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  77022 (2589.060s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  77023 (2589.094s) - Black frame with brightness of 17,uniform of 848 and volume of -1

End logo block 4        frame 76846     Length - 0:07:45.16
Frame: 77026    Ratio: 1.12     MinY: 1 MaxY: 480       MinX: 86        MaxX: 620

                                Nonlogo Length - 0:00:08.38
Start logo cblock 5     frame 77053
Frame  80052 (2690.163s) - Black frame with brightness of 20,uniform of 1587 and volume of 1419
Frame  87980 (2959.866s) - Black frame with brightness of 16,uniform of 0 and volume of 1345
Frame  87981 (2959.899s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87982 (2959.933s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87983 (2959.966s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87984 (2960.000s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87985 (2960.033s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87986 (2960.066s) - Black frame with brightness of 16,uniform of 0 and volume of -1

End logo block 5        frame 87808     Length - 0:05:59.05
Frame  87987 (2960.100s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87988 (2960.133s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87989 (2960.166s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87990 (2960.200s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87991 (2960.233s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87992 (2960.266s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87993 (2960.300s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87994 (2960.333s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87995 (2960.367s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87996 (2960.400s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87997 (2960.433s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87998 (2960.467s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  87999 (2960.500s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88000 (2960.533s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88001 (2960.567s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88002 (2960.600s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88003 (2960.633s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88004 (2960.667s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88005 (2960.700s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88006 (2960.734s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88007 (2960.767s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88008 (2960.800s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88009 (2960.834s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88010 (2960.867s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88011 (2960.900s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88012 (2960.934s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88013 (2960.967s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88014 (2961.001s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88015 (2961.034s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88016 (2961.067s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88017 (2961.101s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88018 (2961.134s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88019 (2961.167s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88020 (2961.201s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88021 (2961.234s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88031 (2961.568s) - Black frame with brightness of 16,uniform of 0 and volume of 1699
Frame  88032 (2961.601s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  88033 (2961.634s) - Black frame with brightness of 16,uniform of 0 and volume of -1

                                Nonlogo Length - 0:00:07.87
Start logo cblock 6     frame 88044
Frame  92984 (3127.734s) - Black frame with brightness of 21,uniform of 3043 and volume of 1000
Frame  92985 (3127.767s) - Black frame with brightness of 17,uniform of 476 and volume of -1
Frame  92986 (3127.800s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92987 (3127.834s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92988 (3127.867s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92989 (3127.901s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92990 (3127.934s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92991 (3127.967s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92992 (3128.001s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92993 (3128.034s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92994 (3128.067s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92995 (3128.101s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92996 (3128.134s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92997 (3128.168s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92998 (3128.201s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  92999 (3128.234s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93000 (3128.268s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93001 (3128.301s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93002 (3128.334s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93003 (3128.368s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93004 (3128.401s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93005 (3128.434s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93006 (3128.468s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93007 (3128.501s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93008 (3128.535s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93009 (3128.568s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93010 (3128.601s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93011 (3128.635s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame  93012 (3128.668s) - Black frame with brightness of 21,uniform of 2106 and volume of -1
Resizing scene change array to accomodate 4000 frames.00 sec(2127.00 fps), 63%
Resizing frame array to accomodate 197893 frames.), 1.00 sec(1976.00 fps), 64%
Frame 108065 (3630.936s) - Black frame with brightness of 16,uniform of 0 and volume of 649
Frame 108066 (3630.970s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 108067 (3631.003s) - Black frame with brightness of 22,uniform of 1809 and volume of -1

End logo block 6        frame 107934    Length - 0:10:59.59
Strange video pts step of 2.19622 instead of 0.03337 at frame 108130
Frame 108133 (3635.374s) - Black frame with brightness of 16,uniform of 0 and volume of 461
Frame 108134 (3635.413s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 108135 (3635.451s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 108136 (3635.489s) - Black frame with brightness of 17,uniform of 881 and volume of -1
Frame 108137 (3635.526s) - Black frame with brightness of 22,uniform of 3330 and volume of -1

                                Nonlogo Length - 0:00:10.09
Start logo cblock 7     frame 108170
Frame: 119599036Ratio: 0.00 60.4MinY: 3492.12 fpMaxY: 448sec(1964.00 fps), 72%
Frame: 121321235Ratio: 1.10 61.4MinY: 19MaxY: 480), 1.00MinX: 882.00 fpsMaxX: 616
 1:09:30 - 126468 frames in 63.42 sec(1994.13 fps), 1.00 sec(2034.00 fps), 76%
End logo block 7        frame 125972    Length - 0:09:49.02
Frame 126158 (4237.971s) - Black frame with brightness of 16,uniform of 0 and volume of 345
Frame 126159 (4238.004s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 126160 (4238.037s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 126161 (4238.071s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 126162 (4238.104s) - Black frame with brightness of 22,uniform of 3858 and volume of -1

                                Nonlogo Length - 0:00:08.98
Start logo cblock 8     frame 126208
Frame: 138460863Ratio: 0.00 69.4MinY: 1897.10 fpMaxY: 450sec(2161.00 fps), 84%
Frame 138857 (4661.694s) - Black frame with brightness of 16,uniform of 0 and volume of 1973
Frame 138858 (4661.727s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138859 (4661.761s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138860 (4661.794s) - Black frame with brightness of 18,uniform of 927 and volume of -1

End logo block 8        frame 138703    Length - 0:06:51.94
Strange video pts step of 1.30094 instead of 0.03337 at frame 138936
Frame: 138937   Ratio: 1.47     MinY: 1 MaxY: 480       MinX: 1 MaxX: 704
Frame 138964 (4666.560s) - Black frame with brightness of 16,uniform of 0 and volume of 151
Frame 138965 (4666.593s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138966 (4666.627s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138967 (4666.660s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138968 (4666.694s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138969 (4666.727s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138970 (4666.761s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 138971 (4666.794s) - Black frame with brightness of 18,uniform of 1311 and volume of -1
Frame 138972 (4666.828s) - Black frame with brightness of 22,uniform of 5511 and volume of -1
 1:17:23 - 140647 frames in 70.42 sec(1997.26 fps), 1.00 sec(2008.00 fps), 85%
                                Nonlogo Length - 0:00:12.07
Start logo cblock 9     frame 139026
Frame 152193 (5109.671s) - Black frame with brightness of 23,uniform of 2864 and volume of 1916
Frame: 154502594Ratio: 1.10 77.4MinY: 10MaxY: 480), 1.00MinX: 905.00 fpsMaxX: 618
Frame 159993 (5370.331s) - Black frame with brightness of 16,uniform of 455 and volume of 1331
Frame 159994 (5370.365s) - Black frame with brightness of 16,uniform of 271 and volume of -1
Frame 159995 (5370.398s) - Black frame with brightness of 16,uniform of 145 and volume of -1
Frame 159996 (5370.432s) - Black frame with brightness of 16,uniform of 60 and volume of -1
Frame 159997 (5370.465s) - Black frame with brightness of 16,uniform of 22 and volume of -1
Frame 159998 (5370.498s) - Black frame with brightness of 16,uniform of 22 and volume of -1
Frame 159999 (5370.532s) - Black frame with brightness of 16,uniform of 22 and volume of -1
Frame 160000 (5370.565s) - Black frame with brightness of 16,uniform of 21 and volume of -1
Frame 160001 (5370.598s) - Black frame with brightness of 16,uniform of 22 and volume of -1
Frame 160002 (5370.632s) - Black frame with brightness of 16,uniform of 20 and volume of -1
Frame 160003 (5370.665s) - Black frame with brightness of 16,uniform of 20 and volume of -1
Frame 160004 (5370.698s) - Black frame with brightness of 16,uniform of 19 and volume of -1
Frame 160005 (5370.732s) - Black frame with brightness of 16,uniform of 18 and volume of -1
Frame 160006 (5370.765s) - Black frame with brightness of 16,uniform of 18 and volume of -1
Frame 160007 (5370.799s) - Black frame with brightness of 16,uniform of 17 and volume of -1
Frame 160008 (5370.832s) - Black frame with brightness of 16,uniform of 16 and volume of -1
Frame 160009 (5370.865s) - Black frame with brightness of 16,uniform of 16 and volume of -1
Frame 160010 (5370.899s) - Black frame with brightness of 16,uniform of 15 and volume of -1
Frame 160011 (5370.932s) - Black frame with brightness of 16,uniform of 15 and volume of -1
Frame 160012 (5370.965s) - Black frame with brightness of 16,uniform of 13 and volume of -1
Frame 160013 (5370.999s) - Black frame with brightness of 16,uniform of 14 and volume of -1
Frame 160014 (5371.032s) - Black frame with brightness of 16,uniform of 13 and volume of -1
Frame 160015 (5371.066s) - Black frame with brightness of 16,uniform of 12 and volume of -1
Frame 160016 (5371.099s) - Black frame with brightness of 16,uniform of 12 and volume of -1
Frame 160017 (5371.132s) - Black frame with brightness of 16,uniform of 11 and volume of -1
Frame 160018 (5371.166s) - Black frame with brightness of 16,uniform of 10 and volume of -1
Frame 160019 (5371.199s) - Black frame with brightness of 16,uniform of 10 and volume of -1
Frame 160020 (5371.232s) - Black frame with brightness of 16,uniform of 9 and volume of -1
Frame 160021 (5371.266s) - Black frame with brightness of 16,uniform of 8 and volume of -1
Frame 160022 (5371.299s) - Black frame with brightness of 16,uniform of 8 and volume of -1
Frame 160023 (5371.332s) - Black frame with brightness of 16,uniform of 7 and volume of -1
Frame 160024 (5371.366s) - Black frame with brightness of 16,uniform of 6 and volume of -1
Frame 160025 (5371.399s) - Black frame with brightness of 16,uniform of 5 and volume of -1
Frame 160026 (5371.433s) - Black frame with brightness of 16,uniform of 5 and volume of -1
Frame 160027 (5371.466s) - Black frame with brightness of 16,uniform of 3 and volume of -1
Frame 160028 (5371.499s) - Black frame with brightness of 16,uniform of 3 and volume of -1
Frame 160029 (5371.533s) - Black frame with brightness of 16,uniform of 2 and volume of -1
Frame 160030 (5371.566s) - Black frame with brightness of 16,uniform of 2 and volume of -1
Frame 160031 (5371.599s) - Black frame with brightness of 16,uniform of 1 and volume of -1
Frame 160032 (5371.633s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160033 (5371.666s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160034 (5371.699s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160035 (5371.733s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160036 (5371.766s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160037 (5371.800s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160038 (5371.833s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160039 (5371.866s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160040 (5371.900s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160041 (5371.933s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160042 (5371.966s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160043 (5372.000s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160044 (5372.033s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160045 (5372.067s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160046 (5372.100s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160047 (5372.133s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160048 (5372.167s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160049 (5372.200s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160050 (5372.233s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160051 (5372.267s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160052 (5372.300s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160053 (5372.333s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160054 (5372.367s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160055 (5372.400s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160056 (5372.434s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160057 (5372.467s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160058 (5372.500s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160059 (5372.534s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160060 (5372.567s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160061 (5372.600s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160062 (5372.634s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160063 (5372.667s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160064 (5372.700s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160065 (5372.734s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160066 (5372.767s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160067 (5372.801s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160068 (5372.834s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160069 (5372.867s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160070 (5372.901s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160071 (5372.934s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160072 (5372.967s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160073 (5373.001s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160074 (5373.034s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160075 (5373.068s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160076 (5373.101s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160077 (5373.134s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160078 (5373.168s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160079 (5373.201s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160080 (5373.234s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160081 (5373.268s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160082 (5373.301s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160083 (5373.334s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160084 (5373.368s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160085 (5373.401s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160086 (5373.435s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160087 (5373.468s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160088 (5373.501s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160089 (5373.535s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160090 (5373.568s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160091 (5373.601s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160092 (5373.635s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160093 (5373.668s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160094 (5373.701s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160095 (5373.735s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160096 (5373.768s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160097 (5373.802s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160098 (5373.835s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160099 (5373.868s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160100 (5373.902s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160101 (5373.935s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160102 (5373.968s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160103 (5374.002s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160104 (5374.035s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160105 (5374.069s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160106 (5374.102s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160107 (5374.135s) - Black frame with brightness of 16,uniform of 0 and volume of -1
Frame 160108 (5374.169s) - Black frame with brightness of 16,uniform of 148 and volume of -1
Frame 160109 (5374.202s) - Black frame with brightness of 16,uniform of 534 and volume of -1
Frame 160110 (5374.235s) - Black frame with brightness of 17,uniform of 906 and volume of -1
Frame 160111 (5374.269s) - Black frame with brightness of 18,uniform of 1212 and volume of -1
 1:29:45 - 162877 frames in 80.42 sec(2025.33 fps), 1.00 sec(2095.00 fps), 99%
End logo block 9        frame 161758    Length - 0:12:35.62
[mpeg2video @ 0x80ac16500] invalid cbp -1 at 15 18
[mpeg2video @ 0x80ac16500] Warning MVs not available
[ac3 @ 0x80ac16f00] incomplete frame

163437 frames decoded in 80.68 seconds (2025.74 fps)

Parsed 161958 video frames and 182187 audio frames at  2025.74 fps

Maximum Volume found is 11233
Finished scanning file.  Starting to build Commercial List.
WARNING: Complex timeline or errors in the recording!!!!
Results may be wrong, .ref input will be misaligned. .txt editing will produce wrong results
Use .edl output if possible
Platau@[45980] frames 7, volume 9, distance 1549 seconds
Platau@[51213] frames 7, volume 142, distance 174 seconds
Platau@[62750] frames 12, volume 0, distance 387 seconds
Platau@[88039] frames 47, volume 7, distance 850 seconds
Platau@[93041] frames 19, volume 11, distance 167 seconds
Platau@[99935] frames 8, volume 4, distance 230 seconds
Platau@[139013] frames 7, volume 0, distance 1308 seconds
Vol : #Frames
  0 : 5
 10 : 1
140 : 1
Calculated silence level = 10
Logo Histogram - 0.00147
0.000 -    232 - 0.00143 *
0.050 -     29 - 0.00161 *
0.100 -    116 - 0.00233 *
0.150 -      0 - 0.00233
0.200 -     29 - 0.00251 *
0.250 -      0 - 0.00251
0.300 -      0 - 0.00251
0.350 -     29 - 0.00269 *
0.400 -     51 - 0.00300 *
0.450 -      0 - 0.00300
0.500 -    116 - 0.00372 *
0.550 -     29 - 0.00390 *
0.600 -    116 - 0.00461 *
0.650 -     29 - 0.00479 *
0.700 -      0 - 0.00479
0.750 -      0 - 0.00479
0.800 -    232 - 0.00622 *
0.850 -   1566 - 0.01589 ***
0.900 - 135691 - 0.85371 *********************************************************************************************************************************************************************************************************
0.950 -  23692 - 0.99999 ***********************************
Set Logo Quality = 0.77500

Not enough or too much logo's found (0.97), disabling the use of Logo detection
The last ar cblock wasn't closed.  Now closing.


After Sorting - 3
--------------
Audio channels   2 found on 161958 frames totalling     100.0%

Printing AC cblock list
-----------------------------------------
Block: 0        Start:      1   End: 161958     audio channels:  2      Length: 1:30:37.19
The last ar cblock wasn't closed.  Now closing.

Printing AR cblock list before cleaning
-----------------------------------------
Block: 0        Start:      1   End:  27150     AR_R: 1.16      Length: 0:15:19.75, [ 704x 480] minX= 86, minY=  1, maxX=618, maxY=480
Block: 1        Start:  27151   End:  42156     AR_R: 1.47      Length: 0:08:21.69, [ 704x 480] minX=  1, minY=  1, maxX=704, maxY=480
Block: 2        Start:  42157   End:  45865     AR_R: 1.11      Length: 0:02:03.72, [ 704x 480] minX= 88, minY=  1, maxX=616, maxY=480
Block: 3        Start:  45866   End:  77025     AR_R: 1.47      Length: 0:17:23.92, [ 704x 480] minX=  1, minY=  1, maxX=704, maxY=480
Block: 4        Start:  77026   End: 119513     AR_R: 1.12      Length: 0:23:45.94, [ 704x 480] minX= 86, minY=  1, maxX=620, maxY=480
Block: 5        Start: 119514   End: 121320     AR_R: 0.00      Length: 0:01:00.26, [ 704x 480] minX= 84, minY= 34, maxX=612, maxY=448
Block: 6        Start: 121321   End: 138379     AR_R: 1.10      Length: 0:09:30.27, [ 704x 480] minX= 88, minY=  1, maxX=616, maxY=480
Block: 7        Start: 138380   End: 138936     AR_R: 0.00      Length: 0:00:18.55, [ 704x 480] minX= 86, minY= 18, maxX=618, maxY=450
Block: 8        Start: 138937   End: 154501     AR_R: 1.47      Length: 0:08:41.45, [ 704x 480] minX=  1, minY=  1, maxX=704, maxY=480
Block: 9        Start: 154502   End: 161958     AR_R: 1.10      Length: 0:04:10.04, [ 704x 480] minX= 90, minY=  1, maxX=618, maxY=480


After Sorting - 95
--------------
Aspect Ratio   1.12 found on  23528 frames totalling    88.1%
Aspect Ratio   1.11 found on   1971 frames totalling    95.5%
Aspect Ratio   1.10 found on    381 frames totalling    96.9%
Aspect Ratio   1.47 found on    162 frames totalling    97.5%
Aspect Ratio   1.15 found on    110 frames totalling    97.9%
Aspect Ratio   1.24 found on     94 frames totalling    98.3%
Aspect Ratio   1.09 found on     82 frames totalling    98.6%
Aspect Ratio   1.17 found on     41 frames totalling    98.7%
Aspect Ratio   1.16 found on     34 frames totalling    98.9%
Aspect Ratio   1.32 found on     27 frames totalling    99.0%
Aspect Ratio   1.18 found on     24 frames totalling    99.1%
Aspect Ratio   1.14 found on     23 frames totalling    99.1%
Aspect Ratio   1.07 found on     22 frames totalling    99.2%
Aspect Ratio   1.27 found on     22 frames totalling    99.3%
Aspect Ratio   1.08 found on     21 frames totalling    99.4%
Aspect Ratio   1.30 found on     21 frames totalling    99.5%
Aspect Ratio   1.25 found on     20 frames totalling    99.5%
Aspect Ratio   1.28 found on     19 frames totalling    99.6%
Aspect Ratio   1.26 found on     16 frames totalling    99.7%
Aspect Ratio   1.29 found on     14 frames totalling    99.7%
Aspect Ratio   0.96 found on     12 frames totalling    99.8%
Aspect Ratio   1.31 found on     10 frames totalling    99.8%
Aspect Ratio   0.94 found on      8 frames totalling    99.8%
Aspect Ratio   0.97 found on      8 frames totalling    99.9%
Aspect Ratio   1.19 found on      7 frames totalling    99.9%
Aspect Ratio   1.04 found on      3 frames totalling    99.9%
Aspect Ratio   1.05 found on      3 frames totalling    99.9%
Aspect Ratio   1.21 found on      3 frames totalling    99.9%
Aspect Ratio   1.03 found on      2 frames totalling    99.9%
Aspect Ratio   1.06 found on      2 frames totalling    99.9%
Aspect Ratio   1.20 found on      2 frames totalling    99.9%
Aspect Ratio   1.33 found on      2 frames totalling    100.0%
Aspect Ratio   1.46 found on      2 frames totalling    100.0%
Aspect Ratio   1.67 found on      2 frames totalling    100.0%
Aspect Ratio   0.99 found on      1 frames totalling    100.0%
Aspect Ratio   1.00 found on      1 frames totalling    100.0%
Aspect Ratio   1.01 found on      1 frames totalling    100.0%
Aspect Ratio   1.23 found on      1 frames totalling    100.0%
Aspect Ratio   1.34 found on      1 frames totalling    100.0%
Aspect Ratio   1.35 found on      1 frames totalling    100.0%
Aspect Ratio   1.44 found on      1 frames totalling    100.0%
Aspect Ratio   1.55 found on      1 frames totalling    100.0%


After Sorting - 97
--------------
Aspect Ratio   1.12 found on  97863 frames totalling    61.3%
Aspect Ratio   1.47 found on  61731 frames totalling    100.0%
Joining AR blocks 4 and 6 because they have a dummy cblock inbetween

Printing AR cblock list
-----------------------------------------
Block: 0        Start:      1   End:  27150     AR_R: 1.12      Length: 0:15:19.75, [ 704x 480] minX= 86, minY=  1, maxX=618, maxY=480
Block: 1        Start:  27151   End:  42156     AR_R: 1.47      Length: 0:08:21.69, [ 704x 480] minX=  1, minY=  1, maxX=704, maxY=480
Block: 2        Start:  42157   End:  45865     AR_R: 1.12      Length: 0:02:03.72, [ 704x 480] minX= 88, minY=  1, maxX=616, maxY=480
Block: 3        Start:  45866   End:  77025     AR_R: 1.47      Length: 0:17:23.92, [ 704x 480] minX=  1, minY=  1, maxX=704, maxY=480
Block: 4        Start:  77026   End: 138379     AR_R: 1.12      Length: 0:34:16.55, [ 704x 480] minX= 86, minY=  1, maxX=620, maxY=480
Block: 5        Start: 138380   End: 138936     AR_R: 0.00      Length: 0:00:18.55, [ 704x 480] minX= 86, minY= 18, maxX=618, maxY=450
Block: 6        Start: 138937   End: 154501     AR_R: 1.47      Length: 0:08:41.45, [ 704x 480] minX=  1, minY=  1, maxX=704, maxY=480
Block: 7        Start: 154502   End: 161958     AR_R: 1.12      Length: 0:04:10.04, [ 704x 480] minX= 90, minY=  1, maxX=618, maxY=480
Show Histogram - 0.03902
  0 -      0 - 0.00000
  1 -      0 - 0.00000
  2 -      0 - 0.00000
  3 -      0 - 0.00000
  4 -      0 - 0.00000
  5 -      0 - 0.00000
  6 -      0 - 0.00000
  7 -      0 - 0.00000
  8 -      0 - 0.00000
  9 -      0 - 0.00000
 10 -      0 - 0.00000
 11 -      0 - 0.00000
 12 -      0 - 0.00000
 13 -      0 - 0.00000
 14 -      0 - 0.00000
 15 -      0 - 0.00000
 16 -    276 - 0.00170 ***********
 17 -     11 - 0.00177 *
 18 -     16 - 0.00187 *
 19 -      7 - 0.00191 *
 20 -     10 - 0.00198 *
 21 -     18 - 0.00209 *
 22 -     30 - 0.00227 **
 23 -     72 - 0.00272 ***
 24 -     90 - 0.00327 ****
 25 -     44 - 0.00354 **
 26 -     90 - 0.00410 ****
 27 -     91 - 0.00466 ****
 28 -    137 - 0.00551 ******
 29 -    101 - 0.00613 ****
Setting brightness threshold to 30
Show Uniform - 0.74074
  0 -    270 - 0.00167 *********************************************************************************************************************************************************************************************************
100 -      2 - 0.00168 **
200 -      3 - 0.00170 ***
300 -      0 - 0.00170
400 -      2 - 0.00171 **
500 -      6 - 0.00175 *****
600 -      6 - 0.00178 *****
700 -      1 - 0.00179 *
800 -      4 - 0.00182 ***
900 -      4 - 0.00184 ***
1000 -      1 - 0.00185 *
1100 -      1 - 0.00185 *
1200 -      3 - 0.00187 ***
1300 -      2 - 0.00188 **
1400 -      1 - 0.00189 *
1500 -      2 - 0.00190 **
1600 -      3 - 0.00192 ***
1700 -      0 - 0.00192
1800 -      1 - 0.00193 *
1900 -      1 - 0.00193 *
2000 -      3 - 0.00195 ***
2100 -      6 - 0.00199 *****
2200 -      0 - 0.00199
2300 -      1 - 0.00199 *
2400 -      4 - 0.00202 ***
2500 -      0 - 0.00202
2600 -      1 - 0.00203 *
2700 -      1 - 0.00203 *
2800 -      2 - 0.00204 **
2900 -      1 - 0.00205 *
Setting uniform threshold to 6800
Distribution of Black Frame   cutting:   4 positive and   0 negative, ratio is 9.9900
Confidence of Black Frame   cutting:   0 out of   0 are strict, too low
Black Frame cutting too low
Distribution of Scene Change  cutting:   0 positive and   0 negative, ratio is 9.9900
Confidence of Scene Change  cutting:   0 out of   0 are strict, too low
Distribution of Uniform Frame cutting:   4 positive and   0 negative, ratio is 9.9900
Confidence of Uniform Frame cutting:   0 out of   0 are strict, too low
Black Frame List
---------------------------
Black Frame Count = 39
nr      frame   pts     bright  uniform volume          cause   dimcount  bright   type
  0      87998  2960.500            16       0      11             b         0       0  B
  1      87999  2960.533            16       0       9             b         0       0  B
  2      88000  2960.567            16       0       7             b         0       0  P
  3      88001  2960.600            16       0       7             b         0       0  B
  4      88002  2960.633            16       0       5             b         0       0  B
  5      88003  2960.667            16       0       4             b         0       0  P
  6      88004  2960.700            16       0       4             b         0       0  B
  7      88005  2960.734            16       0       3             b         0       0  B
  8      88006  2960.767            16       0       2             b         0       0  P
  9      88007  2960.800            16       0       2             b         0       0  B
 10      88008  2960.834            16       0       2             b         0       0  B
 11      88009  2960.867            16       0       1             b         0       0  P
 12      88010  2960.900            16       0       1             b         0       0  B
 13      88011  2960.934            16       0       1             b         0       0  B
 14      88012  2960.967            16       0       0             b         0       0  P
 15      88013  2961.001            16       0       0             b         0       0  B
 16      88014  2961.034            16       0       0             b         0       0  B
 17      88015  2961.067            16       0       0             b         0       0  P
 18      88016  2961.101            16       0       0             b         0       0  B
 19      88017  2961.134            16       0       0             b         0       0  B
 20      88018  2961.167            16       0       0             b         0       0  P
 21      88019  2961.201            16       0       0             b         0       0  B
 22      88020  2961.234            16       0       0             b         0       0  B
 23      88021  2961.267            16       0       0             b         0       0  P
-----------------------------
 24      88031  2961.601            16       0       0             b         0       0  B
 25      88032  2961.634            16       0       0             b         0       0  B
 26      88033  2961.668            16       0       0             b         0       0  P
-----------------------------
 27      93002  3128.368            16       0      11             b         0       0  B
 28      93003  3128.401            16       0      11             b         0       0  P
 29      93004  3128.434            16       0       9             b         0       0  B
 30      93005  3128.468            16       0       9             b         0       0  P
 31      93006  3128.501            16       0       7             b         0       0  B
 32      93007  3128.535            16       0       7             b         0       0  P
 33      93008  3128.568            16       0       7             b         0       0  B
 34      93009  3128.601            16       0       7             b         0       0  P
 35      93010  3128.635            16       0       7             b         0       0  B
 36      93011  3128.668            16       0       7             b         0       0  P
 37      93012  3128.701            21    2106       7             b         0       0  B
-----------------------------
 38     161958  5437.198             0       0       0             br        0       0  P

Fuzzy scoring of the blocks
---------------------------
Block 0 has twice excess length.
Block 0 score:  Before - 1.00   After - 0.00
Block 0 AR (1.47) is different from dominant AR(1.12).
Block 0 score:  Before - 0.00   After - 0.00
Block 2 has twice excess length.
Block 2 score:  Before - 1.00   After - 0.00
Threshold used - 1.0500 After rounding - 1.0500


        ---------------------
        Initial Commercial List
        ---------------------
No change

Logo fraction:              0.9730      Logo disabled
Maximum volume found:        11233
Average volume:               1600
Sound threshold:                15
Silence threshold:              10
Minimum volume found:            0
Average frames with silence:    98
Black threshold:                30
Minimum brightness found:       16
Minimum bright pixels found:     0
Minimum dim level found:         0
Average brightness:            456
Uniformity level:             6800
Average non uniformity:        232
Maximum gap between logo's:     -1
Suggested logo_threshold:   0.7750
Suggested shrink_logo:      0.00
Max commercial size found:      -1
Dominant aspect ratio:      1.1200
Score threshold:            1.0500
Framerate:                  29.970
Average framerate:          29.787
Total commercial length:    0:00:00.00
Cut codes:
  F: scene       c: change
  A: aspect      t: cutscene
  E: exceeds     l: logo
  L: logo        v: volume
  B: bright      s: scene_change
  C: combined    a: aspect_ratio
  N: nonstrict   u: uniform_frame
  S: strict      b: black_frame
                 r: resolution
----------------------------------------------------
Block list after weighing
----------------------------------------------------
  #     sbf  bs  be     fs     fe        ts        te       len     sc   scr cmb   ar                   cut    bri logo   vol sil   corr stdev   cc
  0:+    18   0  18      1  88015     0.00s  2961.07s  2961.07s   0.00  0.04   0 1.47           AE         b   458+ 0.00 1578- 980  0.000    45
  1:+    23  18   5  88016  93006  2961.10s  3128.50s   167.40s   1.00  0.04   0 1.12                      b   401- 0.00 1522- 980  0.000    40
  2:+     6   6   0  93007 161958  3128.53s  5437.20s  2308.66s   0.00  0.04   0 1.12  7      {  E         br  4560 0.00 1635+ 980  0.000    45

161958 Frames Processed
Commercials were not found.
Pulling Closed captions from '/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts' to SRT file
CCExtractor 0.85, Carlos Fernandez Sanz, Volker Quetschke.
Teletext portions taken from Petr Kutalek's telxcc
--------------------------------------------------------------------------
Input: /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts
[Extract: 1] [Stream mode: Autodetect]
[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto]
[Timing mode: Auto] [Debug: No] [Buffer input: No]
[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No]
[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No]
[Add font color data: Yes] [Add font typesetting: Yes]
[Convert case: No] [Video-edit join: No]
[Extraction start time: not set (from start)]
[Extraction end time: not set (to end)]
[Live stream: No] [Clock frequency: 90000]
[Teletext page: Autodetect]
[Start credits text: None]

-----------------------------------------------------------------
Opening file: /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts
Analyzing data in general mode
Creating /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.srt
XDS: ContentAdvisory: MPA Rating: N/A
XDS: CGMS: No copying is permited
XDS: APS: No APS
XDS: Redistribution Control Descriptor: 1
[error][(null)] invalid cbp -1 at 15 18
[error][(null)] Warning MVs not available
[info][(null)] concealing 528 DC, 528 AC, 528 MV errors in P frame

Number of NAL_type_7: 0
Number of VCL_HRD: 0
Number of NAL HRD: 0
Number of jump-in-frames: 0
Number of num_unexpected_sei_length: 0

Total frames time:        00:00:00:000  (0 frames at 29.97fps)
Done, processing time = 82 seconds
Issues? Open a ticket here
https://github.com/CCExtractor/ccextractor/issues
[00:25:09] hb_init: starting libhb thread
[00:25:09] thread 808c19c00 started ("libhb")
HandBrake 1.3.1 (2020011400) - FreeBSD amd64 - https://handbrake.fr
4 CPUs detected
Opening /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts...
[00:25:09] CPU: Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz
[00:25:09]  - Intel microarchitecture Haswell
[00:25:09]  - logical processor count: 4
[00:25:09] Intel Quick Sync Video support: no
[00:25:09] hb_scan: path=/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2585: nav_get_title_list(/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts/) failed
[00:25:09] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[00:25:09] dvd: not a dvd - trying as a stream/file instead
[00:25:09] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[00:25:09] Found the following PIDS
[00:25:09]     Video PIDS :
[00:25:09]       0x100 type MPEG2 (0x2) (PCR)
[00:25:09]     Audio PIDS :
[00:25:09]       0x101 type AC3 (0x81)
[00:25:09]     Subtitle PIDS :
[00:25:09]     Other PIDS :
[00:25:09] stream id 0x101 (type 0x81 substream 0x0) audio 0x101
[00:25:09] scan: decoding previews for title 1
[00:25:09] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[00:25:09] scan: audio 0x101: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[00:25:09] stream: 7 good frames, 0 errors (0%)
[00:25:09] scan: 10 previews, 704x480, 29.970 fps, autocrop = 4/28/86/90, aspect 16:9, PAR 40:33
[00:25:09] libhb: scan thread found 1 valid title(s)
+ Using preset: CLI Default
+ title 1:
  + stream: /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts
  + duration: 01:28:44
  + size: 704x480, pixel aspect: 40/33, display aspect: 1.78, 29.970 fps
  + autocrop: 4/28/86/90
  + chapters:
    + 1: duration 01:28:44
  + audio tracks:
    + 1, English (AC3) (2.0 ch) (192 kbps) (iso639-2: eng), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English, Closed Caption [CC608]
Warning: Could not find audio track 2, skipped
Warning: Could not find audio track 3, skipped
Warning: Could not find audio track 4, skipped
Warning: Could not find audio track 5, skipped
Warning: Could not find audio track 6, skipped
Warning: Could not find audio track 7, skipped
Warning: Could not find audio track 8, skipped
Warning: Could not find audio track 9, skipped
Warning: Could not find audio track 10, skipped
Warning: Could not find audio track 11, skipped
Dropping excess audio encoders
Dropping excess audio mixdowns
[00:25:09] Starting work at: Sat Jan 18 00:25:09 2020

[00:25:09] 1 job(s) to process
[00:25:09] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Encoder": 65536,
                "Mixdown": 4,
                "Track": 0
            },
            {
                "Encoder": 1125984256,
                "Mixdown": 9,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac",
            "copy:ac3",
            "copy:eac3",
            "copy:truehd",
            "copy:dts",
            "copy:dtshd",
            "copy:flac"
        ],
        "FallbackEncoder": "aac"
    },
    "Destination": {
        "AlignAVStart": false,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 1,
                    "Minutes": 28,
                    "Seconds": 44,
                    "Ticks": 479172497
                },
                "Name": "Chapter 1"
            }
        ],
        "ChapterMarkers": false,
        "File": "/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": true
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 3,
                "Settings": {
                    "block-height": "16",
                    "block-thresh": "40",
                    "block-width": "16",
                    "filter-mode": "2",
                    "mode": "3",
                    "motion-thresh": "1",
                    "spatial-metric": "2",
                    "spatial-thresh": "1"
                }
            },
            {
                "ID": 4,
                "Settings": {
                    "mode": "7"
                }
            },
            {
                "ID": 6,
                "Settings": {
                    "mode": 0
                }
            },
            {
                "ID": 12,
                "Settings": {
                    "crop-bottom": 28,
                    "crop-left": 86,
                    "crop-right": 90,
                    "crop-top": 4,
                    "height": 448,
                    "width": 528
                }
            }
        ]
    },
    "Metadata": {},
    "PAR": {
        "Den": 33,
        "Num": 40
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "ColorFormat": 0,
        "ColorMatrix": 6,
        "ColorPrimaries": 6,
        "ColorRange": 1,
        "ColorTransfer": 1,
        "Encoder": "x264",
        "Level": "4.1",
        "Options": "",
        "Preset": "slow",
        "Profile": "high",
        "QSV": {
            "AsyncDepth": 4,
            "Decode": false
        },
        "Quality": 18.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[00:25:09] Starting Task: Encoding Pass
[00:25:09] Skipping vfr filter
[00:25:09] Auto Passthru: allowed codecs are AAC, AC3, E-AC3, TrueHD, DTS, DTS-HD, FLAC
[00:25:09] Auto Passthru: fallback is AAC (avcodec)
[00:25:09] Auto Passthru: using AC3 Passthru for track 2
[00:25:09] work: bitrate not specified, track 1 setting bitrate 160 Kbps
[00:25:09] job configuration:
[00:25:09]  * source
[00:25:09]    + /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.ts
[00:25:09]    + title 1, chapter(s) 1 to 1
[00:25:09]  * destination
[00:25:09]    + /media/Visual/TV Shows/Recorded/Mystery Science Theater 3000 (1987)/Season 4/Mystery Science Theater 3000 S04E04 Teenagers From Outer Space.mp4
[00:25:09]    + container: MPEG-4 (libavformat)
[00:25:09]      + optimized for HTTP streaming (fast start)
[00:25:09]  * video track
[00:25:09]    + decoder: mpeg2video
[00:25:09]      + bitrate 200 kbps
[00:25:09]    + filters
[00:25:09]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[00:25:09]      + Decomb (mode=39)
[00:25:09]      + Crop and Scale (width=528:height=448:crop-top=4:crop-bottom=28:crop-left=86:crop-right=90)
[00:25:09]        + source: 704 * 480, crop (4/28/86/90): 528 * 448, scale: 528 * 448
[00:25:09]    + Output geometry
[00:25:09]      + storage dimensions: 528 x 448
[00:25:09]      + pixel aspect ratio: 40 : 33
[00:25:09]      + display dimensions: 640 x 448
[00:25:09]    + encoder: H.264 (libx264)
[00:25:09]      + preset:  slow
[00:25:09]      + profile: high
[00:25:09]      + level:   4.1
[00:25:09]      + quality: 18.00 (RF)
[00:25:09]      + color profile: 6-1-6
[00:25:09]  * audio track 1
[00:25:09]    + decoder: English (AC3) (2.0 ch) (192 kbps) (track 1, id 0x101)
[00:25:09]      + bitrate: 192 kbps, samplerate: 48000 Hz
[00:25:09]    + mixdown: Stereo
[00:25:09]    + dither: triangular
[00:25:09]    + encoder: AAC (libavcodec)
[00:25:09]      + bitrate: 160 kbps, samplerate: 48000 Hz
[00:25:09]  * audio track 2
[00:25:09]    + decoder: English (AC3) (2.0 ch) (192 kbps) (track 1, id 0x101)
[00:25:09]      + bitrate: 192 kbps, samplerate: 48000 Hz
[00:25:09]    + AC3 Passthru
[00:25:09] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[00:25:09] sync: expecting 159564 video frames
[00:25:09] encx264: min-keyint: 30, keyint: 300
[00:25:09] encx264: encoding at constant RF 18.000000
[00:25:09] encx264: unparsed options: level=4.1:ref=5:direct=auto:subme=8:trellis=2:vbv-bufsize=78125:vbv-maxrate=62500:rc-lookahead=50
x264 [info]: using SAR=40/33
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 4.1, 4:2:0, 8-bit
[00:25:09] sync: first pts audio 0x101 is 0
[00:25:09] sync: first pts audio 0x101 is 0
[00:25:09] sync: first pts video is 8067
Encoding: task 1 of 1, 2.21 % (67.76 fps, avg 70.02 fps, ETA 00h37m09s)[00:26:00] sync: audio 0x101 time went backwards 96 ms, dropped 3 frames. PTS 10607040
[00:26:00] 119.340401s: Video -> Film
Encoding: task 1 of 1, 2.22 % (70.65 fps, avg 70.22 fps, ETA 00h37m02s)[00:26:00] 120.057777s: Film -> Video
Encoding: task 1 of 1, 6.82 % (62.56 fps, avg 66.38 fps, ETA 00h37m20s)[00:27:54] 364.735565s: Video -> Film
Encoding: task 1 of 1, 7.37 % (60.81 fps, avg 65.58 fps, ETA 00h37m34s)[00:28:09] 401.438904s: Film -> Video
Encoding: task 1 of 1, 7.38 % (60.81 fps, avg 65.58 fps, ETA 00h37m34s)[00:28:09] 402.606720s: Video -> Film
Encoding: task 1 of 1, 7.40 % (61.21 fps, avg 65.59 fps, ETA 00h37m33s)[00:28:09] 403.274048s: Film -> Video
[00:28:09] 403.440887s: Video -> Film
Encoding: task 1 of 1, 7.42 % (61.21 fps, avg 65.59 fps, ETA 00h37m33s)[00:28:10] 404.942413s: Film -> Video
Encoding: task 1 of 1, 8.30 % (51.56 fps, avg 64.38 fps, ETA 00h37m53s)[00:28:35] 451.822540s: Video -> Film
Encoding: task 1 of 1, 8.32 % (51.56 fps, avg 64.38 fps, ETA 00h37m53s)[00:28:36] 452.489868s: Film -> Video
Encoding: task 1 of 1, 8.72 % (57.63 fps, avg 64.08 fps, ETA 00h37m53s)[00:28:47] 474.345062s: Video -> Film
[00:28:47] 474.511871s: Film -> Video
[00:28:47] 474.678711s: Video -> Film
Encoding: task 1 of 1, 8.74 % (57.63 fps, avg 64.08 fps, ETA 00h37m53s)[00:28:47] 475.212585s: Film -> Video
[00:28:47] 475.512878s: Video -> Film
[00:28:47] 475.679749s: Film -> Video
[00:28:47] 475.846527s: Video -> Film
Encoding: task 1 of 1, 8.76 % (58.11 fps, avg 64.05 fps, ETA 00h37m53s)[00:28:48] 476.013367s: Film -> Video
Encoding: task 1 of 1, 8.76 % (58.11 fps, avg 64.05 fps, ETA 00h37m53s)[00:28:48] 476.680725s: Video -> Film
Encoding: task 1 of 1, 8.81 % (53.78 fps, avg 63.95 fps, ETA 00h37m56s)[00:28:49] 479.850525s: Film -> Video
Encoding: task 1 of 1, 9.22 % (62.36 fps, avg 63.81 fps, ETA 00h37m50s)[00:29:00] 502.206207s: Video -> Film
Encoding: task 1 of 1, 9.26 % (60.04 fps, avg 63.75 fps, ETA 00h37m51s)[00:29:01] 503.741058s: Film -> Video
Encoding: task 1 of 1, 9.31 % (51.64 fps, avg 63.66 fps, ETA 00h37m53s)[00:29:03] 506.543854s: Video -> Film
Encoding: task 1 of 1, 9.31 % (51.64 fps, avg 63.66 fps, ETA 00h37m53s)[00:29:03] 507.544891s: Film -> Video
Encoding: task 1 of 1, 9.70 % (66.60 fps, avg 63.43 fps, ETA 00h37m51s)[00:29:14] 527.898560s: Video -> Film
Encoding: task 1 of 1, 9.72 % (66.60 fps, avg 63.43 fps, ETA 00h37m51s)[00:29:14] 528.732727s: Film -> Video
Encoding: task 1 of 1, 15.22 % (79.59 fps, avg 65.82 fps, ETA 00h34m16s)[00:31:18] 822.025696s: Video -> Film
[00:31:18] 822.192505s: Film -> Video
Encoding: task 1 of 1, 15.67 % (69.00 fps, avg 65.82 fps, ETA 00h34m05s)[00:31:29] 845.549255s: Video -> Film
[00:31:29] 846.249939s: Film -> Video
Encoding: task 1 of 1, 15.95 % (63.03 fps, avg 65.75 fps, ETA 00h34m00s)[00:31:36] 860.897888s: Video -> Film
[00:31:36] 861.098022s: Film -> Video
[00:31:36] 861.231567s: Video -> Film
Encoding: task 1 of 1, 15.97 % (63.03 fps, avg 65.75 fps, ETA 00h34m00s)[00:31:37] 861.431763s: Film -> Video
Encoding: task 1 of 1, 16.07 % (65.98 fps, avg 65.75 fps, ETA 00h33m56s)[00:31:39] 867.404358s: Video -> Film
Encoding: task 1 of 1, 16.09 % (65.98 fps, avg 65.75 fps, ETA 00h33m56s)[00:31:40] 868.438782s: Film -> Video
[00:31:40] 868.572205s: Video -> Film
[00:31:40] 869.406372s: Film -> Video
Encoding: task 1 of 1, 16.11 % (59.32 fps, avg 65.72 fps, ETA 00h33m57s)[00:31:41] 869.906860s: Video -> Film
[00:31:41] 870.073669s: Film -> Video
Encoding: task 1 of 1, 16.13 % (59.32 fps, avg 65.72 fps, ETA 00h33m57s)[00:31:41] 870.407349s: Video -> Film
Encoding: task 1 of 1, 16.24 % (57.50 fps, avg 65.65 fps, ETA 00h33m56s)[00:31:44] 877.748108s: Film -> Video
Encoding: task 1 of 1, 16.64 % (74.43 fps, avg 65.78 fps, ETA 00h33m42s)[00:31:53] 899.102783s: Video -> Film
Encoding: task 1 of 1, 16.68 % (65.41 fps, avg 65.75 fps, ETA 00h33m42s)[00:31:54] 902.472717s: Film -> Video
Encoding: task 1 of 1, 16.94 % (68.46 fps, avg 65.77 fps, ETA 00h33m36s)[00:32:00] 915.952881s: Video -> Film
[00:32:00] 916.119751s: Film -> Video
[00:32:00] 916.286560s: Video -> Film
[00:32:00] 916.453308s: Film -> Video
Encoding: task 1 of 1, 17.01 % (68.26 fps, avg 65.76 fps, ETA 00h33m34s)[00:32:03] sync: audio 0x101 time went backwards 64 ms, dropped 2 frames. PTS 82785600
[00:32:03] sync: video time went backwards 33 ms, dropped 1 frames. PTS 82873786
Encoding: task 1 of 1, 28.73 % (77.79 fps, avg 65.60 fps, ETA 00h28m53s)[00:36:48] sync: audio 0x101 time went backwards 64 ms, dropped 2 frames. PTS 139075200
Encoding: task 1 of 1, 28.76 % (77.79 fps, avg 65.60 fps, ETA 00h28m53s)x264 [warning]: non-strictly-monotonic PTS
Encoding: task 1 of 1, 29.96 % (62.57 fps, avg 65.58 fps, ETA 00h28m24s)ERROR: avformatMux: track 0, av_interleaved_write_frame failed with error 'Invalid argument'
[00:37:18] work: average encoding speed for job is 65.584961 fps
Encoding: task 1 of 1, 29.97 % (62.57 fps, avg 65.58 fps, ETA 00h28m24s)[00:37:18] comb detect: heavy 3394 | light 8459 | uncombed 35943 | total 47796
[00:37:18] decomb: deinterlaced 3394 | blended 8458 | unfiltered 35935 | total 47787
[00:37:18] stream: 48335 good frames, 0 errors (0%)
[00:37:18] ac3-decoder done: 50390 frames, 0 decoder errors
[00:37:18] ac3-decoder done: 50390 frames, 0 decoder errors
[00:37:18] mpeg2video-decoder done: 47872 frames, 0 decoder errors
[00:37:18] sync: got 47830 frames, 159564 expected
[00:37:18] sync: framerate min 0.698 fps, max 29.970 fps, avg 29.687 fps
[aac @ 0x8097f0600] Qavg: 202.774
[aac @ 0x8097f0600] 2 frames left in the queue on closing
x264 [info]: frame I:270   Avg QP:16.28  size: 29865
x264 [info]: frame P:12745 Avg QP:18.61  size: 10810
x264 [info]: frame B:34703 Avg QP:22.69  size:  1991
x264 [info]: consecutive B-frames:  1.5%  3.3%  3.6% 91.5%
x264 [info]: mb I  I16..4:  5.3% 70.6% 24.2%
x264 [info]: mb P  I16..4:  1.2%  6.5%  0.8%  P16..4: 45.6% 29.2% 13.2%  0.0%  0.0%    skip: 3.5%
x264 [info]: mb B  I16..4:  0.1%  0.4%  0.0%  B16..8: 38.0%  6.7%  1.3%  direct: 6.5%  skip:47.0%  L0:38.5% L1:45.8% BI:15.7%
x264 [info]: 8x8 transform intra:75.9% inter:54.5%
x264 [info]: direct mvs  spatial:99.9% temporal:0.1%
x264 [info]: coded y,uvDC,uvAC intra: 81.6% 72.1% 39.6% inter: 26.5% 22.1% 2.1%
x264 [info]: i16 v,h,dc,p: 38% 24% 10% 28%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 12%  8%  7% 10% 12% 10% 13% 12%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 12%  6%  8% 12% 13% 11% 11% 12%
x264 [info]: i8c dc,h,v,p: 34% 30% 23% 13%
x264 [info]: Weighted P-Frames: Y:31.6% UV:2.2%
x264 [info]: ref P L0: 52.4% 17.3% 17.2%  6.3%  4.8%  2.0%  0.1%
x264 [info]: ref B L0: 86.9% 10.1%  2.1%  0.9%
x264 [info]: ref B L1: 97.1%  2.9%
x264 [info]: kb/s:1069.74
[mp4 @ 0x809122a00] Starting second pass: moving the moov atom to the beginning of the file
Muxing: this may take awhile...[00:37:19] mux: track 0, 47717 frames, 214927120 bytes, 1067.16 kbps, fifo 4096
[00:37:19] mux: track 1, 75523 frames, 32350758 bytes, 160.63 kbps, fifo 8192
[00:37:19] mux: track 2, 50350 frames, 38668800 bytes, 192.00 kbps, fifo 4096
[00:37:19] Finished work at: Sat Jan 18 00:37:19 2020

[00:37:19] libhb: work result = 4

Encode failed (error 4).

HandBrake has exited.

I won't have time for a couple weeks to research the error outputs from ffmpeg and handbrake and devise a capture and escape from the clean up routine.

 

If you think your youngest would like a challenge this is a good opportunity to learn error handling.

Link to comment
Share on other sites

  • 2 months later...
Baenwort

As a FYI if you are running this script and are not having successful conversions the problem lies with the recent dav1d version .6 talked about here: https://emby.media/community/index.php?/topic/83647-dav1d-upgraded-to-version-060/

 

Comskip requires libavutil.so.56 and if you run your script manually and it gives you an error of 'Shared object "libavutil.so.56" not found, required by "comskip"' this may be the same cause.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...