[x265] no SPS/PPS yet, * will be dropped
Dolevo Jay
cmst at live.com
Thu Aug 11 23:23:26 CEST 2016
Hi all,
In my encoder application, I initialize the encoder as follows:
param = x265_param_alloc();
x265_param_default(param);
x265_param_default_preset(param, "ultrafast", "zerolatency");
param->fpsNum = 25;
param->fpsDenom = 1;
param->bRepeatHeaders = true;
param->internalCsp = X265_CSP_I420;
param->sourceWidth = aWidth;
param->sourceHeight = aHeight;
y_size = param->sourceWidth * param->sourceHeight;
param->logLevel = X265_LOG_FULL;
encoder = x265_encoder_open(param);
if (NULL == encoder) {
printLog("[X265] x265_encoder_open err");
return;
}
param->internalCsp = X265_CSP_I420;
pic_in = x265_picture_alloc();
x265_picture_init(param, pic_in);
pic_in->planes[0] = new char[32000000];
pic_in->planes[1] = new char[32000000];
pic_in->planes[2] = new char[32000000];
pic_in->stride[0] = aWidth;
pic_in->stride[1] = aWidth;
pic_in->stride[2] = aWidth;
pic_out = x265_picture_alloc();
x265_picture_init(param, pic_out);
Then, I apply the following function for each incoming frame:
int frame_size = 0;
x265_picture pic_out1;
frame_size = x265_encoder_encode(encoder, &pNals, &iNal, pic_in, NULL);
if (frame_size < 0) {
printLog("[ERROR] H265: x265_encoder_encode failed.");
return;
}
if (frame_size > 0) {
memcpy(aFramebuffer, pNals[0].payload, pNals[0].sizeBytes);
*aFrameBufferSize = pNals[0].sizeBytes;
}
dumpfileEncodedData.write((const char *)aFramebuffer, *aFrameBufferSize);
Just to debug the encoded bitstream, I dump the data into a file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160811/b6669a4c/attachment.html>
More information about the x265-devel
mailing list