Force trim beginning/end?

Here you can ask your questions on how to use Comskip for the detection of commercials. Also questions on how to remove commercials are welcome
KenBotwinick
Posts: 10
Joined: Sun Jul 14, 2013 9:16 pm

Force trim beginning/end?

Post by KenBotwinick »

Hi again,

I think I might be missing it, but is there a way to force trim a certain amount of time from the beginning/end regardless of commercial?

For instance, I always have to add a minute to the end of the Season Pass because shows don't actually start right on time. In the show I'm testing with, it starts 10 seconds after the hour, so if I don't add a minute, I miss the last 10 seconds ending of the show, which bugs me.

Would love a way to trim the first 10 seconds of a show and the last 50... Which would of course change from show to show, channel to channel, so would need to be configurable. And I'd love to do it with Comskip instead of having to find yet another tool...

I can't really use delete_show_before_or_after_current because the two different shows I've tested with so far don't have any commercials before or after them. It goes straight from show to show with all the commercials in the middles of the shows only...

There is a tiny, tiny amount of solid black in between the shows... And I mean tiny... But I'm not sure how I could make Comskip recognize them without creating lots of false positives in other areas...

Any way to accomplish what I'm looking for?

Thanks,
Ken
Last edited by KenBotwinick on Sun Jul 21, 2013 1:11 am, edited 1 time in total.
KenBotwinick
Posts: 10
Joined: Sun Jul 14, 2013 9:16 pm

Re: Force trip beginning/end?

Post by KenBotwinick »

For shows that always start out the exact same way, it looks like I can try cutscenefiles? Going to experiment.
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: Force trip beginning/end?

Post by Jagad »

KenBotwinick wrote:but is there a way to force trim a certain amount of time from the beginning/end regardless of commercial?
I believe this one has been requested many times, also by me not long ago:
viewtopic.php?f=2&t=1447

For some reason Erik doesn't seem particularly keen on introducing such a feature, which is unfortunate.
The main reason against it is of course the aftermath it brings in case of delays in broadcasters schedule. In my case I don't agree cuz the feature would be optional, do much more good than harm and more importantly I always save the original recording and can go back and trim that one manually if first comskip output turns out missing pieces of start/end in show. Delays in schedule isn't very common in my country anyway. It's good you bring up the request too. Perhaps that increases the chances Erik will implement it soon. Hope so :D
KenBotwinick
Posts: 10
Joined: Sun Jul 14, 2013 9:16 pm

Re: Force trip beginning/end?

Post by KenBotwinick »

Thinking outside the box, why can't we just edit the resulting .edl/.Xcl file to add in the cut points manually. Seems we should be able to predict the exact frame if we know it always happens 10 seconds in (for example). I'm going to try that. Run the show through Comskip to find all the real commercials automatically, have a script edit the .edl file to trim the beginning/end, THEN run the file through app to actually cut the commercials.
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: Force trip beginning/end?

Post by Jagad »

Well, the idea is very good, but in my case quite hard to accomplish. It's always tricky converting different time formats when scripting. Comskip outputs has various time formats depending on the requirements for the editor or player. VPrj output for VideoRedo for example time is converted to frames...well there's more factors to keep in mind and take height for to pull it off. All in all it's doable, but nothing I would like to spend time on when I can donate to Erik as thanks for doing it for me :wink: This feature should be available in Comskip IMHO.
LastButNotLeast
Posts: 39
Joined: Tue Jan 31, 2012 12:13 am

Re: Force trip beginning/end?

Post by LastButNotLeast »

Think this might help?
added_recording=14 (0-MAXINT)
;Amount of minutes that a recording is longer then the actual show + closing commercial (if any)
;;This value is used to determine the maximum amount to remove in the below delete_show_... settings
delete_show_after_last_commercial=0 (0=disabled / 1=on / 2-MAXINT amount of seconds)
;Any part of the show that comes after the last commercial is deleted when that part is shorter then added_recording (1) or the amount of seconds set (2 or more).
;;To be used when more then the actual show is recorded and part of the next show separated from the actual show with a commercial break is to be removed. Make sure there is ALWAYS a closing commercial recorded and recognized
delete_show_before_first_commercial=0 (0=disabled / 1=on / 2-MAXINT amount of seconds)
;Any part of the show that comes before the first commercial is deleted when that part is shorter then added_recording (1) or the amount of seconds set (2 or more).
;;To be used when the recording may start before the actual show and there is always a commercial break separating the two shows.
delete_show_before_or_after_current=0 (0=disabled / 1=on / 2-MAXINT amount of seconds)
;Any part of the show that comes before or after the actual show and is separated from the show by a small commercial block less then min_commercial_break is deleted when that part is shorter then added_recording (1) or the amount of seconds set (2 or more).
;;To be used when the recording contains more then the actual show and the preveious and next show are separated from the actual show with very small commercials, too small to be an actual commercial break
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Re: Force trip beginning/end?

Post by erik »

Delete before and after current show only works when there is a very short commercial break between the shows.
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: Force trip beginning/end?

Post by Jagad »

LastButNotLeast wrote:Think this might help?
Just tried it and it doesn't work. Didn't make any difference. VPrj looks the same despite there are short commercial breaks between the shows .
<Cut>2000000:266000000 ; should have been <Cut>0:1785200000 if it would have worked
<Cut>1345200000:1785200000
<Cut>7845200000:10978400000 ; in show commercials
<Cut>25652400000:27905600000 ; in show commercials
<Cut>31305200000:32408800000 ; in show commercials
<Cut>39320800000:40778800000 ; last cut should have been this, but is missing from original VPrj entirely
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Re: Force trip beginning/end?

Post by erik »

Looks like you have this pattern

Previous show 1
Commercial 1
Previous show 2
Commercial 2
Actual show

IF your recording would have started during "Previous show 2" and you would have set
delete_show_before_first_commercial=1
then comskip should have removed "previous show 2" and "commercial 2"
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: Force trip beginning/end?

Post by Jagad »

Hi Erik!

Well, that is not exactly the pattern for the start. It looks like this:

Previous show 1 ; 0,5 seconds in the very beginning does not get cutmarked
Previous show 2 ; in first cut previous show gets recognised correctly
Previous show 3 ; Comskip suddenly mistakes the previous show that hasn't ended yet for the actual show and leaves it uncut.
Commercial 1 ; second cut correctly right between previous show ends and commercial starts.
Actual show

The problematic parts is Previous show 1 and Previous show 3. Those ones should have been cutted out when using "delete_show_before_first_commercial=1"
which I am, but it has only partial or no effect. No matter how i try to tune my ini the behaviour's stays the same.
"delete_show_after_last_commercial=1"
has no effect what so ever on these recordings made on two of my channels. For the rest of my channels (another ini) same delete commands works great.
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Re: Force trip beginning/end?

Post by erik »

Can you mail the log file?
Maybe its because too many cutpoints are generated.
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: Force trip beginning/end?

Post by Jagad »

Mail is on it's way :)

/Jagad
KenBotwinick
Posts: 10
Joined: Sun Jul 14, 2013 9:16 pm

Re: Force trip beginning/end?

Post by KenBotwinick »

It seems like the following logic would work, I just don't know how to implement it:

If it's less than x minutes from the beginning or end of the file (usually less than 2 mins), then consider ANY single, solid black frame as the gap between abutting shows (that are not separated by commercials) and trim there. But don't use that logic anywhere else for standard commercial detection...

How to do? :(
Jagad
Posts: 131
Joined: Wed Dec 07, 2011 12:37 am

Re: Force trip beginning/end?

Post by Jagad »

Wow, it actually looks like you're taking a shot at that trim script...impressive :)
Well, if scripting it according to this logic, you have to overrule standard commercial detection.
To do it you have to use variables that you condition with IF and Else statements.
KenBotwinick
Posts: 10
Joined: Sun Jul 14, 2013 9:16 pm

Re: Force trim beginning/end?

Post by KenBotwinick »

Nah, I'm just going to give up. WAY too many options. If the developer can't suggest a way to successfully implement what I said in my last post, then I have absolutely no hope.

Just going to cut the commercials, encode to mp4, then use ffmpeg to trim beginning and end after the fact. Done.
Post Reply