essandess

Q: EyeTV with Commercial Skipping HD DVR Server

I use EyeTV HD and Turbo.264 HD to record and transcode h.264 shows for playback on a Mac, Apple TV, iPad, iPhone. I also use a self-modified version of etvcomskip to detect and mark commercials, which are then automatically skipped at playback. This makes tv viewing a lot more pleasurable and efficient, and is especially helpful controlling advertiser access to children. In case this is useful to others, I've outlined the steps here:

 

  1. Eric Kaashoek's website Comskip and download his HD-capable Comskip software. "Commercial" commercial-skipping companies (ReplayTV, TiVo, Dish, etc.) are quickly sued out of existence or into submission, even if they simply provide a basic "30-second skip" feature. Comskip is open source beerware that you can download, install, and use yourself, and you can't sue anyone for publishing source code. And rather than providing a simple 30-second skip feature, it detects, marks, and provides that capability for automatic commercial skipping.
  2. Comskip a Windows executable, so you'll need WINE (WINdows Emulator) on OS X to run it. First, download and install Xcode (free from the Apple App store), then download and install and install Macports, then in Terminal, run "sudo port selfupdate; sudo port install wine-devel". Finally, make sure that /Applications/Utilities/X11.app is added to your list of applications to run at login (WINE uses X11 to display Windows windows). Yes, this is windows emulation, but on a half-decent box you'll see that commercial skipping runs at around twice real-time for h.264 HD recordings.
  3. Download and install etvcomskip (and PyeTV if you want EyeTV to work with Front Row). The 2010 version of etvcomskip doesn't work with Comskip's latest HD capabilities, and the latest Comskip mpeg libraries do not allow live tv processing, so install these files to get everything working. Once you done this, you'll have a commercial-skipping HD DVR box on your Mac that can stream to Apple TV, iOS, or export to iTunes.

Comskip software

This lives in the directory /Library/Application Support/ETVcomskip.

 

Edit the file ./comskip/comskip.ini to use these HD-tuned settings, tailored for US cable:

 

detect_method=127;1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all
max_avg_brightness=21;maximum average brightness for a dim frame to be considered black (scale 0 to 255) 0 means autosetting
non_uniformity=50; Set to 0 to disable cutpoints based on uniform frames
max_volume=20; any frame with sound volume larger than this will not be regarded as black frame
logo_at_bottom=1; Set to 1 to search only for logo at the lower half of the video, do not combine with subtitle setting
intelligent_brightness=1 ; Set to 1 to use a USA specific algorithm to tune some of the settings, not adviced outside the USA

volume_slip=150

output_dvrmstb=0; Set to 1 if you're running DVRMS-Toolbox
live_tv=0; set to 1 if you use parallelprocessing and need the output while recording
live_tv_retries=4; change to 16 when using live_tv in BTV, used for mpeg PS and TS

 

Edit the file ./MarkCommercials.app/Contents/Resources/MarkCommercials.py to use WINE to run comskip.exe nicely. Grep for these changes:

 

EyeTV.launch()

 

msg = 'Error: unable to communicate with %s\n' % options.app

 

#cmd = '"/Library/Application Support/ETVComskip/Wine.app/Contents/Resources/bin/wine" "/Library/Application Support/ETVComskip/comskip/comskip.exe" --ini="/Library/Application Support/ETVComskip/comskip/comskip.ini" "%s"' % MpgFile

# MacPorts 64-bit wine

#cmd = '"/Applications/Wine.app/Contents/Resources/bin/wine" "/Library/Application Support/ETVComskip/comskip/comskip.exe" --ini="/Library/Application Support/ETVComskip/comskip/comskip.ini" "%s"' % MpgFile

cmd = '"/opt/local/bin/wine" "/Library/Application Support/ETVComskip/comskip/comskip.exe" --ini="/Library/Application Support/ETVComskip/comskip/comskip.ini" "%s"' % MpgFile

 

# nice the wine command

cmd = "/usr/bin/nice -n 14 " + cmd

 

EyeTV software

EyeTV uses the triggered AppleScripts RecordingStarted and RecordingDone in the directory /Library/Application\ Support/EyeTV/Scripts/TriggeredScripts. Open these using the AppleScript Editor and use these scripts instead. You will probably have to Save As... on your desktop, then copy the updated script back into the correct directory to avoid permissions issues.

 

RecordingStarted.scpt

 

on RecordingStarted(recordingID)

    delay 10

    -- comskip81 uses ffmpeg and does not support live tv; put this in RecordingDone.scpt

    --    set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --log " & recordingID & " &> /dev/null &"

    -- display dialog cmd

    -- set cmd to "env > /tmp/etv_test.log &"

    -- do shell script cmd

 

    --disable this if you do not want a logfile written

    write_to_file((short date string of (current date) & " " & time string of (current date)) & "Recording Started run for ID: " & recordingID & (ASCII character 13), (path to "logs" as string) & "EyeTV scripts.log", true)

end RecordingStarted

 

on write_to_file(this_data, target_file, append_data)

    --from http://www.apple.com/applescript/sbrt/sbrt-09.html

    try

        set the target_file to the target_file as string

        set the open_target_file to open for access file target_file with write permission

        if append_data is false then set eof of the open_target_file to 0

        write this_data to the open_target_file starting at eof

        close access the open_target_file

        return true

    on error

        try

            close access file target_file

        end try

        return false

    end try

end write_to_file

RecordingDone.scpt

 

-- Run the python MarkCommercials script for the given recording

-- this must be run with the RecordingStarted script

-- it will check if there were multiple PIDs for the recording and runs MarkCommercials for each pid

-- requires updated MarkCommercials which allows specifying the pid

-- by Ben Blake, September 2009

 

-- modified for latest Comskip, which cannot be run until after recording is finished; waits for Turbo.264 HD to stop running as well

-- S.T.Smith

 

global LogMsg

 

on RecordingDone(recordingID)

 

    set ProcessName to "Elgato H.264 Decoder"

    set DelayTime to 60

    set MaxDelays to 4 * 60 -- four hours

 

    -- delay until the process slows down or stops running

    repeat MaxDelays times

        delay DelayTime -- delay at least once to give it a chance to start

        set pcpu to CPUPercentage(ProcessName)

        if pcpu is equal to "" or pcpu < 2.0 then exit repeat -- break out of delay loop if it's not running

    end repeat

 

    delay 10

    -- comskip81 uses ffmpeg and does not support live tv; take this from RecordingStarted.scpt

    set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --log " & recordingID & " &> /dev/null &"

    -- display dialog cmd

    -- set cmd to "env > /tmp/etv_test.log &"

    do shell script cmd

 

    set LogMsg to ""

    CheckMultiplePIDs(recordingID)

 

    --disable this if you do not want a logfile written

    if (count of LogMsg) > 0 then

        write_to_file((short date string of (current date) & " " & time string of (current date)) & LogMsg & (ASCII character 13), (path to "logs" as string) & "EyeTV scripts.log", true)

    end if

end RecordingDone

 

-- testing code: this will not be called when triggered from EyeTV, but only when the script is run as a stand-alone script

on run

    tell application "EyeTV.app"

        set rec to «class Unqu» of item 1 of every «class cRec»

 

        my RecordingDone(rec)

    end tell

end run

 

-- compute the percentage CPU used by ProcessName

on CPUPercentage(ProcessName)

    set ProcessPS to do shell script ("ps -axwwc | grep '" & ProcessName & "' | grep -v grep || true")

    if ProcessPS is not equal to "" then

        set ProcessID to word 1 of ProcessPS

        set ProcessPS to do shell script ("ps -xwwco pid,ppid,%cpu -p " & ProcessID & " | tail -1")

        set ProcessCPU to word 3 of ProcessPS

        return ProcessCPU as number

    else

        return ""

    end if

end CPUPercentage

 

on CheckMultiplePIDs(recordingID)

    --check if there are multiple Video PIDs in the file

 

    tell application "EyeTV.app"

        set input_text to my read_from_file((path to "logs" as string) & "ETVComskip" & ":" & recordingID & "_comskip.log")

        if (count of (input_text as string)) > 0 then

            set logdata to every paragraph of input_text

            set logdata_lastrow to (item ((count of logdata) - 1) of logdata) as string

 

            if (items 1 thru 19 of logdata_lastrow) as string = "Video PID not found" then

                --multiple Video PIDs, rerun MarkCommercials until successful

 

                set recrdingIDInteger to recordingID as integer

                set rec to «class cRec» id recrdingIDInteger

                set LogMsg to "RecordingDone found multiple PIDs for recording ID: " & recordingID & ", Channel " & («class Chnm» of rec) & " - " & («class Titl» of rec)

 

                set PIDs to (items 44 thru ((count of logdata_lastrow) - 2) of logdata_lastrow) as string

                set delims to AppleScript's text item delimiters

                set AppleScript's text item delimiters to ", "

                set PID_List to {}

                set PID_List to every word of PIDs

                set AppleScript's text item delimiters to delims

 

                repeat with pid in PID_List

                    my launchComSkip(recordingID, pid)

                    repeat while (my mcIsRunning())

                        delay 5

                    end repeat

                end repeat

 

            end if

        end if

    end tell

end CheckMultiplePIDs

 

on read_from_file(target_file)

    --return the contents of the given file

    set fileRef to (open for access (target_file))

    set txt to (read fileRef for (get eof fileRef) as «class utf8»)

    close access fileRef

    return txt

end read_from_file

 

on write_to_file(this_data, target_file, append_data)

    --from http://www.apple.com/applescript/sbrt/sbrt-09.html

    try

        set the target_file to the target_file as string

        set the open_target_file to open for access file target_file with write permission

        if append_data is false then set eof of the open_target_file to 0

        write this_data to the open_target_file starting at eof

        close access the open_target_file

        return true

    on error

        try

            close access file target_file

        end try

        return false

    end try

end write_to_file

 

on launchComSkip(recID, pid)

    if pid = "" then

        set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --force --log " & recID & " &> /dev/null &"

    else

        set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --force --log " & recID & " --pid=" & pid & " &> /dev/null &"

    end if

 

    do shell script cmd

end launchComSkip

 

on mcIsRunning()

    set processPaths to do shell script "ps -xww | awk -F/ 'NF >2' | awk -F/ '{print $NF}' | awk -F '-' '{print $1}' "

    return (processPaths contains "MarkCommercials")

end mcIsRunning



<Links Edited By Host>

Mac mini Server (Mid 2010), Mac OS X (10.7.4), Lion Server, EyeTV HD, Turbo.264 HD

Posted on Dec 5, 2015 1:28 PM

Close

Q: EyeTV with Commercial Skipping HD DVR Server

  • All replies
  • Helpful answers

first Previous Page 6 of 10 last Next
  • by fracnl14,

    fracnl14 fracnl14 Oct 29, 2013 7:27 AM in response to essandess
    Level 1 (0 points)
    Oct 29, 2013 7:27 AM in response to essandess

    thanks for your precise instructions but they seem too difficult for me. You said that the crucial port "hasn't been upgraded yet". Do you think it's possibile to install maverich and wait the port upgrade before updating xcode?  will maverich work with the old xcode?

  • by Ste88,

    Ste88 Ste88 Oct 29, 2013 8:23 AM in response to fracnl14
    Level 1 (0 points)
    Oct 29, 2013 8:23 AM in response to fracnl14

    Per the discussion at http://apple.stackexchange.com/questions/106189/missing-usr-bin-gnutar-on-maveri cks-macports, a binary MacPorts installer for Mavericks (for the 2.2.1 bugfix release) is now available: https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.9-Mavericks.pkg

     

    I haven’t tried it yet, but I hope this helps.

     

    Cheers,

    S

  • by tomar012,

    tomar012 tomar012 Nov 1, 2013 7:41 PM in response to chriser
    Level 1 (8 points)
    Mac OS X
    Nov 1, 2013 7:41 PM in response to chriser

    How did you resolve the install error you got when trying to install ETVComskip?  I am encountering the same error, "The operation couldn't be completed. (OSStatus error 100030.)"

  • by Brandon Riffel,

    Brandon Riffel Brandon Riffel Nov 3, 2013 6:08 AM in response to essandess
    Level 1 (0 points)
    Nov 3, 2013 6:08 AM in response to essandess

    I notice the other day that the Elgato US store store, the Apple online store, and Newegg all no longer have ANY EyeTV tuners for sale ( aside from ipad tuners).  Is there any significance to this?  The UK store still has plenty of options.  The strange thing is the apple store icon for  video accessories is still an Elgato USB tuner I think.

  • by essandess,

    essandess essandess Nov 3, 2013 7:17 AM in response to tomar012
    Level 1 (28 points)
    Applications
    Nov 3, 2013 7:17 AM in response to tomar012

    > "The operation could not be completed."

     

    Please post any such issues on ETVComskip's google code page so that the developer is aware of them.

  • by fracnl14,

    fracnl14 fracnl14 Nov 6, 2013 12:51 AM in response to essandess
    Level 1 (0 points)
    Nov 6, 2013 12:51 AM in response to essandess

    HI

    I still have some trouble with update to Mavericks. I have:

    1) updated X11

    2) run the command line xcode -select - install

    3) updated macports through the binary installer suggested by ste88

     

    i continue to see the error "comskip require x11. would you like to install now?". what i am missing?

    do i have to insall/update xquartz too? 

    do i have to run the commands "sudo port selfupdate... sudo port outdated..."?

     

    thank you for anyone to help

  • by essandess,

    essandess essandess Nov 6, 2013 1:06 AM in response to fracnl14
    Level 1 (28 points)
    Applications
    Nov 6, 2013 1:06 AM in response to fracnl14

    Is X11 running? Did you Launch the XQuartz app? Does the command

     

    $ xeyes

     

    produce googly eyes that track your mouse around?

     

    Is your DISPLAY shell variable set to :0.0 or whichever port X is setup to run on? This should be in your ~/.bash_profile setup file:

     

    $ nano ~/.bash_profile

    :

    DISPLAY=:0.0; export DISPLAY

     

    $ echo $DISPLAY

    $ ps -ef | grep bin/X

     

    501  7698  2173   0 Sun08AM ??     0:00.01 /opt/X11/bin/xinit /opt/X11/lib/X11/xinit/xinitrc -- /opt/X11/bin/X :0.0 -nolisten tcp -auth /Users/username/.serverauth.2173
  • by Michael4824,

    Michael4824 Michael4824 Nov 6, 2013 1:41 PM in response to essandess
    Level 1 (5 points)
    iPad
    Nov 6, 2013 1:41 PM in response to essandess

    essandess, thanks for all of your work on this.  I really appreciate you getting this far with it.

     

    I was wondering if you might be able to help me out a bit with my RecordingDone script.  Once I have a recording, I like to encode it (smaller file size), and then store it on my external drive for Plex to find.  I have the commercials being marked fine, however when I export the commercials remain.  Idealy, I would love for them to be deleted all together.  If I manually export as QuickTime Movie, they are deleted.  (In the past I've used iPad, but I really don't care what I use as long as it's encoded for a smaller file size.)

     

    This script below is really a hack of what I used to use (mainly from [url=http://forums.plexapp.com/index.php/topic/15100-eyetv-export-with-season-and-epi sode-applescript/]here[/url]) and a yours.

     

    Any ideas?

     

    Thanks again for ALL of your work on this!

     

    global LogMsg

     

    on RecordingDone(recordingID)

     

        set ProcessName to "Elgato H.264 Decoder"

        --set DelayTime to 60

        --set MaxDelays to 6 * 60 -- six hours

        set DelayTime to 10

        set MaxDelays to 15

     

        -- delay until the process slows down or stops running

        repeat MaxDelays times

            delay DelayTime -- delay at least once to give it a chance to start

            set pcpu to CPUPercentage(ProcessName)

            if pcpu is equal to "" or pcpu < 2.0 then exit repeat -- break out of delay loop if it's not running

        end repeat

     

        -- wait a few minutes for transcoding to complete; shorter times will result in operating on m4v file that look like busy_00000000162e5df5.iPad.chapters.txt   

        delay 180

     

        -- comskip81 uses ffmpeg and does not support live tv; take this from RecordingStarted.scpt

        set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --log " & recordingID & " &> /dev/null &"

        -- display dialog cmd

        -- set cmd to "env > /tmp/etv_test.log &"

        do shell script cmd

     

        set LogMsg to ""

        CheckMultiplePIDs(recordingID)

        --display dialog "in RecordingDone" & recordingID

        --disable this if you do not want a logfile written

        if (count of LogMsg) > 0 then

            write_to_file((short date string of (current date) & " " & time string of (current date)) & LogMsg & (ASCII character 13), (path to "logs" as string) & "EyeTV scripts.log", true)

        end if

    end RecordingDone

     

    on doExport(recordingID)

        --Export to Plex!      

     

        -- Grab some basics from EyeTV. RecoringID, Show name, Episode name. It'll be used later.

        tell application "EyeTV"

     

            set rec to recordingID as integer

            set theRec to recording id rec

            set thisTitle to title of theRec

            --display dialog "title " & thisTitle

            set ParsTitle to my parseout(thisTitle)

            --display dialog "ParsTitle " & ParsTitle

            set thisEpisode to episode of theRec

            set ParsEpisode to my parseout(thisEpisode)

     

        end tell

     

        -- Customize this script for yourself. The next three variables are locations on your system where we will read and export to

     

        -- Set this value to the location where EyeTV records to

        set EyeTvArchiveLocation to "Large:EyeTV:EyeTV Archive:" as string

     

        -- Set this location to where you want your exports to write to

        set ExportLocation to "Large:TV Shows:" as string

     

        -- Set this to a temporary location. A file "temp.plist" is written and then deleted from here

        set TempLocation to "Macintosh HD:Users:Michael:Documents:" as string

     

        -- Now we're gonna go to the finder, find the show and grab the file out of the package that has the meta data. It'll be written to a temp file and we'll grab the season and episode # from it.

        tell application "Finder"

            -- Set the alias for the show we just got done recording

            if thisEpisode is "" then

                set fpath to EyeTvArchiveLocation & ParsTitle & ".eyetv" as alias

            else

                tell application "System Events"

                    set temp to EyeTvArchiveLocation & ParsTitle & " - " & ParsEpisode & ".eyetv"

                    if exists file temp then

                        set fpath to EyeTvArchiveLocation & ParsTitle & " - " & ParsEpisode & ".eyetv" as alias

                    else

                        set fpath to EyeTvArchiveLocation & ParsTitle & ".eyetv" as alias

                        display dialog EyeTvArchiveLocation & ParsTitle & ".eyetv"

                    end if

                end tell

            end if

     

            -- The .eyetv file is a package. We're going to read it's contents and find the .eyetvp file. It'll be stored in the fname variable

     

            set eyetvp to do shell script "ls -1 " & quoted form of POSIX path of fpath & "/*.eyetvp" as string

     

            set eyetvp to every paragraph of eyetvp --   paragraph == line

            set fname to item 1 of eyetvp

        end tell

     

        -- Great! no grab Season id and episode num out of this temp file and create the sedat variable. This will be used in the file export later.

        -- You can grab more meta data in this routine and also tweak the way the file name meta data is created.

        tell application "System Events"

     

            set fileRecord to (value of property list file fname)

            set sid to value of property list item "SEASONID" of property list item "epg info" of property list file fname

            set eid to value of property list item "EPISODENUM" of property list item "epg info" of property list file fname

            --if sid is not "" and eid is not "" then

            --      set sedat to "S" & sid & "E" & eid

            --else

            --      set sedat to "S00E00"

            --end if

        end tell

        tell application "Finder"

            set fileLocation to ExportLocation & ParsTitle

            if (exists folder fileLocation) is false then

                make new folder at alias ExportLocation with properties {name:ParsTitle}

            end if

     

            set fileLocation to ExportLocation & ParsTitle & ":" & "Season " & sid

            set tempDir to ExportLocation & ParsTitle

            set tempFolder to "Season " & sid

            set tempSid to sid as string

            if (exists folder fileLocation) is false and tempSid is not "" and tempSid is not "0" then

                make new folder at alias tempDir with properties {name:tempFolder}

            end if

        end tell

     

        -- Now, tell EyeTV to set the file name and location and export the file.

        -- TODO: I'd like to have an option to just rename the file in place here and/or export using Turbo.264 and/or export in HD720p format.

        tell application "EyeTV"

            set theDateStamp to (do shell script "date +%Y%m%d.%H%M%S")

            --set fileName to ExportLocation & thisTitle & " - " & sedat & ".avi"

            set tempEp to thisEpisode as string

            if eid is not "" then

                set tempEid to eid as integer

            else

                set tempEid to 0 as integer

            end if

     

            set tempSeason to sid as string

     

            if tempSeason is not "" and tempSeason is not "0" and tempEid is not "0" and tempEid is not "" and ParsTitle is not "" then

                --have season number, have episode number, and series name

                set fileName to ExportLocation & ParsTitle & ":Season " & sid & ":" & ParsTitle & " S" & sid & "E" & eid & ".mp4"

            else if tempSeason is not "" and tempSeason is not "0" then

                --have season number, use Date

                set tempEpDate to (do shell script "date +%m%d%Y") as string

                set fileName to ExportLocation & ParsTitle & ":Season " & sid & ":" & tempEpDate & ".mp4"

            else

                --just use date

                set tempEpDate to (do shell script "date +%m%d%Y") as string

                set fileName to ExportLocation & ParsTitle & ":" & tempEpDate & ".mp4"

            end if

     

            --display dialog fileName

            export from theRec to file fileName as iPad

        end tell

     

        --Voila!

    end doExport

     

    -- one more edit for plex export, only section below.

    on readFile(unixPath)

        set foo to (open for access (unixPath))

        set txt to (read foo for (get eof foo))

        close access foo

        return txt

    end readFile

     

    -- testing code: this will not be called when triggered from EyeTV, but only when the script is run as a stand-alone script

    on run

        tell application "EyeTV"

            set rec to unique ID of item 1 of every recording

            my RecordingDone(rec)

            delay 60 * 25

            my doExport(rec)

        end tell

    end run

     

    -- compute the percentage CPU used by ProcessName

    on CPUPercentage(ProcessName)

        set ProcessPS to do shell script ("ps -axwwc | grep '" & ProcessName & "' | grep -v grep || true")

        if ProcessPS is not equal to "" then

            set ProcessID to word 1 of ProcessPS

            set ProcessPS to do shell script ("ps -xwwco pid,ppid,%cpu -p " & ProcessID & " | tail -1")

            set ProcessCPU to word 3 of ProcessPS

            return ProcessCPU as number

        else

            return ""

        end if

    end CPUPercentage

     

    on CheckMultiplePIDs(recordingID)

        --check if there are multiple Video PIDs in the file

     

        tell application "EyeTV"

            set input_text to my read_from_file((path to "logs" as string) & "ETVComskip" & ":" & recordingID & "_comskip.log")

            if (count of (input_text as string)) > 0 then

                set logdata to every paragraph of input_text

                set logdata_lastrow to (item ((count of logdata) - 1) of logdata) as string

     

                if (items 1 thru 19 of logdata_lastrow) as string = "Video PID not found" then

                    --multiple Video PIDs, rerun MarkCommercials until successful

     

                    set recrdingIDInteger to recordingID as integer

                    set rec to recording id recrdingIDInteger

                    set LogMsg to "RecordingDone found multiple PIDs for recording ID: " & recordingID & ", Channel " & (channel number of rec) & " - " & (title of rec)

     

                    set PIDs to (items 44 thru ((count of logdata_lastrow) - 2) of logdata_lastrow) as string

                    set delims to AppleScript's text item delimiters

                    set AppleScript's text item delimiters to ", "

                    set PID_List to {}

                    set PID_List to every word of PIDs

                    set AppleScript's text item delimiters to delims

     

                    repeat with pid in PID_List

                        my launchComSkip(recordingID, pid)

                        repeat while (my mcIsRunning())

                            delay 5

                        end repeat

                    end repeat

     

                end if

            end if

        end tell

    end CheckMultiplePIDs

     

    on read_from_file(target_file)

        --return the contents of the given file

        set fileRef to (open for access (target_file))

        set txt to (read fileRef for (get eof fileRef) as «class utf8»)

        close access fileRef

        return txt

    end read_from_file

     

    on write_to_file(this_data, target_file, append_data)

        --from http://www.apple.com/applescript/sbrt/sbrt-09.html

        try

            set the target_file to the target_file as string

            set the open_target_file to open for access file target_file with write permission

            if append_data is false then set eof of the open_target_file to 0

            write this_data to the open_target_file starting at eof

            close access the open_target_file

            return true

        on error

            try

                close access file target_file

            end try

            return false

        end try

    end write_to_file

     

    on launchComSkip(recID, pid)

        if pid = "" then

            set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --force --log " & recID & " &> /dev/null &"

        else

            set cmd to "export DISPLAY=:0.0; /usr/bin/nice -n 5 '/Library/Application Support/ETVComskip/MarkCommercials.app/Contents/MacOS/MarkCommercials' --force --log " & recID & " --pid=" & pid & " &> /dev/null &"

        end if

     

        do shell script cmd

    end launchComSkip

     

    on mcIsRunning()

        set processPaths to do shell script "ps -xww | awk -F/ 'NF >2' | awk -F/ '{print $NF}' | awk -F '-' '{print $1}' "

        return (processPaths contains "MarkCommercials")

    end mcIsRunning

     

    --Subroutine to remove troublesome characters

    to parseout(stringtoparse)

        set illegals to (ASCII character of 60) & (ASCII character of 62) & (ASCII character of 58) & (ASCII character of 34) & (ASCII character of 47) & (ASCII character of 92) & (ASCII character of 124)

        repeat with i from 1 to count (illegals)

            set testletter to (text i thru i of illegals)

            set the_offset to 1

            repeat

                set the_offset to offset of testletter in stringtoparse

                if the_offset > 0 then

                    set stringtoparse to (text 1 thru (the_offset - 1) of stringtoparse) & "_" & (text (the_offset + 1) thru -1 of stringtoparse)

                else

                    exit repeat

                end if

            end repeat

        end repeat

        return stringtoparse

    end parseout

     

    The line:



    export from theRec to file fileName as iPad

    I believe is how the format gets set, however when I do "Quicktime Movie", the video file is not playable.

  • by essandess,

    essandess essandess Nov 6, 2013 5:41 PM in response to Michael4824
    Level 1 (28 points)
    Applications
    Nov 6, 2013 5:41 PM in response to Michael4824

    Commercials are marked and kept by design to avoid highly annoying false positives. Edit the code to export AFTER comskip runs and EyeTV will use the .edl to delete all commercials. But I wouldn't recommend the effort based on experience with comskip's false positive rate.

  • by tomar012,

    tomar012 tomar012 Nov 6, 2013 6:10 PM in response to essandess
    Level 1 (8 points)
    Mac OS X
    Nov 6, 2013 6:10 PM in response to essandess

    I posted my problem to the developer's website as suggested. I did a bit more digging and discovered that the problem is the file system of the dmg is read only.  I got around this problem by copying the package contents of the dmg to a folder and running the installation script from there.  This produced a new set of problems because now the installation files are looking for directories that do not exist on my Mac.

     

    I realize this problem may not be appropriate for this thread.  The only reason I posted here was because I saw that someone had a similar problem. I will likely take this discussion to either a new thread or an existing thread that more suited to this problem.

  • by Michael4824,

    Michael4824 Michael4824 Nov 6, 2013 6:58 PM in response to essandess
    Level 1 (5 points)
    iPad
    Nov 6, 2013 6:58 PM in response to essandess

    Hi essandess,

     

    Looking at the code below, doesn't this mark commercials, wait 25 minutes, then run the export?  If not, could you clarify what I am doing wrong?

     

    Also, am I correct in believing that I can't export in mp4 format and have the commercials skipped?

     

    Thanks again.

    -- testing code: this will not be called when triggered from EyeTV, but only when the script is run as a stand-alone script

    on run

        tell application "EyeTV"

            set rec to unique ID of item 1 of every recording

            my RecordingDone(rec)

            delay 60 * 25

            my doExport(rec)

        end tell

    end run

  • by Niccum,

    Niccum Niccum Nov 10, 2013 10:25 AM in response to essandess
    Level 1 (0 points)
    Nov 10, 2013 10:25 AM in response to essandess

    Mavericks clean install...

     

    Can the above instructions be used for a clean install after installing Mavericks?  What about the ML binaries and libraries?  How do I get these if I started fresh with Mavericks?

  • by essandess,

    essandess essandess Dec 5, 2015 1:46 PM in response to Niccum
    Level 1 (28 points)
    Applications
    Dec 5, 2015 1:46 PM in response to Niccum

    Unfortunately, we will need a port of mp4v2 that builds on Mavericks for fresh installs. I wouldn't expect too long a wait. If you're feeling impatient, you can express your interest/encouragement at the macports.org site or the mp4v2 google code site.

     

    Mavericks does a much better job at memory management, important for memory-hungry comskip and transcoding, so all these upgrade issues will be worthwhile once the transition is over.

     

    <Link Edited By Host>

  • by fracnl14,

    fracnl14 fracnl14 Nov 11, 2013 1:56 AM in response to essandess
    Level 1 (0 points)
    Nov 11, 2013 1:56 AM in response to essandess

    hi

    thanks to your instructions I was able to fix the issue port and now comskip works perfectly with mavericks. Thank you. I have just one final issue with comskipper (the scritp that automatically skips marked parts during play with eyetv). it becomes "non responding" after few minutes (i monitor it through activity monitor). this too should be caused by mavericks because before it worked. any idea?

    thanks

  • by essandess,

    essandess essandess Nov 11, 2013 6:26 AM in response to fracnl14
    Level 1 (28 points)
    Applications
    Nov 11, 2013 6:26 AM in response to fracnl14

    > ComSkipper hangs

     

    Me too. But see its python script, /Library/Application\ Support/ETVComskip/ComSkipper.app/Contents/Resources/ComSkipper.py:

     

    # Theory of operation: This program runs in an infinite loop.  If

    # EyeTV is not running it sleeps for 15 sec and tries again.  If it is

    # running, and playing a recording, then the program wakes up every

    # second to see if the current playback time is within a commercial

    # break as defined by the markers in the EyeTV recording.  If so, it

    # jumps to the end of the break.

     

    ComSkipper is used for live playback during live tv. The h.264 mods change operation so that comskip starts AFTER recording AND transcoding, so we aren't using ComSkipper at all. Nevertheless, I posted a report at google code.

first Previous Page 6 of 10 last Next