SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-04-2008, 11:35 PM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
Dirmon2 + Comskip + Mencoder

So..I've been experimenting with the stock compression, transcoding plugins, auto-compression stvi's, SageMC video tools, and anything relevant to compression and/or auto-comskipping.

While I'm sure all the downloads add value to base installation, i don't feel like i'm...well... in control of the functionality. I don't mind tinkering, and in fact, it's how i learn best and can better predict what will happen as processes get automated. So, what i would like to do is write my own utility to edit commercials and compress and/or transcode to my whim. I'm not a complete novice about video concepts, but i admit i have never actually spent time re-encoding the same clip, over and over, changing parameters, codecs, bitrates, quantizers, etc.. and comparing the results...i kind of prefer the vast experience of the internet to do that for me.

With that said, tonight i started a very simple exercise to create a windows bat file, called by dirmon2, to comskip a captured mpg file, cut the commercials, and transcode to xvid. I wanted to do this outside of Sage, to be sure i understood what was happening. My results have been less than stellar.

Now, if the experts of this forum read this (like evilpenguin, jrewiki, nielm, Opus, sorry i don't have room to list the many others) and say 'why should i bother replying to this noob', i hope there is value to other non-experts trying the same thing i am. Ultimately, i would like to achieve a predictable process for removing commercials from either an SD or HD recording, and transcode/compress the result of that to a file playable by Sage, its clients, sage extenders, and in my case, also a networked media player- the Klegg mediashare.

The probs...

1) i discover dirmon2 doesn't pass optional arguments to the program to run. I can only get it to pass the target name if i leave the command line options blank. Jere_Jones created a great utility, but i don't understand the syntax. Am i missing something? [[%PATH%/%BASENAME%]] didn't work.

2) so, i created a VBS script to be the program that dirmon2 runs and constructed the base target file myself, but dirmon2 can't run a VBS file natively. That's okay, i create a .bat wrapper, but still it seems ugly. I'm a windows shop so i have to live with that restriction right?

3) I chose mencoder to do the cutting and transcoding, simply because it appeared it could do both at the same time. My vbs script command string is:

strCommand=MENCODERPATH & " " & MPGNAME & _
" -edl " & EDLNAME & _
" -oac copy " & _
" -ovc xvid -xvidencopts pass=2:bitrate=800" & _
" -of avi " & _
" -o " & AVINAME

That completely successfully on an SD capture, but the commercials remained intact and compressed a 984MB file to only 763MB. Now i realize, i probably haven't optimized the compression settings, quantizers, etc...but at least the commercials should have been cut, right?

The .edl file has:
411.88 544.11 0
835.70 967.83 0
1759.66 1799.10 0

4) Okay, so what am i missing? I have a math/compsci degree, and programming background. However, all that started 20+ years ago, and i'm now a pointy-haired IT manager. Please don't tell me i don't get it. This seems like a straight-forward task that any of my staff could accomplish. Although i admit it is fun to delve into these mysteries.....my wife isn't so sure.
Reply With Quote
  #2  
Old 09-05-2008, 12:12 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
EDL cutting using mencoder is pretty spotty. Sometimes it works, other times it doesn't. The most reliable method is using VideoRedo but it costs $$$.

Last edited by evilpenguin; 09-05-2008 at 12:15 AM.
Reply With Quote
  #3  
Old 09-05-2008, 12:24 AM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,123
I've seen mention of needing to have
-hr-edl-seek
as an option to get the cutting working

-edl edlfile.edl -hr-edl-seek

John
Reply With Quote
  #4  
Old 09-05-2008, 07:46 AM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
Quote:
Originally Posted by evilpenguin View Post
EDL cutting using mencoder is pretty spotty. Sometimes it works, other times it doesn't. The most reliable method is using VideoRedo but it costs $$$.
bravo. I've seen that product mentioned elsewhere...not sure why i ignored looking at it. I just looked in their forum, and saw a post detailing the very same approach that i am trying to do.

Quote:
Originally Posted by JREkiwi View Post
I've seen mention of needing to have
-hr-edl-seek
as an option to get the cutting working

-edl edlfile.edl -hr-edl-seek

John
Thanks. i hadn't seen that option mentioned anywhere. I will try that tonight.
Reply With Quote
  #5  
Old 09-05-2008, 10:03 PM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
well, so far none of my mencoder experiments seemed to have honored the -hr-edl-seek switch. It might be an issue with the source, since i'm using the same clip for my testing. I could try a different file, but i feel if it doesn't work for this one, it prolly won't work for another one at some point, so i'd rather start with a successful effort. I'm intrigued with VideoRedo, particularly since it has commercial detection, as well as cutting.... i'm not quite ready to give up, but it's getting real close...

anyway, thanks for the advice!
Reply With Quote
  #6  
Old 09-06-2008, 10:35 PM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
followup--- i've ditched the menconder option, and switched to the trial videoredoplus. I used the builtin adscan program and so far the commercial cutting seems to be working, but i feel suspicious that some "real" parts of the video are being cut. But i felt confident enough to set it up for my "production" environment and let it scan/cut the actual mpg's i have on all of my sage recording folders.

the problem now is not VideoRedo....as much as Dirmon2. It keeps trying to reprocess the same files over and over. This shows up repeatedly in the activity log:

2008-Sep-06 22:56:46 - Starting: "MyCompress" on "H:\recordings\Access Hollywood_20080702_214824.mpg"
2008-Sep-06 22:56:47 - Processor done due to event.
2008-Sep-06 22:56:47 - Finished: "MyCompress" on "H:\recordings\Access Hollywood_20080702_214824.mpg"

The dirmon2 job is set to target mpg and must not exist vprj. The .vprj exists for the file listed above, so i'm fissed as to why it keeps trying to process it?
Reply With Quote
  #7  
Old 09-07-2008, 04:32 AM
erik erik is offline
Sage Aficionado
 
Join Date: May 2005
Posts: 467
Quote:
Originally Posted by bnh View Post
followup--- i've ditched the menconder option, and switched to the trial videoredoplus. I used the builtin adscan program and so far the commercial cutting seems to be working, but i feel suspicious that some "real" parts of the video are being cut. But i felt confident enough to set it up for my "production" environment and let it scan/cut the actual mpg's i have on all of my sage recording folders.
There is widespread information on the internet that adscan is about the most primitive commercial detector available. As soon as it encounters more complex broadcasts it will fail to detect correctly. Comskip and other detectors are capable to output videoredo project files.
__________________
Support Comskip, visit the forum and donate at http://www.comskip.org/
Reply With Quote
  #8  
Old 09-07-2008, 04:40 AM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,123
Quote:
Originally Posted by erik View Post
Comskip and other detectors are capable to output videoredo project files.
That's what I use. Comskip producing VideoRedo project files and VideoRedo to edit the mpg. Very easy to tweak any commercial detections that aren't quite right.

John
Reply With Quote
  #9  
Old 09-08-2008, 02:27 PM
brandypuff brandypuff is offline
Sage Aficionado
 
Join Date: Mar 2008
Location: Berlin, MA
Posts: 351
Quote:
Originally Posted by bnh View Post
the problem now is not VideoRedo....as much as Dirmon2. It keeps trying to reprocess the same files over and over. This shows up repeatedly in the activity log:
The way i use Dir2Mon is after fle processing, i have two files remaining, the .mpg file without the commercials and a log file with the same name as the mpg file but with a .log file extension. Somewhere in Dir2mon, is an option to ignore processing if a file of some filetype is in the same directory. i set this up some time ago so i don't remember exactly how to do it but i know you can.
__________________
- James M -
Server: Asus P5B Deluxe, 8GB, Core2 E6600 @2.4GHz, Windows 10 X64 Pro
Storage Internal: (1) 250GB, (2) 2TB, (1) 4TB
Storage External: Sans Digital 4-Bay eSATA Port Multiplier RAID Enclosure with (4) 4TB Drives
Capture Devices: HDHomerunXTEND, HDHomerunPrime
Clients: (1) STX-HD100 HD Media Extender, (3) HD200 HD Theatre, (1) HD300
Reply With Quote
  #10  
Old 09-08-2008, 04:54 PM
toricred's Avatar
toricred toricred is offline
Sage Icon
 
Join Date: Jan 2006
Location: Northern New Mexico
Posts: 1,729
Dirmon2 should absolutely accept command-line arguments. I have used for example Comskip passing it the .ini file with the switch --ini=c:\comskip\comskip.ini. What exactly is the command you're trying to run?

In addition, you shouldn't have to wrap a vbs file in a bat file, you just run it by calling cscript vbsscript.vbs.
Reply With Quote
  #11  
Old 09-08-2008, 05:20 PM
bnh's Avatar
bnh bnh is offline
Sage Advanced User
 
Join Date: Aug 2008
Posts: 120
Quote:
Originally Posted by toricred View Post
Dirmon2 should absolutely accept command-line arguments. I have used for example Comskip passing it the .ini file with the switch --ini=c:\comskip\comskip.ini. What exactly is the command you're trying to run?

In addition, you shouldn't have to wrap a vbs file in a bat file, you just run it by calling cscript vbsscript.vbs.
I thought about that, except how does the target filename get passed? as parm #2, after the script name? I tried adding [[%FULLFILESPEC%]], but it didn't find. I have since gone to a plain .CMD file. The vbs didn't really add any value.

Quote:
Originally Posted by erik View Post
There is widespread information on the internet that adscan is about the most primitive commercial detector available. As soon as it encounters more complex broadcasts it will fail to detect correctly. Comskip and other detectors are capable to output videoredo project files.
I really did like Comskip. I hadn't seen any negatives about adscan, but i'll take your word for it. I think i will go back to Comskip..outputting both .EDL and .VPRJ. That way if we happen to be watching it and the video hasn't been cut yet, i can still auto-skip within Sage using the .EDL file. So then i would have a second dirmon2 job target on the .EDL or .VPRJ and start cutting and/or compressing.


FWIW, here's my dirmon2.ini job:

[Job Description 1]
Name = MyCompress
Processor = C:/Program Files/SageTV/utils/mycompress.cmd
Targets Are Paths = 1
Targets Are Extensions = 0
Command Line Options =
Must Exist 1 =
Must Exist Logic = OR
Must Exist 2 =
Must And Or Must Not Exist Logic = AND
Must Not Exist 1 = (\.vprj$)
Must Not Exist Logic = OR
Must Not Exist 2 = (\.clean\.mpg$)
Directory 1 = H:/recordings
Directory 2 = I:/recordings
Target 1 = (\.mpg$)
Resources Needed = 50
Timeout Enabled = 0
Timeout = -1
Priority Boost Due To Job Description = 0
Priority Boost Due To Age = 2
Priority Boost Due To Name = 0
Process Subdirectories = 1
Wait Until File Is Finished = 0
Wait Until File Is Idle = 0
Wait Until File Is Not Growing = 0
Wait Until File Is Not Growing Time = 1
Wait Until Drive Is Idle = 0
Wait Until Drive Is Idle Time = 2
Hide Console = 0
Blackout Enabled = 0
Blackout Start Time = 0
Blackout End Time = 0
Avoid Hidden Files = 1
Avoid Large Files = 0
Avoid Files Larger Than = -1
Avoid Small Files = 0
Avoid Files Smaller Than = -1
Avoid New Files = 0
Avoid Files Newer Than = -1
Avoid Old Files = 0
Avoid Files Older Than = -1
Reply With Quote
  #12  
Old 09-08-2008, 06:40 PM
toricred's Avatar
toricred toricred is offline
Sage Icon
 
Join Date: Jan 2006
Location: Northern New Mexico
Posts: 1,729
The target filename (including path) is automatically sent as the first (I think, but it may be the last) argument without your having to do anything to get it there.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comskip Monitor: Announcement Steep SageTV Customizations 340 09-26-2020 09:23 AM
STV Import: Comskip Playback for Default STV (v1.5.4 30/August/2008 for SageTV 5/6) JREkiwi SageTV Customizations 600 11-23-2011 07:58 AM
Sage TV partial recordings and Comskip garyellis SageTV Customizations 4 04-22-2009 04:33 PM
ubuntu 8.04 + DirMon2 + comskip ntk2 SageTV Customizations 0 07-27-2008 06:50 PM
Comskip and DirMon2 bkejser SageTV Customizations 5 04-02-2006 07:53 PM


All times are GMT -6. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.