[Live-devel] Need help creating a H264 stream from a video encoder source

Richard Legault Richard.Legault at nuvation.com
Tue Apr 16 06:40:05 PDT 2013


>Initially, when debugging your server, you should use "testRTSPClient"
- rather than VLC - as your RTSP client.  ("testRTSPClient" will tell
you a lot more about what's going on.)  Please post the output from
running "testRTSPClient" on your stream.

user at ubuntu:~/live555/testProgs$ ./testRTSPClient
rtsp://10.0.0.23:8554/vencVideoTest
Opening connection to 10.0.0.23, port 8554...
...remote connection opened
Sending request: DESCRIBE rtsp://10.0.0.23:8554/vencVideoTest RTSP/1.0
CSeq: 2
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2012.11.22)
Accept: application/sdp


Received 694 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 2
Date: Sat, Apr 13 2013 05:45:20 GMT
Content-Base: rtsp://10.0.0.23:8554/vencVideoTest/
Content-Type: application/sdp
Content-Length: 525

v=0
o=- 1365831836462126 1 IN IP4 10.0.0.23
s=Session streamed by "testOnDemandRTSPServer"
i=vencVideoTest
t=0 0
a=tool:LIVE555 Streaming Media v2013.03.07
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"
a=x-qt-text-inf:vencVideoTest
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=64001F;sprop-parameter-sets=J2QAH6
wXKgPARfuEAAAPoAADqYOAAAHoSAAB6Egve6yg,KN4Briw=
a=control:track1

[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Got a SDP description:
v=0
o=- 1365831836462126 1 IN IP4 10.0.0.23
s=Session streamed by "testOnDemandRTSPServer"
i=vencVideoTest
t=0 0
a=tool:LIVE555 Streaming Media v2013.03.07
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"
a=x-qt-text-inf:vencVideoTest
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=64001F;sprop-parameter-sets=J2QAH6
wXKgPARfuEAAAPoAADqYOAAAHoSAAB6Egve6yg,KN4Briw=
a=control:track1

[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Initiated the "video/H264"
subsession (client ports 56046-56047)
Sending request: SETUP rtsp://10.0.0.23:8554/vencVideoTest/track1
RTSP/1.0
CSeq: 3
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2012.11.22)
Transport: RTP/AVP;unicast;client_port=56046-56047


Received 197 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 3
Date: Sat, Apr 13 2013 05:45:20 GMT
Transport:
RTP/AVP;unicast;destination=10.0.0.51;source=10.0.0.23;client_port=56046
-56047;server_port=6970-6971
Session: 69DD5EA2


[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Set up the "video/H264"
subsession (client ports 56046-56047)
[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Created a data sink for
the "video/H264" subsession
Sending request: PLAY rtsp://10.0.0.23:8554/vencVideoTest/ RTSP/1.0
CSeq: 4
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2012.11.22)
Session: 69DD5EA2
Range: npt=0.000-


Received 189 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 4
Date: Sat, Apr 13 2013 05:45:20 GMT
Range: npt=0.000-
Session: 69DD5EA2
RTP-Info:
url=rtsp://10.0.0.23:8554/vencVideoTest/track1;seq=61844;rtptime=1754283
99


[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Started playing session...
^C 
user at ubuntu:~/live555_75/testProgs$ ./testRTSPClient
rtsp://10.0.0.23:8554/vencVideoTest
Opening connection to 10.0.0.23, port 8554...
...remote connection opened
Sending request: DESCRIBE rtsp://10.0.0.23:8554/vencVideoTest RTSP/1.0
CSeq: 2
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2012.11.22)
Accept: application/sdp


Received 694 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 2
Date: Sat, Apr 13 2013 06:01:41 GMT
Content-Base: rtsp://10.0.0.23:8554/vencVideoTest/
Content-Type: application/sdp
Content-Length: 525

v=0
o=- 1365832880485653 1 IN IP4 10.0.0.23
s=Session streamed by "testOnDemandRTSPServer"
i=vencVideoTest
t=0 0
a=tool:LIVE555 Streaming Media v2013.03.07
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"
a=x-qt-text-inf:vencVideoTest
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=64001F;sprop-parameter-sets=J2QAH6
wXKgPARfuEAAAPoAADqYOAAAHoSAAB6Egve6yg,KN4Briw=
a=control:track1

[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Got a SDP description:
v=0
o=- 1365832880485653 1 IN IP4 10.0.0.23
s=Session streamed by "testOnDemandRTSPServer"
i=vencVideoTest
t=0 0
a=tool:LIVE555 Streaming Media v2013.03.07
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"
a=x-qt-text-inf:vencVideoTest
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=64001F;sprop-parameter-sets=J2QAH6
wXKgPARfuEAAAPoAADqYOAAAHoSAAB6Egve6yg,KN4Briw=
a=control:track1

[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Initiated the "video/H264"
subsession (client ports 35094-35095)
Sending request: SETUP rtsp://10.0.0.23:8554/vencVideoTest/track1
RTSP/1.0
CSeq: 3
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2012.11.22)
Transport: RTP/AVP;unicast;client_port=35094-35095


Received 197 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 3
Date: Sat, Apr 13 2013 06:01:41 GMT
Transport:
RTP/AVP;unicast;destination=10.0.0.51;source=10.0.0.23;client_port=35094
-35095;server_port=6970-6971
Session: CE22D089


[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Set up the "video/H264"
subsession (client ports 35094-35095)
[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Created a data sink for
the "video/H264" subsession
Sending request: PLAY rtsp://10.0.0.23:8554/vencVideoTest/ RTSP/1.0
CSeq: 4
User-Agent: ./testRTSPClient (LIVE555 Streaming Media v2012.11.22)
Session: CE22D089
Range: npt=0.000-


Received 188 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 4
Date: Sat, Apr 13 2013 06:01:41 GMT
Range: npt=0.000-
Session: CE22D089
RTP-Info:
url=rtsp://10.0.0.23:8554/vencVideoTest/track1;seq=195;rtptime=212943001
5


[URL:"rtsp://10.0.0.23:8554/vencVideoTest/"]: Started playing session...




>> The H264VideoVencMediaSubsession::createNewStreamSource returns a 
>> H264VideoStreamDiscreteFramer

>Please also post the code for your implementation of the
"createNewRTPSink()" virtual function.  If possible (if you know, in
advance, the SPS/PPS NAL units, or equivalently the
'sprop-parameter-sets" string, for your stream), you should use one of
the forms of "H264VideoRTPSink::createNew()" that takes this information
as a parameter.

		RTPSink* H264VideoVencMediaSubsession
		::createNewRTPSink(Groupsock* rtpGroupsock,
				   unsigned char
rtpPayloadTypeIfDynamic,
				   FramedSource* /*inputSource*/) {

		  fprintf(stderr,"%s:%d
%s\n",__FILE__,__LINE__,__FUNCTION__);

		  return H264VideoRTPSink::createNew(envir(),
rtpGroupsock, rtpPayloadTypeIfDynamic);
		}

>> The Video encoder hands VencSource VCL frames that may contain
multiple NALs so the deliverFrame strips off the start NAL frame codes
finds the end of the NAL unit and delivers one NAL unit per frame
delivery.

> Good.  That's the right thing to be doing.  Make sure that you're
setting "fFrameSize" correctly (taking into account that you're not
delivering the 4-byte 'start code'), and, of course, don't forget to
call "FramedSource::afterGetting(this);" to complete the delivery of
each NAL unit.

Yes I set the fFrameSize correctly to the number of nal unit bytes
(subtracting 4).
Yes I call FramedSource::afterGetting(this)

Thanks for your quick response.

Richard Legault
Lead Design Engineer
Nuvation Research
Waterloo On Canada


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130416/e5e23d7b/attachment-0001.html>


More information about the live-devel mailing list