[Live-devel] h264 streaming using rtp/rtsp
Hussain
conundrums at gmail.com
Tue Dec 21 16:03:43 PST 2004
Ross hello. I have been trying to use the H263plusVideoRTPSource.cpp
as an example to create the H264VideoRTPSource.cpp to be able to play
back the h.264 stream .
However the stream I am getting has fragmented NAL units, and I need
to store them, and append them to form a complete NAL unit type before
I pass it on to the VLC decoder, so that ffmpeg can decode it.
My question is that can this be done in the livemedia code, or is this
something that should be implemented on the VLC side.
Also in the H263plusVideoRTPSource.cpp code, does it discard the
header, and just pass on the payload to the decoder, or does it pass
the whole packet to the decoder.
I ask this because from what I understand from the H.264 specs, its
seems that the NAL header also acts as the RTP header, and so should
not be discarded.
At the moment, VLC returns this error when I try to play back the stream
[h264 @ 0x83a04d8]error, NO frame
[00000218] ffmpeg decoder warning: cannot decode one frame (3492 bytes)
[h264 @ 0x83a04d8]error, NO frame
[00000218] ffmpeg decoder warning: cannot decode one frame (446 bytes)
and thats why I am assuming the rtp headers are discarded somewhere,
as I think the NAL header is lost and thats why it cannot decode.
Also in the H263plusVideoRTPSource.cpp, I have been unable to figure
out how the user can extract the data saved below. To be quite honest
I don't fully understand the code segment below.
fCurrentPacketBeginsFrame = P;
if (fCurrentPacketBeginsFrame) {
fNumSpecialHeaders = fSpecialHeaderBytesLength = 0;
}
// Make a copy of the special header bytes, in case a reader
// can use them:
unsigned bytesAvailable
= SPECIAL_HEADER_BUFFER_SIZE - fSpecialHeaderBytesLength - 1;
if (expectedHeaderSize <= bytesAvailable) {
fSpecialHeaderBytes[fSpecialHeaderBytesLength++] = expectedHeaderSize;
for (unsigned i = 0; i < expectedHeaderSize; ++i) {
fSpecialHeaderBytes[fSpecialHeaderBytesLength++] = headerStart[i];
}
fPacketSizes[fNumSpecialHeaders++] = packetSize;
}
Thanks Hussain
More information about the live-devel
mailing list