<div dir="ltr"><div>Hello,</div><div><br></div><div>Trying to create simple utility that encodes multiple images to x265 annexB stream.</div><div>OS Ubuntu</div><div>libav version: 3.4.2</div><div><br></div><div>Command line works:</div><div>ffmpeg -loglevel 48 -f image2 -s 640x640 -pattern_type sequence -start_number 180 -i /media/marina/sdxdata/sw/records/pattern/%08d.pgm -c:v libx265 -preset veryslow -x265-params lossless=1 -vf "format=gray8" -f hevc out1.bin</div><div><br></div><div><br></div><div>Source code - I followed guiding and examples of ffmpeg</div><div>avcodec_receive_packet always returns EAGAIN,</div><div>When I send null frame, it returns packet - with encoded latest frame.</div><div><br></div><div>Attached file is implementation of frame encode and codec init</div><div>There is main loop that  calls "AppendFrame" multiple times</div><div><br></div><div>Thanks,</div><div>Marina<br></div></div>