2019-09-10, 21:41
Hi,
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
Movie setup
One movie, e.g. Big Buck Bunny (CC license). I get the number of frames by using ffmpeg:
Framerate is 24.0 fps (can be identified using MediaInfo)
I then created a movie.txt with following content:
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):
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:
https://github.com/xbmc/xbmc/blob/99ace7...l.cpp#L349
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):
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 ( https://kodi.wiki/view/Edit_decision_list#Comskip ) 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.
Regards,
Andre
(if this is indeed a bug, I'll open a bug report on GitHub; or maybe I'm just too tired)
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
Code:
$ kodi --version
18.4 Git:20190831-3ade758 Media Center Kodi
Copyright © 2005-2019 Team Kodi - http://kodi.tv
Code:
$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:
Code:
$ ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 movie.mov
14315
I then created a movie.txt with following content:
Code:
FILE PROCESSING COMPLETE 14315 FRAMES AT 24
------------------------
24 240
Now if I have a look into Kodi's debug log (shortened):
Code:
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
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:
https://github.com/xbmc/xbmc/blob/99ace7...l.cpp#L349
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):
Code:
ReadComskip - Frame rate not in Comskip file. Using detected frames per second: -nan
So: Am I stupid? Is the framerate in the comskip file not in fps? Is it another format?
The wiki ( https://kodi.wiki/view/Edit_decision_list#Comskip ) 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.
Regards,
Andre
(if this is indeed a bug, I'll open a bug report on GitHub; or maybe I'm just too tired)