nrkno / sofie-atem-connection

Sofie ATEM Connection: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
129 stars 36 forks source link

uploadStill images are corrupted #124

Closed andyrue closed 2 years ago

andyrue commented 2 years ago
andyrue commented 2 years ago

It definitely is a format issue. I've been trying more things, and I exported an uncompressed .rgba file from GIMP and it kinda sorta works, but it's the image mirrored and repeated about 12 times. I noticed in the convertRGBAToYUV422 function it has a comment that says // BT.709 or BT.601. Is that saying something about the required format? Is there a way to convert a PNG into something like that?

bevand10 commented 2 years ago

Rec709/601 are colour space encodings. 709 is current for HD, and 601 is old-skool SD.

The only significant artefact of use of 601 in a modern HD switcher would be 'bad colour'.

https://blog.maxofs2d.net/post/148346073513/bt601-vs-bt709

Julusian commented 2 years ago

We are generating the rgba frames via the following ffmpeg commands:

Windows
ffmpeg.exe -i .\inFileName.tga -pix_fmt rgba -f rawvideo ./outFileName.rgba

Linux
ffmpeg -i inFileName.tga -pix_fmt rgba -f rawvideo ./outFileName.rgba

I don't think we have looked at how best to convert from a PNG or other formats, we should add some examples somewhere once this is figured out.

Make sure that the file you are uploading is the same resolution as the atem is running, I don't remember if there are guards in place to check it is correct

andyrue commented 2 years ago

That worked! Thank you! My rabbit hole had led me to try converting with ffmpeg last night, but I couldn't get it to convert from PNG to rgba. It seemed like they were incompatible formats, but I guess the important piece I was missing was -f rawvideo and I was able to convert the PNG as well. I don't need the source file to be a PNG, it's just what I'd already been using to upload through the ATEM Software Control. I expected their API to accept the same thing as the frontend, but I guess that is doing some converting as well. Thanks again for your help! That was a real roadblock in my plans.