jnorton001 / pycaption-cli

A command line interface for the pycaption module.
19 stars 21 forks source link

Musical Eighth Notes in SCC Captions Causing Error #6

Open MightyMait opened 9 months ago

MightyMait commented 9 months ago

While attempting to convert SCC captions to SAMI using pycaption-cli, I'm getting the following error:

C:\Users\XXXXXX\AppData\Local\Programs\Python\Python311\Scripts\pycaption.exe : Traceback (most recent call last): At H:_Projects\Automated_Closed_Captioning\convert_SCC_Captions_to_SAMI_0.9.ps1:22 char:20

Unicode u266a is an eighth note symbol. From an Adobe forum post, I was able to determine that the character is represented as 9137 in SCC captions files. Sample from the caption file: 00:16:52:24 9420 9420 94ae 94ae 9452 9452 9137 2057 e9f4 6820 61ec ec20 efe6 20ef 75f2 94f2 94f2 f175 e573 f4e9 ef6e e96e 6720 f468 61f4 a773 20ef e620 9137

00:16:53:25 942f 942f

00:16:55:08 9420 9420 94ae 94ae 9470 9470 9137 2057 6861 f4a7 7320 6875 f2f4 e96e 6720 61ec ec20 6875 6d61 6e6b e96e 6420 9137

00:16:56:03 942f 942f

00:16:57:09 9420 9420 94ae 94ae 94d0 94d0 91b9 91b9 9137 2052 e561 ec20 70e5 ef70 ece5 2c20 73e5 e56b e96e 6720 68ef f780 9470 9470 91b9 91b9 61ec ec20 ef75 f220 68e5 61f2 f473 20e3 616e 20f2 e561 ece9 676e 2080 9137

00:16:58:22 942f 942f

00:17:01:08 9420 9420 94ae 94ae 9452 9452 91b9 91b9 91b9 9137 2057 e9f4 6820 6d75 73e9 e320 6461 6ee3 e580 94f2 94f2 91b9 91b9 91b9 616e 6420 67ef ef64 20f2 6879 6de5 7320 9137

I could replace the characters before processing with PyCaption-CLI, but it would be nice to be able to specify a character to which to map the symbol. Thanks!

jnorton001 commented 9 months ago

Thanks for reaching out, @MightyMait. Those music notes translate just fine on my linux shell using the pycaption sample scc file, so I suspect it may be an issue with your Windows shell setup; see if https://stackoverflow.com/a/28041598 perhaps resolves the issue for you?

MightyMait commented 8 months ago

Thanks for the reply, @jnorton001 ! Glad to know it works under Linux. I'll try it there and I'll also have a closer look at the article you reference.