KMTTG Work in Progress (formerly API changed?)

SamuriHL

Member
You don't need the specific MPEG2 or H264 parts of the profile. All profiles in v6 are match source so you can just use the "Transport Stream" profile and it'll pick MPEG-2 or H.264 automatically based on the source. The profile IDs have also changed. Although I'm not sure what he's using those for. I don't think we use profile IDs as input on any of the functions. Just the name or full XML of the profile.

There are also some tricks with the COM you could use. If you provide no profile at all it will attempt to pick a profile based on the extension of the output file. So if the output file is video.mp4 it'll pick the first profile that uses the .mp4 extension. There is also a hidden option where if you pass "sas" as the profile name it'll actually automatically find the profile that most closely matches the source file. This works for both codec and format. So if you pass in an H.264 .tivo file it will output an H.264 .tivo file.
Yea, I figured I didn't need the mpeg2 and h264 stuff. I left in that legacy part of his script for now. I'll likely refactor this to simplify it further. I didn't write these scripts and I don't get to control how they're called from the java code. So I'm working within the framework he's built, but, as you said, there are a few tricks I can play with. Honestly I feel the whole thing should be rewritten as a powershell script anyway, but, that's besides the point. :D That's nifty on the filename trick. In my case I'm trying to get it OUT of TiVo format and into a TS file. And because Xfinity sucks so bad, I HAVE to qsfix my files to prevent VideoRedo from hanging trying to output the edited files. Yes, they're THAT broken. In any case, I will likely take a look at simplifying these further for people. I just wanted to get them working first. Again, thanks so much for the support. I'm back in business just in time for season premieres with a total V6 solution. AWESOME!
 

SamuriHL

Member
ok I broke the progress bar in KMTTG on these scripts. I'll fix them later. The point is they work for now. You just won't know when it'll be done. :D
 

minimeh

New member
qsfix.vbs

Code:
...
'  Decide on output types
if ( c = "mpegts" ) then
   profileName = "Transport Stream"
   if ( v = "h264" ) then
      profileName = "Transport Stream"
   end if
end if
...
Thanks for your contributions!

I have a question with the quoted code snippet: In the first if clause, profileName is set to "Transport Stream". Then in the next if clause, profileName could be set to "Transport Stream", which of course it already is. Was the second if clause not meant to be encased in the first? Or was profileName meant to be something different in the second if clause?
 

SamuriHL

Member
Thanks for your contributions!

I have a question with the quoted code snippet: In the first if clause, profileName is set to "Transport Stream". Then in the next if clause, profileName could be set to "Transport Stream", which of course it already is. Was the second if clause not meant to be encased in the first? Or was profileName meant to be something different in the second if clause?
It's a holdover from the original code. Quite frankly that whole section can go away and in fact I edited it locally to remove it. What they were doing before is setting them to specific codec profiles and I simply took the codec out. So the first one was outputting mpeg2, the second one was outputting h.264. But since they're doing intelligent output now in V6 that's not needed and in fact can't be set like that anyway. So yea that whole block can go away. I just hadn't gotten back to updating it yet. This is what I changed it to locally:

' Decide on output types
profileName = "Transport Stream"
if ( c = "mp4" ) then
profileName = "MP4"
end if
 

SamuriHL

Member
Added adscan.vbs to the post with encode.vbs. And that's all she wrote from me on this topic. Enjoy everyone!

EDIT: adscan isn't working properly. It never seems to end scanning. Grrrrrrr

EDIT2: Same problem with the adscan.vbs that ships with VRD (obviously modified to use the V6 COM calls). It just never ends scanning, stuck at 100%. I suspect this is a VRD issue of some kind.
 
Last edited:

minimeh

New member
Added adscan.vbs to the post with encode.vbs. And that's all she wrote from me on this topic. Enjoy everyone!

EDIT: adscan isn't working properly. It never seems to end scanning. Grrrrrrr

EDIT2: Same problem with the adscan.vbs that ships with VRD (obviously modified to use the V6 COM calls). It just never ends scanning, stuck at 100%. I suspect this is a VRD issue of some kind.
I had the same hang with adscan.vbs here. I found that the following seems to work well:
Code:
fileDuration = VideoRedo.FileGetOpenedFileDuration()
navigationCursorTime = 0
while( VideoRedo.InteractiveAdScanIsScanning() and navigationCursorTime < fileDuration)
    navigationCursorTime = VideoReDo.NavigationGetCursorTime()
    percent = "Progress: " & Int(navigationCursorTime*100/fileDuration) & "%"
    wscript.echo(percent)
    if not fso.FileExists(lockFile) then
        VideoReDo.OutputAbort()
        endtime = DateAdd("s", 15, Now)
        while( VideoRedo.InteractiveAdScanIsScanning() And (Now < endtime) )
            wscript.sleep 500
        wend
        VideoReDo.ProgramExit()
        wscript.quit 5
    end if
   wscript.sleep 2000
wend
 
Last edited:

SamuriHL

Member
Are you getting it to auto-cut the cut points? I am not no matter what I try. If the adscan is going to eventually end up replacing comskip for me, then I need auto-cuts to work.
 

minimeh

New member
My normal workflow involves using comskip for identifying commercials and then VideoRedo to review and finalize the cuts. If the video is something I want to archive (and I'm not just creating skip points for auto-skipping), then doing a save-as from VideoRedo to my container of choice (usually mkv). I've never seen anything accurate enough to just rely on automatic commercial cutting.

That said, from kmttg if you use an encode job, the output will have the cuts. I just tried it with decrypt, QS fix, Ad Detect, Ad Cut, and encode. I used the VideoRedo profile of "Matroska MKV". I used comskip for detecting commercials. I did not do a save-as from VideoRedo. The end product had the ads cut out.

Then I deleted all of the files produced by that run, turned on using VRD for detecting ads, and re-ran the same jobs on the same video. End result: the final video had the ads removed.
 

SamuriHL

Member
I think you misunderstand what auto cut means. When it creates the vrpj project file, auto cut actually cuts the marked parts (the commercials) in the project file instead of just setting the mark points. If you use comskip, as I currently do, then you're auto-cutting in the generated vrpj. You, like me, probably go "massage" the cut parts of the video to make sure it's right. I'm not talking about automagically saving the video. I'm talking about having the cut points automatically selected.
 

minimeh

New member
Yup, I'm not clear on what you are saying. I use comskip (the donor version). I guarantee you that it does not actually cut anything. Yes, it generates a vprj with scene markers and identified ad blocks marked. As does VRD ad scanning. In either case, no actual removal of ads from the video takes place. That happens when the file is saved by VRD, no matter if comskip generated the vprj or VRD did.

From http://www.comskip.org/
Comskip is a commercial detector. It is a windows console application that reads a mpeg or h.264 file and analyses the content based on a large amount of configurable parameters. After analysis it generates a file in various possible formats containing the location of the commercials inside the video file. The formats include input files for interactive video editors (VideoRedo, Cuttermaran,Mpeg2Schnitt...)
...
For automatic removal of the detected commercials from the mpeg PS recording you can use comclean.
...
Next to using Comclean you can also select other Comskip output formats and use Womble MPEGVCR or VideoRedo or you can use a MPEG player that can read one of the output formats of Comskip.
I wonder if maybe what you are seeing is that, at least in my experience, VRD ad scanning is less accurate than comskip. Thus, for the same video, the comskip generated vprj may have identified ad blocks and VRD may not, even to the point of no blocks at all, only scene markers?

I don't know, just trying to understand your point.
 

SamuriHL

Member
I see that you are not clear on what I'm saying. You're seeming to think I'm saying that it's cutting the video itself. That is *NOT* what I'm saying. I'm saying that for some of my videos that I've scanned using the script, it's not marking the cut points....it's only putting the hash marks where it finds things it thinks it should cut. I'm well aware of what comskip does, I've been a donator for over 10 years and use it religiously. I'm trying to see if I can get adscan to work as well or better than comskip. Comskip nicely marks the begin and end cut point in the project file. adscan is not doing that. Again, I will say this one more time, I'm NOT talking about modifying the video in anyway. I'm talking about how the project file defines the cut points.

(Yes, no blocks are being created, only the scene markers. That's exactly what I'm saying.)
 

SamuriHL

Member
And it's VERY possible adscan simply needs to be tuned, but, it's not doing it on any of my videos that I've scanned so far. I get scene markers (that are wildly wrong) but it's not actually marking the blocks to be cut for some messed up reason. We desperately need more documentation on the changes made to adscan and how to properly tune it. They added profiles to it for this very reason, which adscan.vbs isn't using. This is going to take a lot of work to figure out. For now I've gone back to comskip as I've had that tuned forever and it simply works. It's not perfect, as you've said, but, it's 90% with a little tweaking. My hope is that with proper profiles created for different stations/shows/whatever, that adscan can get that percentage higher. So far, for me, that's not even close to the case. :(
 

SamuriHL

Member
This is very frustrating because I get different results from scanning through the UI than I do with the adscan.vbs. I don't understand the differences here. Is the vbs doing interactive and the UI not by default? I'm very confused.
 

minimeh

New member
Okay, gotcha. Other than I have observed forever that comskip is much more accurate than VRD for ad scanning, I don't really worry about why. I did try tuning up VRD at one time, but now just happily use comskip.
 

SamuriHL

Member
Yeah I mean I do the same for day to day given how accurate comskip tends to be. I was just hoping with adscan being updated that we'd be able to tune it to be more accurate. So far that hasn't been my experience. Even through the UI and ensuring the logo is part of the scan I wasn't able to get adscan to accurately scan. I'm not going to worry too much about it for now. I want to get my encoding profiles setup this weekend cause a lot of my shows start next week. H265 is an awesome thing.
 

SamuriHL

Member
kmttg 2.4n has been released with the updated scripts for v6 support. Thanks to everyone that helped make that happen!
 
Top Bottom