[x265] no SPS/PPS yet, * will be dropped
Tom Vaughan
tom.vaughan at multicorewareinc.com
Fri Aug 12 01:50:23 CEST 2016
There are multiple types of NAL units. All NAL units do not contain video
slices (which make up frames... for x265 we use only 1 slice per frame
today). Your code removed all non-picture NAL units, including the SPS
(Sequence Parameter Set) and PPS (Picture Parameter Set), which are an
essential part of the bitstream. Without the SPS and PPS, a decoder can’t
decode the slices.
See http://www.codeproject.com/Tips/896030/The-Structure-of-HEVC-Video for
a decent explanation.
Your code needs to check the NAL unit type before proceeding to check the
frame size.
Tom
*From:* x265-devel [mailto:x265-devel-bounces at videolan.org] *On Behalf
Of *Dolevo
Jay
*Sent:* Thursday, August 11, 2016 2:28 PM
*To:* Development for x265
*Subject:* Re: [x265] no SPS/PPS yet, * will be dropped
Sorry for my previous unfinished email. Let me continue here:
After encoding some frames, I get the bitstream in dumpfileEncodedData. In
order to verify that this is a valid bitstream, I wanted to play this file
with gstreamer (just for easiness). I run the following pipeline:
GST_DEBUG=h265*:4 gst-launch-1.0 filesrc location=dumpedEncodedStream.265 !
h265parse ! fakesink
I get the following messages from Gstreamer:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.026579000 31834 0x7fd3ac8289e0 WARN h265parse
gsth265parse.c:981:gst_h265_parse_handle_frame:<h265parse0> no SPS/PPS yet,
nal Type: 19 SLICE_IDR_W_RADL, Size: 344694 will be dropped
0:00:00.026784000 31834 0x7fd3ac8289e0 WARN h265parse
gsth265parse.c:981:gst_h265_parse_handle_frame:<h265parse0> no SPS/PPS yet,
nal Type: 1 Slice_TRAIL_R, Size: 61343 will be dropped
0:00:00.026922000 31834 0x7fd3ac8289e0 WARN h265parse
gsth265parse.c:981:gst_h265_parse_handle_frame:<h265parse0> no SPS/PPS yet,
nal Type: 1 Slice_TRAIL_R, Size: 77539 will be dropped
0:00:00.027144000 31834 0x7fd3ac8289e0 WARN h265parse
gsth265parse.c:981:gst_h265_parse_handle_frame:<h265parse0> no SPS/PPS yet,
nal Type: 1 Slice_TRAIL_R, Size: 80666 will be dropped
So, my frames are being dropped for some reason. Could anyone shed some
light what the problem would be?
Thanks in advance,
Regards
------------------------------
*From:* x265-devel <x265-devel-bounces at videolan.org> on behalf of Dolevo
Jay <cmst at live.com>
*Sent:* Thursday, August 11, 2016 9:23:26 PM
*To:* x265-devel at videolan.org
*Subject:* [x265] no SPS/PPS yet, * will be dropped
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) {
print*Log*("[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) {
print*Log*("[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/d2663263/attachment-0001.html>
More information about the x265-devel
mailing list