plugorgau / bbb-render

Scripts to convert a BigBlueButton recording into a single video file
MIT License
64 stars 26 forks source link

IntervalTree: Null Interval objects not allowed in IntervalTree #20

Open jmlich opened 2 years ago

jmlich commented 2 years ago

I have seen following exception:

+ ./bbb-render/make-xges.py --start 21315 --end 30730 --backdrop ./output/so-4-15-00-pavel-pisa-michal-lenc-diskuze.png --opening-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/output2/so-4-15-00-pavel-pisa-michal-lenc-diskuze.png --opening-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/1.png --closing-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/2.png --closing-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/3.png --annotations -- /home/jmlich/Desktop/openalt2021-zaznamy/openalt4_sobota_2021/presentation/b530a151c013923f4321a0661de8e344a2d77b0c-1636183223742 /home/jmlich/workspace/openalt2021/bbb-batch-render/tmp/so-4-15-00-pavel-pisa-michal-lenc-diskuze.xges
Error
Traceback (most recent call last):
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 471, in <module>
    sys.exit(main(sys.argv))
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 466, in main
    p = Presentation(opts)
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 52, in __init__
    self.add_slides(self.opts.annotations)
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 272, in add_slides
    t.addi(start, end, [(index, shape)])
  File "/usr/lib/python3.10/site-packages/intervaltree/intervaltree.py", line 343, in addi
    return self.add(Interval(begin, end, data))
  File "/usr/lib/python3.10/site-packages/intervaltree/intervaltree.py", line 324, in add
    raise ValueError(
ValueError: IntervalTree: Null Interval objects not allowed in IntervalTree: Interval(30322100000000, 30322100000000, [(0, <Element '{http://www.w3.org/2000/svg}g' at 0x7f3fa34875b0>)])

I decided not to insert slides when start time is a same as end time. I am not sure if this is a good solution.

diff --git a/make-xges.py b/make-xges.py
index 4df2d9d..4f4eb2f 100755
--- a/make-xges.py
+++ b/make-xges.py
@@ -267,6 +267,8 @@ class Presentation:
                 if end < self.start_time or start > self.end_time:
                     continue

+                if start == end: # Null Interval objects not allowed in IntervalTree
+                    continue
                 t.addi(start, end, [(index, shape)])

             t.split_overlaps()
ak4off commented 3 months ago

Did you find a solution ?

jmlich commented 3 months ago

Diff is above ^