NYPL / ami-tools

MIT License
16 stars 6 forks source link

validate_ami_bags.py throws formatting error for motion picture json files (film) #59

Open genfhk opened 3 years ago

genfhk commented 3 years ago

check_techmd_fields doesnt recognize film json; needs to allow for lack of audio codec (for motion picture film) or video codec (for audiofilm)

...

check self.media_format_type = self.dict["source"]["object"]["type"][0:5]

genfhk commented 3 years ago

if type is film, look for filmElement > audio

bturkus commented 2 years ago

could someone (@genfhk @nkrabben) confirm for me: this looks like a generic "WARNING - JSON metadata out of spec: JSON files contain formatting errors" message with no other detail?

genfhk commented 2 years ago

Yeah - although I'd want to check your json file to be sure the error you're getting is for the same reasons mentioned in this issue. @nkrabben can you make time to resolve this issue sooner than later? It does make it difficult to know if there are actual other issues with json files...

bturkus commented 2 years ago

@nkrabben would also very much appreciate if this could be prioritized, as I'm currently finalizing the Filemaker side of this and want to get it locked in. Any type of more targeted messaging would be a major help; in this case, I couldn't track down the specific error in ami_md or wherever else

genfhk commented 2 years ago

@genfhk @bturkus send Nick JSON files to test fixes

bturkus commented 2 years ago

every bag here would be good for testing with metadata flag:

Volumes/pami/InHouse/2022_004_pami_262_holmanfilm

bturkus commented 2 years ago

and thank you both!

nkrabben commented 2 years ago

I'm deep in troubleshooting this and think I got it, but running into some pymediainfo issues.

Can either of you check how pymediainfo works on Apple chips?

python3 -c "from pymediainfo import MediaInfo; print(MediaInfo._get_library())"

I'm getting a block of errors about a missing dylib

bturkus commented 2 years ago

i'm getting this:

(<CDLL 'libmediainfo.0.dylib', handle 204dc8c80 at 0x102991cd0>, 105553159471200, '22.03', (22, 3))

Mac Mini, M1, 2020, 12.3.1

nkrabben commented 2 years ago

Thanks!

That confirms that the problem is with my development environment, and not just a general pymediainfo issue. (still might be good to rethink pymediainfo and just shell out to mediainfo itself instead.

More to come.

bturkus commented 2 years ago

would love to transition away from pymediainfo generally, and thanks for investigating this!

kieranjol commented 2 years ago

Sorry for butting in, but I was always afraid of that extra pymediainfo layer and always subprocessed directly to mediainfo itself.