<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>
<blockquote type="cite">
<div>
<blockquote type="cite">
<blockquote type="cite">I'm using the live555 library in order to save an RTSP stream from a PTZ camera. I used the openRTSP program in the "testProgs" directory in order to test whether it would work with the camera I was using. From the output, the program
was able to connect to and talk to the camera and request frames from it. However, upon examining the output files from the program, the data was corrupt.<br>
</blockquote>
</blockquote>
<blockquote type="cite"><br>
</blockquote>
<blockquote type="cite">Are you sure? You haven't said what RTP payload format the stream was using. Please post the RTSP protocol exchange (the debugging output from "openRTSP").<br>
</blockquote>
<br>
H:\live\testProgs>openRTSP -d 10 -V -Q <a href="rtsp://10.248.123.150/live2.sdp">
rtsp://10.248.123.150/live2.sdp</a><br>
Opened URL "<a href="rtsp://10.248.123.150/live2.sdp">rtsp://10.248.123.150/live2.sdp</a>", returning a SDP description:<br>
v=0<br>
o=RTSP 1327875302 714 IN IP4 0.0.0.0<br>
s=RTSP server<br>
c=IN IP4 0.0.0.0<br>
t=0 0<br>
a=charset:Shift_JIS<br>
a=range:npt=0-<br>
a=control:*<br>
a=etag:1234567890<br>
m=video 0 RTP/AVP 96<br>
b=AS:0<br>
a=rtpmap:96 MP4V-ES/30000<br>
a=control:trackID=2<br>
a=fmtp:96 profile-level-id=3;config=000001B003000001B2464D5F5047204D6F6465000001<br>
B509000001000000012000C48881F4514043C1463F;decode_buf=76800<br>
m=audio 0 RTP/AVP 97<br>
a=control:trackID=3<br>
a=rtpmap:97 mpeg4-generic/44100/2<br>
a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1210;SizeLengt<br>
h=13; IndexLength=3; IndexDeltaLength=3; CTSDeltaLength=0; DTSDeltaLength=0;<br>
</div>
</blockquote>
<div><br>
</div>
OK, this shows that your received video file contained "MPEG-4 Elementary Stream" data, and that your received audio file contained "MPEG-4 (AAC) Elementary Stream" data. It's unlikely that this data really was 'corrupt'. It's more likely that whatever media
player you used to try to play these files failed to do so, because it did not know how to play this type of file.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div>
<blockquote type="cite">
<blockquote type="cite">My next test was to try outputting a quicktime file. When I tried this, the program started printing Klingon to the screen and producing an annoying beeping.<br>
</blockquote>
</blockquote>
<blockquote type="cite"><br>
</blockquote>
<blockquote type="cite">That's because the "-q" (and the "-i" and "-4" options) output to 'stdout'. If you want to write the output to a file, then you will need to redirect 'stdout' to it.<br>
</blockquote>
<br>
Is there a simple switch to do that or do I have to compile the test program in order to allow that?</div>
</blockquote>
<div><br>
</div>
Oh dear. Read</div>
<div><span class="Apple-tab-span" style="white-space:pre"><a href="http://en.wikipedia.org/wiki/Redirection_(computing)">http://en.wikipedia.org/wiki/Redirection_%28computing%29</a></span></div>
<div>This should be common knowledge for anyone who wants to use software like this. Run</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>openRTSP -q -w frame-width -h frame-height -f frame-rate
<a href="rtsp://url">rtsp://url</a> > outputfile.mov</div>
</div>
</blockquote>
<div><br>
</div>
Alright, redirecting stdout, which I now know how to do, solved my problem. I am able to successfully output a file which plays with both video and audio.<br>
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br>
</div>
<div>Note:</div>
<div>- As noted in the "openRTSP" documentation</div>
<div><span class="Apple-tab-span" style="white-space:pre"><a href="http://www.live555.com/openRTSP/#quicktime">http://www.live555.com/openRTSP/#quicktime</a></span></div>
<div> the "-w <width>", "-h <height>" and "-f <frame-rate>" options are important, and should not be omitted.</div>
<div>- Note also the "important note" at the end of that section of the documentation.</div>
<br>
</div>
</blockquote>
Is it possible to not specify a frame-rate? The reason I ask is that the camera dynamically changes its frame-rate based on network traffic. If I guess wrong, then the video track is not the same length as the audio track. Would the "-y" switch fix this
or should I figure out a way to set a constant frame-rate on the camera (which maybe interesting since it's made by Cisco)? Again, thank you for all your help! I've learned a lot from this project.</div>
<div><br>
</div>
</body>
</html>