nokiatech / heif

High Efficiency Image File Format
Other
1.75k stars 248 forks source link

how to call writer api? #44

Open jassonjackson opened 6 years ago

jassonjackson commented 6 years ago

help me

nokiatech commented 6 years ago

Hi, See updated example7 in v3.1: https://github.com/nokiatech/heif/blob/master/srcs/examples/example.cpp for example on writer library/API usage. Writer API headers are under /srcs/api/

Br,

jassonjackson commented 6 years ago

Thank you, but I made the following error when I ran the example4 on Linux。`

2018-03-15 5 11 34

`

jhippela commented 6 years ago

Examples now use HEIF conformance files as input for their use cases. Please download them from https://github.com/nokiatech/heif_conformance/tree/master/conformance_files and place them to same directory with example executable.

v3.1 examples uses following input files :

jassonjackson commented 6 years ago

[100%] Built target example make[1]: 离开目录“/home/12333/下载/heif-master/build” /usr/local/bin/cmake -E cmake_progress_start /home/jiewei/下载/heif-master/build/CMakeFiles 0 [12333@centos7-linux build]$ cd bin [12333@centos7-linux bin]$ ll 总用量 13520 -rwxrwxr-x. 1 13844024 3月 15 17:02 example [12333@centos7-linux bin]$ ./example 段错误(吐核)

rothomp3 commented 6 years ago

Any hint as to how I could use the writer API to write a new image, and not just copy an existing one as in the example? The specific problem I'm running into is setting up the DecoderSpecificInfo correctly.

nokiatech commented 6 years ago

Hi, Presuming using HEVC encoder: See HEIF::ErrorCode HEVCDecoderConfiguration::convertFromRawData(const uint8_t* aData, uint32_t aSize) in heif\srcs\api-cpp\HEVCCodedImageItem.cpp on how to convert byte array containing VPS/SPS/PPS to Array format Writer expects.

As to how to get this decoder configuration information you should get it from HEVC encoder you are using.

rothomp3 commented 6 years ago

Ah, so OK for example with x265 there's a x265_encoder_headers function that returns the information, if I understand what you're saying correctly. Thanks, I'll give that a try!

rothomp3 commented 6 years ago

That was it, thanks!

TangPhilLin commented 6 years ago

hello ,can any one tell me how to use the writer API,I am newer, thank you for any answer

TangPhilLin commented 6 years ago

Hello,how can I get the encoder configuration information. I just want to convert a PNG/JPEG to a HEIC, I can't understand the answer upside ,could you explain me more?

dukesook commented 1 year ago

Can somone provide a simple example of generating a raw image in memory and converting it to a heif?