[Libav-user] Encode x265 annexb stream from video raw data version: 3.4.2 does not working

Marina Vasilevsky marina at dentlytec.com
Mon Aug 20 00:44:43 EEST 2018

I have a problem to create application using libav for encoding raw video
with x265.
Below is description of example that I created following encode_video.c
I tried also the encode_example code and I have the same problem.
I used GRAY8 and YUV_420P formats of video frames, I get same results for
both formats.

The problem occurs only in my implementation, command line works fine.
Please help me to understand what is missing in my application


---------- Forwarded message ----------
From: Marina Vasilevsky <marina at dentlytec.com>
Date: Sun, Aug 19, 2018 at 11:35 AM
Subject: Encode x265 annexb stream from grayscale images
To: libav-user at ffmpeg.org


Trying to create simple utility that encodes multiple images to x265 annexB
OS Ubuntu
libav version: 3.4.2

Command line works:
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

Source code - I followed guiding and examples of ffmpeg
avcodec_receive_packet always returns EAGAIN,
When I send null frame, it returns packet - with encoded latest frame.

Attached file is implementation of frame encode and codec init
There is main loop that  calls "AppendFrame" multiple times

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180820/8c5d4e6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rec_svc_enc.cpp
Type: text/x-c++src
Size: 5357 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180820/8c5d4e6c/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rec_svc_enc.h
Type: text/x-chdr
Size: 1082 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180820/8c5d4e6c/attachment.h>

More information about the Libav-user mailing list