cubicibo / SUPer

HDMV PGS (BD SUP) subtitle encoder compatible with typesetting effects.
GNU General Public License v3.0
21 stars 4 forks source link

Help! ValueError: could not broadcast input array from shape (124,207,4) into shape (22,97,4) #18

Closed Alllen closed 9 months ago

Alllen commented 9 months ago

Error Info:

Loading...
 SUPui: INFO : SUPer v0.2.3, (c) cubicibo
 SUPui: INFO : Advanced image quantizer armed: libimagequant
 SUPui: INFO : Starting optimiser process.
Loading...
 SUPer: INFO : Loading input BDN: F:/DIY/ass/sub.xml
SUPer: INFO : Library parameters: {'quant': ('D:\\win_x64_SUPer\\lib\\libimagequant_x86_64.dll', None)}
 SUPer: IINF : Parameters: quality_factor=0.85:refresh_rate=1.0:scale_fps=False:quantize_lib=3:bt_colorspace=bt709:enforce_dts=True:no_overlap=True:full_palette=True:output_all_formats=True:normal_case_ok=True:insert_acquisitions=0:ts_long=False:max_kbps=16000:log_to_file=5:ssim_tol=0.0
Process SUPinternal:
Traceback (most recent call last):
  File "multiprocessing\process.py", line 314, in _bootstrap
  File "multiprocessing\process.py", line 108, in run
  File "supergui.py", line 204, in from_bdnxml
  File "SUPer\interface.py", line 69, in optimise
  File "SUPer\filestreams.py", line 512, in __init__
  File "SUPer\filestreams.py", line 516, in parse
  File "SUPer\filestreams.py", line 567, in _parse_events
  File "SUPer\filestreams.py", line 295, in merge_events
ValueError: could not broadcast input array from shape (124,207,4) into shape (22,97,4)
 SUPui: INFO : Closed gracefully SUPer process.

BDNXml :

<?xml version="1.0" encoding="UTF-8"?>
<BDN Version="0.93" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="BD-03-006-0093b BDN File Format.xsd">
<Description>
<Name Title="sub" Content=""/>
<Language Code="eng"/>
<Format VideoFormat="1080P" FrameRate="23.976" DropFrame="false"/>
<Events LastEventOutTC="02:13:51:07" FirstEventInTC="00:00:10:06"
ContentInTC="00:00:00:00" ContentOutTC="02:13:55:03" NumberofEvents="8005" Type="Graphic"/>
</Description>
<Events>
.....
</Event>
</Events>
</BDN>
cubicibo commented 9 months ago

Hi, Your BDN sample is unhelpful. Please give a handful of events. I do understand that it uses split events (x_0.png, x_1.png), and that is bad. SUPer performs splitting internally. So when it opens a BDN XML with split events, it re-merges them back together, then split them again differently. But this code is essentially abandoned and will be removed. Only input without splits will be accepted in the future.

Do not use ass2bdnxml --split or avs2bdnxml -u1 or -b1 when you generate the BDN XML.

Alllen commented 9 months ago

sub.zip Hi, Thanks for your prompt reply. .XML example file is attached, please check it. I have been using avs2bdnxml with vsfilterMOD to convert my ass subtitles to BDNxml+png format subtitles and do use the additional parameter -b1 to optimize it to prevent scienaristBD authoring from getting buffer zone capacity over 4Mb, or video buffer over/ underflow when remuxing. I convert to xml and give it to SUPer to convert to pes+mui, every time and drag it directly into scienaristBD, as you said, the split operation is not allowed by SUPer, actually I have do it all the time (i.e. created one event contains two pngs: _0.png/_1.png), but there are times when SUPer will show this error mentioned above, and most of the time it doesn't, so why, I still don't get it.

cubicibo commented 9 months ago

I reimplemented BDN event merging in b898893. It will be part of v0.2.4. Please test: https://0x0.st/HDMG.3a.7z Please do note: this specific EXE is built on a virtual machine, it may under perform in comparison to normal releases.

[... ] and do use the additional parameter -b1 to optimize it to prevent scienaristBD authoring from getting buffer zone capacity over 4Mb, or video buffer over/ underflow when remuxing

Again:

Alllen commented 9 months ago

Using the version of the test software you provided to process the same xml mentioned above, the program runs to 'EPOCH 00:32:26:05->00:32:31:07' where it stops and an error message is reported:

SUPer: INFO : EPOCH 00:32:15:22->00:32:17:12, 1->1 event(s):
 SUPer: INFO :  => Screen layout: 1 window(s), processing...
Encoding: : 2it [00:00, 37.33it/s]
 SUPer: INFO :  => optimised as 2 display sets.
 SUPer: INFO : EPOCH 00:32:19:05->00:32:22:02, 1->1 event(s):
 SUPer: INFO :  => Screen layout: 1 window(s), processing...
Encoding: : 2it [00:00, 40.83it/s]
 SUPer: INFO :  => optimised as 2 display sets.
 SUPer: INFO : EPOCH 00:32:23:06->00:32:25:06, 1->1 event(s):
 SUPer: INFO :  => Screen layout: 1 window(s), processing...
Encoding: : 2it [00:00, 41.68it/s]
 SUPer: INFO :  => optimised as 2 display sets.
 SUPer: INFO : EPOCH 00:32:26:05->00:32:31:07, 2->2 event(s):
Process SUPinternal:
Traceback (most recent call last):
  File "multiprocessing\process.py", line 314, in _bootstrap
  File "multiprocessing\process.py", line 108, in run
  File "supergui.py", line 196, in from_bdnxml
  File "SUPer\interface.py", line 135, in optimise
  File "SUPer\render2.py", line 100, in group
  File "SUPer\render2.py", line 94, in find_layout
AssertionError: Incorrect window or object size.
 SUPui: INFO : Closed gracefully SUPer process.

I've uploaded the MAX debug log file to the attachment, please check it out.Thank you! sub.pes.txt

cubicibo commented 9 months ago

Please check with v0.2.3b: https://0x0.st/HD4f.3b.7z

If this still does not work, please send me the PNGs of the one epoch that crash.

Alllen commented 9 months ago

Please check with v0.2.3b: https://0x0.st/HD4f.3b.7z

If this still does not work, please send me the PNGs of the one epoch that crash.

It works. The process was successful finished with this test version. Thank you for your patience and help.

cubicibo commented 9 months ago

Thank you, merged.