<div dir="ltr"><div>Hello,</div><div>I have a problem to create application using libav for encoding raw video with x265.</div><div>Below is description of example that I created following encode_video.c example.</div><div>I tried also the encode_example code and I have the same problem.</div><div>I used GRAY8 and YUV_420P formats of video frames, I get same results for both formats.</div><div><br></div><div>The problem occurs only in my implementation, command line works fine.</div><div>Please help me to understand what is missing in my application<br></div><div><br></div><div>Thanks,</div><div>Marina<br></div><div><br></div><div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Marina Vasilevsky</b> <span dir="ltr"><<a href="mailto:marina@dentlytec.com">marina@dentlytec.com</a>></span><br>Date: Sun, Aug 19, 2018 at 11:35 AM<br>Subject: Encode x265 annexb stream from grayscale images<br>To: <a href="mailto:libav-user@ffmpeg.org">libav-user@ffmpeg.org</a><br><br><br><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/<wbr>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>
</div><br></div></div>