EncodeFrame return 1 when trying to encode bmp 24
Hi. I guess i am doing something really stupid but since i am stuck and there is no API/error codes/help/manual, i will have to ask and hope someone will be able to help.
1)I complied the openh264 source to dll and i am dynamically (_cdecl) calling the open264 lib functions from my exe.
2)In m y code I create the encoder object.
3)I copied the ProcessEncodingSvcWithParam function from the console code and use it to init everything - i did not change anything from the defaults params that function sets.
That function calls FillSpecificParameters as you know to init params.
( i did not change anything from the defaults params that function sets. I also did not add any other params)
4)I took bmp 24-bit file and try to encode it.
When
sParam.iInputCsp =videoFormatI420 (as the default in the code)
EncodeFrame() returns 0 (success)
But as said, the image i want to encode is bmp 24, but when i set
sParam.iInputCsp to be videoFormatRGB then EncodeFrame return 1 (fail) for the same .bmp image.
The only thing i changed from the console code that i copied to my projects is as said the sParam.iInputCsp to be videoFormatRGB
I guess i need to change more params if i give videoFormatRGB instead of videoFormatI420 but which?
Hope someone can help.
And another question, if i send BMP then before this line (in ProcessEncodingSvcWithParam where i read the BMP): if ((lRead=fread(pPlanes[0], sizeof (uint8_t), iFrameSize, pFpSrc)) <= 0)break; there should there be: fseek(pFpSrc, 54, SEEK_SET); to skip the BMP header or the encoder needs that bmp header?
Sorry if my question sounds Stupid but i am a beginner when it comes to 264 topic.
Thanks for any help.
Currently encoder supports only videoFormatI420 input.
Thanks. Do you know when encoder support rgb input? And do you know if currently there is some workaround since my images are bmp Thank
now no plan to support rgb input. For BMP, there's enough information on Internet about conversion from BMP to RGB24 to YUVI420. And also some tools can be found.