Change FFMPEG Cut Command?

I have had an ongoing issue with when commercials are removed, there is a sometimes up to 3-4 seconds left of commercial break. Maybe my expectations are a little unrealistic, but my understanding is that it would be removed from black frame to black frame. I have troubleshooted my Comskip INI and gained a greater understanding on how to tweak that. I do not believe the fault lies in my Comskip file. Instead, I believe the trouble to being the FFMPEG command used for cutting. It appears as though in order to accurately cut the video, the video needs de-coded and then re-encoded. Referencing Seeking – FFmpeg and Cutting Videos with FFmpeg | Mark Buckler

Is there a way to tweak the FFMPEG command for cutting? Thanks!

I am not sure but the problem may be that ffmpeg can only cut on a keyframe, this is part of dealing with compressed video. Even broadcast TV is compressed to a degree so you still have keyframes in the video.

You may be experiencing a compound problem, I am only guessing here, that is a combination of the accuracy of the Comskip + the need to cut on a key frame. I think Comskip is conservative and is set to leave a little commercial rather than cut out programming. You can adjust this in settings but then you will likely loose programming.

When I do use Comskip, which is rarely, I leave it set to normal and use Unprocessed TS as my profile since once you encode and compress again the keyframes seem to get larger. I then take that TS file and run it through Avidemux and in a few minutes a recording I make any adjustments to the cutting of commercials. If you play with Avidemux you can get pretty quick at it…I am doing it right now with some recordings from the History Channel…the hardest channel I have found to get the commercials cut from properly due to the fact they mix resolutions in the stream during commercials.

If you don’t want to do any manual editing, which I do because I am archiving these shows, then you may have to deal with little tidbits of commercials to prevent losing programming.

This is my experience, I may be wrong…but I have a rock solid regimen now for removing commercials…even though it has manual editing involved.

I appreciate the response. I will try the TS unprocessed profile and see if that works somewhat.

I have spent weeks reading the various topics and tuning guides via Comskip, and when running my file through Comskip GUI my cut marks have been spot on with the black. I’ve attempted to sign up at the forums to have Erik from Comskip review my settings to make sure nothing weird is going on, but I can’t get a verification email from the forums and no response when emailing their support email.

I am attempting to do this somewhat automated as the amount of Hallmark movies and shows my wife likes to record work make it a full time job for me to keep up with manually editing lol.

And again, this may be unreasonable expectations on my end. But reading Plex forums amongst other forums - you assume that everyone else’s setup allows for a fairly automated process with the odd commercial break sneaking in which I could live with. Not the every break leaving 3-4 seconds in it.

If it’s leaving 3-4 seconds that is a problem with the Comskip setup, if it was a keyframe issue then it would be a second at most.

I record tons of Hallmark movies for the GF and I tried automated commercial removal and was unhappy with the results so I manually edit movies every night to move into the queue for MCEBuddy to convert and store.

Just to clarify - I do say 3-4 seconds as a blanket statement. The time does vary based on the source material, but it can be as little as a half a second up to 2-3. Maybe I can upload a video to demonstrate to my Dropbox once I try the unprocessed profile.

If you do this long enough you’ll notice that no channel handles commercial breaks the same way which is why it is hard for Comskip to be accurate with blanket settings. You could have special settings for each channel but I don’t know how MCEBuddy would handle that.

Hallmark, Hallmark Movies & Mysteries, Lifetime, Lifetime Movie Network, ION and UP channel all play similar content and movies yet each one handles commercials differently and at different times…none are 100% predictable.

Sometimes there are breaks with several seconds of black screen before and after the commmercial. Sometimes it fades to black and then out of black, sometime if simply fades from the program into the commercial (with no real good cut point) and sometimes it is a hard break in one frame from the program to the commercial and back which once again has no good cut points on a keyframe…although you won’t notice as there is usually no audio at those points. And the worst point is that in a given movie on a given channel it may use more or all these transitions in ONE movie so it is very hard to predict.

This is why I switched to manual editing because I compress them afterwards and store them on me media server to watch at anytime so I want the cuts to be seamless and play like a continuous movie.

Using Avidemux I can do a movie in about 5 minutes while watching TV. I usually spend the last of my evening when the GF goes to bed watching my shows and editing things to put on Emby.

I am back to my original question of the ability to alter the FFMPEG cut command. I can get accurate cuts with no keyframe issues of a second or two of commercial left when using VideoRedo using Comskip. So my original suspicions at least seem valid. Unless someone else can point me in a working setup in which the MPEG streams I am recording from my HDHomeRun Prime using PlexDVR can cleanly have commercials ran. I’m interested in a somewhat automated setup. I’m not looking for perfection here, I can live with the occasional imperfection. However when it’s every recording, a tad bit annoying.

If it is consistently a particular show or channel you can setup a custom MCEBuddy profile (Conversion Task) just for them (put it at the top so it will grab the job first).

There are settings to cut some seconds off the start and end, but that is BEFORE ad-detection/cutting.
However, there is also a place where you can select a custom COMSKIP .ini file just for files processed in this profile/Conversion Task.

If you do find the options in Comskip to trim “extra” off the ads, put them in a special comskip.ini and then set this conversion task to use that comskip.ini file.

Good luck.