Comskip randomly not detecting commercials

Configuration:
CoreELEC 19.5 running on Ugoos X3 box
TVH server CoreELEC addon v.19.5.105

Comskip randomly will not detect commercials on shows. On one show it will work perfectly. On the next episode of the same series no commercials will be detected. Or the next show on the same channel will have no commercials detected.

.edl, .txt, and .vdr files are being created but they have no frames listed when the commercials aren’t being skipped.

I noticed the following error multiple times in the Comskip log file when the commercials aren’t detected:
Panic: Audio buffer overflow, resetting audio buffer

Any suggestions on how to correct this?

Also, do I need all three .txt, .edl, and .vdr files or should I stop outputting some of them?

Thanks

Giving this a bump. I’m pretty sure my problem is related to the message below:

Panic: Audio buffer overflow, resetting audio buffer

Any reason I’m getting this message repeatedly on some shows but not others? Is this a problem that can be addressed by settings in the comskip.ini file or do I need to make changes in Kodi or TVHeadend?

Thanks

Where did you get comskip and what is the media source? Some streams like the crap from PlutoTV won’t create good comskip files, no matter how you tweak it.

Comskip.ini support would be here Support - Comskip Support Forum and here GitHub - erikkaashoek/Comskip: A free commercial detector

Martin

Comskip is included in the official Team CoreELEC Tvheadend server 4.3 add-on that downloaded form the CoreELEC Add-ons repository.

The media sources are OTA ATSC broadcasts from ABC, NBC, CBS, etc. And the streams play good when I watch them.

I have posted on the Comskip Support Forum but I hadn’t received a response. I thought it might also be a problem with the compilation of Comskip in the Tvheadend server addon (I had previously run Comskip in the TVH 4.2 server add-on without problems) or perhaps a problem with CoreELEC so I also posted here and on the Kodi forum incase it was a Kodi issue.

If you post a link to a 30 minute recording I can check if comskip works on it for me. It isn’t a tvheadend tool, the version posted is designed as a convenience for users by LibreElec and CoreElec just piggybacks. It wouldn’t be something this is test, but at the same time it is quite an old version.

Martin

I got a response from the Comskip forum:
“The reason for the “panic” message is an incompatible audio coding in the transmission format chosen by the broadcaster
This can not be solved with ini file settings.”

It seems strange that it would be the broadcast format. I record US OTA ATSC broadcasts that use AC3 audio. The problem happens on all networks (ABC, NBC, CBS, etc.). Perhaps there is something going on with my tuner. I periodically have problems with reception but they are usually in the summer due to a temperature inversion causing multipath, and the problems are quite obvious.

Here is a link to a 30 minute recording that had the problem. Sorry it took so long, I have crappy internet to begin with and between storms and power outages it took me this long to get it uploaded.

https://drive.google.com/drive/folders/1H8IKLCbucndr_QBoGsXorCq8CCWBUX3l?usp=share_link

Thanks for your help

I don’t think the issue is ac3 or tuner since I tried the sample with both my Windows and Debian NextPVR backend installs with the comskip I used and it generates this comskip

720.94 876.83 3
1329.57 1797.93 3

which seems to work correctly except it misses one program block I do find this is a particularly tricky sample because the logo detection will be harder with the scrolling news taking up so much screen. Do traditional broadcasts works better?

Also what Amlogic chip are you using for doing the comskip? I will try and use it here as a sample.

Interesting. I use Tvheadend for my OTA recordings, how do you setup the comskip? Do you have a link to show how to do that? Also, does the comskip leave the closed captions?
thanks/

I did find one comskip.ini tweak for that show to catch that short segment in the commercials.

min_show_segment_length=110

720.94 876.83 3
1329.57 1485.49 3
1599.17 1797.93 3

Ridiculous to have that small segment, probably even skipping by minutes you might miss it.

Martin

The strange thing is the problem is completely random. The same news show on the same channel at the same time didn’t have the error the night before or the night after. I don’t think I’ve had a series or station that never had the problem, nor a series or station that always has the problem. The only “possible” connection I’ve noticed is when I’ve recorded two shows back to back the first show will have the problem but the second show won’t. I.e., Comskip is processing the first show while the second show is recording, but I haven’t confirmed this is always the case.

I’m running a Ugoos X3 Cube with a S905X3 processor (2GB RAM/16GB storage).

Here is a thread I started a while back:

I ran this with CE on the GT King II and it has the same panics and no commercials , so I would think it would be a comskip issue. Next time I have a chance I will build the newer comskip and see if it helps. There have been call to update it update comskip - Development - LibreELEC Forum

Thanks for all your help!

One other note. I don’t remember this happening when I was using the CoreELEC TVH 4.2 server package. It might have been but I don’t remember specifically.

I don’t think the issue is random there is something about the file that is causing an issue with arm32 comskip. I tried the the current version and it fails the same way. If you remux it with ffmpeg -i filename.ts -codec copy newfile.ts the second audio channel is removed.

Interesting, the problem happens to about half the recordings I make no matter what network. The broadcasters in my area have started playing with ATSC 3, I wonder if it has something to do with that. Or, as I mentioned, maybe my SD HDHomerun Quatro tuner is doing something.

I believe the issue with your file has PMT data for all streams on the mux not just the one you are recording. Maybe you can configure TVHeadend to rewrite the file?

Srv Id  Service Name                              Access          Bitrate  |
|  0x0001  KCRA-TV ...................................... C    5,255,053 b/s  |
|  0x0002  Me-TV ........................................ C          Unknown  |
|  0x0003  KCRA-3 ....................................... C          Unknown  |
|  0x0004  KQCA ......................................... C          Unknown  |
|  0x0005  H and I ...................................... C          Unknown  |
|  0x0006  KCRA-4 ....................................... C          Unknown  |

Cleaning out the bad PMT values generates good comskip files

You’ve gone above my skill level here. Are there settings in Tvheadend that you are suggesting I change?

No idea, I use NextPVR and have never seen these except on full mux captures.

It appears that Tvheadend has the ability to rewrite the stream with just the PMT data I’m recording (at least if I’m interpreting it correctly). However, that was the default setting so it appears to be ignoring the setting if all the PMT data for all the streams are getting recorded.

I did some research and supposedly Kodi only supports the htsp stream profile but I must be misunderstand that because my recordings play fine. I’m assuming “pass” means passthrough so it isn’t reencoding. However, when I go to Configuration → Recording → (default profile) → Stream Profile pass is selected. If I change stream profile to htsp and select Save the htsp stream profile doesn’t stick and it reverts back to pass. However any other stream profile will stick. I tried cloning the default recording profile and htsp still doesn’t stick. Are there some other settings I should try?

I’ve attached some screenshots.