.ts live-tv processing?

Where all the user feedback and suggestions for improvements go
Post Reply
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

.ts live-tv processing?

Post by Jagad »

Hi!

I'm somewhat confused cuz there's some contradictory messages. I saw in the announcements thread the newest build some words that may imply live-tv processing for .ts files now is working.
For all those that use .dvrms or .ts with mpeg video, give it a try.
Live-tv procesing for dvrms has not been tested as nobody volunteered to help
I'm not sure though, cuz the readme.txt (included with 81_039_donators) says something different:
WARNING!!!!!!!!!!!!!!!!!
the current comskip version can ONLY process .wtv files while recording. If used on other container types comskip will end premature and not find commercials.
I suppose I got it wrong and .ts live-tv processing is not working, yes?
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: .ts live-tv processing?

Post by erik »

Forgot to remove the WTV warning.
Build 0.81.040 is supposed to do live tv processing on .ts
But I have limited posibilities to test so maybe you can test?
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

Oh YES, I would be more than happy testing it :D
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

Yes, as fz1 mentions in this thread: viewtopic.php?f=5&t=1263
.ts live detection also ends too early. I find it hard to see when it actually ends. The overall pattern is it goes completely wrong after the last in-show commercial block. From here and on comskip applies cutmarks for the actual show. In between show trailer and post roll over into next show don't get detected at all cuz comskip already seem to have finished the commercial detection.

I'm new to Dirmon2 and haven't grasped all features yet. It's hard to see if comskip crashes or not. I though some signs comskip working alright would be visible in Dirmon2 GUI "Current Status" "Active jobs" pane as long as the trigger files are present in the recording directory, but it seems comskip live detection gets triggered merely some seconds every once in a while and then disappears from "Active jobs". During the idle periods there is no sign of any processing going on anywhere in Dirmon2 GUI. Wondering if it should be like that? Unfortunately I have no earlier live processing experience to compare with, so it's hard to know how it should work.

@erik, which files do you need for further analyzing?

Live processing VPrj
<Version>2
<Filename>D:\TV\Recording Service\20120723_02-54-02_Kanal 9_The listener - S02E09 13.ts
<VideoStreamPID>4100
<AudioStreamPID>4356
<SubtitlePID1>0
<Cut>0:734400000
<Cut>7215200000:8244400000
<Cut>13303200000:13732000000
<Cut>21285600000:27631600000
<SceneMarker 0>363200000
<SceneMarker 1>623200000
<SceneMarker 2>734000000
<SceneMarker 3>7214400000
<SceneMarker 4>7278000000
<SceneMarker 5>7880400000
<SceneMarker 6>7895200000
<SceneMarker 7>8126800000
<SceneMarker 8>8181600000
<SceneMarker 9>8244000000
<SceneMarker 10>13302400000
<SceneMarker 11>13368000000
<SceneMarker 12>13670000000
<SceneMarker 13>13731600000
<SceneMarker 14>21284800000
<SceneMarker 15>21349600000
<SceneMarker 16>21364000000
<SceneMarker 17>21596000000
<SceneMarker 18>21650800000
<SceneMarker 19>21713200000
<SceneMarker 20>27631600000
After recordings done processing VPrj
<Version>2
<Filename>D:\TV\Recording Service\20120723_02-54-02_Kanal 9_The listener - S02E09 13.ts
<VideoStreamPID>4100
<AudioStreamPID>4356
<SubtitlePID1>0
<Cut>0:734400000
<Cut>7215200000:8244400000
<Cut>13303200000:13732000000
<Cut>21285600000:21713600000
<Cut>27724400000:28757200000
<SceneMarker 0>363200000
<SceneMarker 1>623200000
<SceneMarker 2>734000000
<SceneMarker 3>7214400000
<SceneMarker 4>7278000000
<SceneMarker 5>7880400000
<SceneMarker 6>7895200000
<SceneMarker 7>8126800000
<SceneMarker 8>8181600000
<SceneMarker 9>8244000000
<SceneMarker 10>13302400000
<SceneMarker 11>13368000000
<SceneMarker 12>13670000000
<SceneMarker 13>13731600000
<SceneMarker 14>21284800000
<SceneMarker 15>21349600000
<SceneMarker 16>21364000000
<SceneMarker 17>21596000000
<SceneMarker 18>21650800000
<SceneMarker 19>21713200000
<SceneMarker 20>27723600000
<SceneMarker 21>27835200000
<SceneMarker 22>28757400000
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: .ts live-tv processing?

Post by erik »

I found the problem and I'm currently trying to solve
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

Argh, there is always something that will jump up and bite you...turns out Dirmon2 does not handle unicode filenames and comskip .ts live processing fails accordingly. Well well...not much to do! Perhaps someone knows about some unicoded alternative to Dirmon2? If not it is time to make my own filewatcher script solving this :)
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

erik wrote:Can you try build 0.81.041?
Ok, I can confirm .ts live detection works alright. Reason for it ended early for me before, was due to lack of understanding how Comskip performs live detection. Comskip seem to use a static interval schedule. I don't know if it's Comskip or Dirmon2 who makes it static. The pattern for live processing are as follows if using Dirmon2 filewatcher.
- First processing interval occurs about 5 minutes after recording starts
- Second processing interval occurs about 10 minutes after the first interval.
- Third to what ever processing interval needed for the actual show occurs every 10 minutes.

Lets say if having a show with 30 minutes of duration:
Live processing Step 1 - 5 minutes into the show
Live processing Step 2 - 15 minutes into the show
Live processing Step 3 - 25 minutes into the show
Live processing Step 4 - should occur after 35 minutes, but by then the recording has ended.

Now, in my case I have a script launched by an after recording task which automatically moves the .txt and .log file for the recording into a subfolder. In Dirmon2 I was using the .txt and .log files as triggers only. So if moving the only triggers, Step 4 will not get executed. Hence the Comskip output never gets finalized. If not moving the trigger files Comskip output gets finalized alright 5 minutes after recording finishes.

All along I did expect Comskip was abled to sense when the recording finishes, but it's obviously not so. Comskip sticks persistently with the static interval schedule. When thinking of it, it was kind of naive believing Comskip could be that smart. That would require some interaction with the PVR system extracting duration parameters for recordings, which is nothing other than wishful thinking if you wanna have a tool working for 50 different PVR systems.

Well, as a defence speech this is the first time using a filewatcher and live detection also for that matter ;) Takes some time to grasp everything :) Thankfully it will get easier when my PVR system recording timers supports file/script launching when recording starts. In that way one can retrieve placeholders/paramaters instantly and use them when calling Comskip, making filewatchers obsolete entirely.

All in all thanks for a work well done erik :)

Best regards
Jagad
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

Better to forge the iron while it's hot so to say...so I would like to take the opportunity to ask some questions on things I haven't understood yet about LiveTV detection.

1. I would like to find a way to stop using these crappy filewatchers and use comskip alone for LiveTV detection.
The optimal solution would be to launch comskip once when the recording starts and have it continuously running until the recording finishes (console window never closes until last LiveTV detection step is done). I haven't found any info on this in the forum and are wondering if that is possible? As is now you need these infernal filewatchers to launch comskip according to a interval schedule, cuz if not comskip processes just as much the recording has progressed and then shuts down and never restarts.

2. Isn't much of a question, but more of a suggestion/request. As a continuation of question 1 that implies Comskip working according to a static LiveTV detection interval schedule. For example it idles for the first 5 minutes, then performs LiveTV detection and idles out 10 minutes, LiveTV processing again and idles out again. Now, the cool part would be having comskip detect when the recording finishes and run the finalizing LiveTV detection step there and then. It should be very easy to accomplish coding wise. Since Comskip already knows the path and location for the file in process it should be easy to monitor the properties of this file. If mediafile is still in recording the modification time equals (=) the startime/creationtime. When recording stops modification time changes to a_now (time right now).
If modification time - creation time >= 1 that's when comskip launches the finalizing LiveTV processing step and overrules the interval schedule.
Summarizing it, the LiveTV detection interval schedule (that could be tweaked) and the file property monitoring should be possible to turn off by a proper switch "live_tv=0" and that really means LiveTV detection is not possible if the parameter is disabled. Hopefully that could be something to implement in the future?

Regards
Jagad
Last edited by Jagad on Fri Jul 27, 2012 1:22 pm, edited 1 time in total.
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: .ts live-tv processing?

Post by erik »

1: That is how I use comskip. It gets started seconds after the recording starts (directly from my PVR application), no additional file watcher. And comskip finishes seconds after the recording finishes.

The problem to get this correctly implemented is that the container handler (ffmpeg TS file reader) software I use now in this new version is so complex and never designed to read TS files while being recorded I have to find my way around.
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

Aha, I didn't know! Thanks for explaining it :)
Keeping my fingers crossed you'll find some time to straighten out the question marks regarding the ffmpeg TS file reader :D

Best regards
Jagad
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: .ts live-tv processing?

Post by Jagad »

erik wrote:1: That is how I use comskip. It gets started seconds after the recording starts (directly from my PVR application), no additional file watcher. And comskip finishes seconds after the recording finishes.

The problem to get this correctly implemented is that the container handler (ffmpeg TS file reader) software I use now in this new version is so complex and never designed to read TS files while being recorded I have to find my way around.
Sorry for being a bit slow, starting to understand it better now and contemplating what you said and testing earlier versions I've came to the conclusion LiveTV .ts detection does not work at all. Comskip just performs normal finished recording processing repeatedly if using Dirmon2 on live recordings. Each run takes about 30 sec and then comskip closes. It works the same way if using older builds. If .ts livetv detection had worked comskip would have been running as long as the file was in recording.

Based on what you say in the last sentence I suppose the goal was to find a workaround for the ffmpeg TS file reader deficiency and make it work as you descibe in the first and second sentence.

Sorry for the missunderstanding, my newbieness on how LiveTV detection is supposed to work generally confused everything for me. So, we are actually back to square one regarding .ts livetv detection :oops:
Post Reply