Comskip movie.txt framerate: What does Kodi expect? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228) +---- Thread: Comskip movie.txt framerate: What does Kodi expect? (/showthread.php?tid=347159) |
Comskip movie.txt framerate: What does Kodi expect? - bugwelle - 2019-09-10 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 Code: $ kodi --version Code: $cat /etc/os-release 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 I then created a movie.txt with following content: Code: FILE PROCESSING COMPLETE 14315 FRAMES AT 24 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 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/99ace7207435785ba26cf8e4f108c1d3664b2b30/xbmc/cores/VideoPlayer/Edl.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) RE: Comskip movie.txt framerate: What does Kodi expect? - DaVu - 2019-09-11 could we please see the complete log RE: Comskip movie.txt framerate: What does Kodi expect? - DaVu - 2019-09-11 Assuming there's nothing interlaced: https://github.com/xbmc/xbmc/blob/99ace7207435785ba26cf8e4f108c1d3664b2b30/xbmc/cores/VideoPlayer/Edl.cpp#L87-L88 By looking at this: https://github.com/xbmc/xbmc/blob/99ace7207435785ba26cf8e4f108c1d3664b2b30/xbmc/cores/VideoPlayer/Edl.cpp#L339-L347 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 RE: Comskip movie.txt framerate: What does Kodi expect? - bugwelle - 2019-09-11 (2019-09-11, 07:44)DaVu Wrote: could we please see the complete logOf 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 https://peach.blender.org/about/ ) Movie: https://drive.google.com/open?id=1h5X8oWoxwoaai1hI1TB_3ayDfnOf6VYK Kodi log (Comskip with framerate): https://paste.kodi.tv/ureqosameq.kodi Kodi log (Comskip without framerate): https://paste.kodi.tv/icufecefoh.kodi 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 videoMay I ask: What influence would an interlaced video have? Wouldn't the factor then just be two? (I'm by far no encoding expert) Regards, Andre RE: Comskip movie.txt framerate: What does Kodi expect? - bugwelle - 2019-09-11 The -nan issue will by fixed by: https://github.com/xbmc/xbmc/pull/16584 RE: Comskip movie.txt framerate: What does Kodi expect? - DaVu - 2019-09-12 (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 I just tried to understand where the calculation might come from or where it might go wrong. This section explains video heights and framrates: https://github.com/xbmc/xbmc/blob/99ace7207435785ba26cf8e4f108c1d3664b2b30/xbmc/cores/VideoPlayer/Edl.cpp#L63-L86 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: Code:
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 |