-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expected chapter end timestamp, found END=.97. #7
Comments
This is how my edl file looks like: 0.97 4.87 0 I've changed the start chapter from 0.97 to 1.00 and now comcut works fine. We need to fix the logic because it was dropping the 0 and generating the ffmeta chapter as .97 instead of 0.97. I have no idea how to do that though. |
Could you test to see if the .ffmeta file has 0.97 instead of .97 (include leading zero) if ffmpeg accepts the metadata file? If so, then it should be an easy fix to make sure comcut includes a leading zero. |
No, the .ffmeta has .97, while the edl that comskip generates has the proper 0.97. |
Here are the .edl and the .ffmeta:
|
I guess I wasn't clear. Could you update the ffmeta file with the leading zero and run that into ffmpeg specifying it as the metadata file and see if that works? |
Yes, it works. |
K, good. Should be an easy fix then. |
Just added a commit to handle this. Give it a shot. |
Did not work. Here is the error:
Here is the generated .ffmeta:
If I manually change the 0.97 value on the edl file to 1.0, the script works just fine. |
Well it looks like I'll have to revert the last commit. I thought you had said that when you added the leading zero to the ffmeta file things worked fine. I want to avoid adding arbitrary rounding because things like that usually come back to haunt you. I'll have to actually do some of my own testing to get this working. |
I suspect this has to do with ffmpeg reading the START and END times in the metadata file as integer values. I've done some testing with changing the TIMEBASE to 1/1000 and multiplying the START and END times by 1000 and things seem to work. However for some reason multiplying the start and end times in the script is causing the end time to not be written to the metadata file. Once I figure this out I'll commit the change and you can confirm. |
Yep, the ffmpeg documentation confirmes the above. It states that START and END must be integer values. https://www.ffmpeg.org/ffmpeg-all.html#Metadata-1 That would explain why the decimal portion gets ignored. |
Turns out it wasn't just the metadata file. When making temp files for each chapter it needs to specify the start time and duration of each part. Apparently that needs have a leading zero for durations less than 1 second. |
Playing around with this. I used the multiply by 1000 method and it seems to work for my example:
Before and after diff of the .edl files:
Works for this one example. Is this the same method you used? What issue did you see? |
Take a look at the code commit, it's all in there. In comcut it was already doing the math by piping to bc. I just added a multiply factor of 1000 in there.
I then added this to comchap similarly in this commit.
In both cases I'm then piping to awk to format the string as an integer. The only real advantage this does is if the START or END times are less than 1 it avoids a value starting with a decimal point. The real problem with this bug, as it turns out, was not this. It had to do with the duration for chapters less than a second long and ffmpeg apparently needing a leading zero before the decimal point. Awk again took care of this by formatting the value as a floating point value. See this commit
|
Since you are already using awk, I'd recommend using it for the math as well. 'bc' isn't installed by default everywhere, whereas I believe awk is more universal. On my Ubuntu server 16.04, 'bc' wasn't installed by default. |
Sounds like a good idea. I lifted using |
Sure I'll do it later this evening. I already worked out a working example. |
Some of my recordings fails because the generated ffmeta file has the first chapter as:
[CHAPTER]
TIMEBASE=1/1
START=0
END=.97
This causes comskip to fail:
[ffmetadata @ 0x55744b6a0480] Expected chapter end timestamp, found END=.97.
[ffmetadata @ 0x55744b6a0480] Expected chapter start timestamp, found START=.97.
[ffmetadata @ 0x55744b6a0480] Expected chapter end timestamp, found START=.97.
Input #0, ffmetadata, from '/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.ffmeta':
Duration: 00:21:03.00, start: 0.000000, bitrate: 0 kb/s
Chapter #0:0: start 0.000000, end 115.000000
Chapter #0:1: start 0.000000, end 115.000000
Metadata:
END : 115.05
Chapter #0:2: start 115.000000, end 600.000000
Chapter #0:3: start 600.000000, end 1237.000000
Chapter #0:4: start 1237.000000, end 1263.000000
concat:/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.part-1.ts|/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.part-2.ts|/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.part-3.ts|/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.part-4.ts|/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.part-5.ts: No such file or directory
rm: cannot remove '/plex/The Big Bang Theory (2007) - S10E09 - The Geology Elevation.part-1.ts': No such file or directory
The text was updated successfully, but these errors were encountered: