Comskip movie.txt framerate: What does Kodi expect?

so I wanted to try out Kodi's "skip ads" feature and generated a Comskip file by hand. I ran into trouble which is either because of my misunderstanding of the format or a bug in Kodi. Any help is welcome.

My system
$ kodi --version
18.4 Git:20190831-3ade758 Media Center Kodi
Copyright © 2005-2019 Team Kodi -
$cat /etc/os-release    
PRETTY_NAME="Ubuntu 18.04.3 LTS"

Movie setup
One movie, e.g. Big Buck Bunny (CC license). I get the number of frames by using ffmpeg:
$ ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1
Framerate is 24.0 fps (can be identified using MediaInfo)
I then created a movie.txt with following content:
24   240
Well, I would assume that Kodi skips second 1 to 10. If I have 24 frames with 24 frames per second I get one second, right?
Now if I have a look into Kodi's debug log (shortened):
DEBUG: AddCut - Pushing new cut to back [00:01:40.000 - 00:16:40.000], 3
DEBUG: ReadComskip - Read 1 commercial breaks from Comskip file: /home/movies/Big-Buck-Bunny/movie.txt
DEBUG: AddSceneMarker - Inserting new scene marker: 00:01:40.000
DEBUG: AddSceneMarker - Inserting new scene marker: 00:16:40.000
What the heck? Why does it start at 1 minute and 40 seconds? Kodi actually skips the whole movie after that (because the movie itself is only 10min long and the last marker is at 16min).

I had a look the the source code and found that Kodi divides the framerate by 100 if one is provided in the comskip file:

Increasing the frame rate by a factor of 100 (i.e. 2400) fixes everything. Kodi skips second one through ten.
Also note that if I don't enter the number of frames and framerate, I get following warning (for whatever reason):
ReadComskip - Frame rate not in Comskip file. Using detected frames per second: -nan
That's another issue but that's not the point here. Just one reason why I added the frame rate to the Comskip file. :-)

So: Am I stupid? Is the framerate in the comskip file not in fps? Is it another format?
The wiki ( ) also uses 25 as an example framerate.

My "fix" would be to simply remove the division by 100. But that may break other things. After all, the code is more than 10 years old. For 10 years the frame rate was divided by 100. So there has to be some secret to it? Something that I'm missing? :-)
Any help welcome.

PS: I know that there are/were issues with EDL. That's why I used Comskip.

(if this is indeed a bug, I'll open a bug report on GitHub; or maybe I'm just too tired)
could we please see the complete log
Assuming there's nothing interlaced:

By looking at this:

and the fact that you have given the complete frames of the video and the fps this if-section should be passed and the else-section should jump in where we have the devision through 100 which might be wrong for not interlaced video.

So this might be a bug, yes. Probably most likely the comskip feature was created at the times where live TV hasn't had any non interlaced streams, probably. And you are trying to use comskip files from a BR/4k movie?!

If "fFrameRate" already is multiplied by 100 somewhere before, then what I've written above might be nonsense Wink
(2019-09-11, 07:44)DaVu Wrote: could we please see the complete log
Of course. I didn't provide one because I first wanted to ensure that it's not because of a misunderstanding.
I'll also give you the movie (it's CC licensed, see )

Kodi log (Comskip with framerate): ureqosameq.kodi (paste)
Kodi log (Comskip without framerate): icufecefoh.kodi (paste)

I'll keep the movie online for a week or two. Just if anything is wondering about dead links in the future. :-)
Quote:which might be wrong for not interlaced video
May I ask: What influence would an interlaced video have? Wouldn't the factor then just be two? (I'm by far no encoding expert)

The -nan issue will by fixed by: 16584 (PR)
(2019-09-11, 12:06)bugwelle Wrote: May I ask: What influence would an interlaced video have? Wouldn't the factor then just be two? (I'm by far no encoding expert)

And I'm by far not a developer Big Grin

I just tried to understand where the calculation might come from or where it might go wrong. This section explains video heights and framrates:

Where we have different calculations for different conditions and also sometimes calculate fFrameRate * 100 to get 5994 instead of 59.94

Anyway, from your log I see:

Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 5146 kb/s, 24 fps, 24 tbr, 2400 tbn, 4800 tbc (default)

So the else-section:


else // Assume everything else is not interlaced, e.g. 720p.
fFramesPerSecond = fFrameRate;

should jump in.

Later (as you have given the the complete frames and the specified the framerate) we have the division through 100, you already mentioned above. So I'm somewhat confused what the value of fFramerate actually is. Above in the code we set "fFramesPerSecond = fFrameRate" and later we divide "fFrameRate /= 100". So I'm not so sure if there could be a difference for interlaced or non interlaced videos.

But as said, I'm not a dev Wink
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
Comskip movie.txt framerate: What does Kodi expect?00