[Live-devel] testRTSPClient and MJPEG decoding
Tim Gee
tim.gee at aldiscorp.com
Wed Jul 24 05:43:30 PDT 2013
Thanks for the response. Ok, does that mean the data in the sink will have already been processed by JPEGVideoRTPSource::processSpecialHeader()? I know the source object is correctly set to be JPEGVideoRTPSource, but I don't know if this member function gets called automatically in the RTP processing.
I wonder if there is a bug in the JPEG packet processing because I write each JPEG frame to a file, and each appears very corrupted. It's definitely a JPEG because it opens in an image viewer, and it has the right dimensions. However, each image looks like garbage.
I put the following code in testRTSPClient.
void DummySink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes,
struct timeval presentationTime, unsigned /*durationInMicroseconds*/) {
FrameCount++;
char fname[2048];
sprintf(fname, "image_%04d.jpg", FrameCount);
FILE *fout = fopen(fname,"w");
fwrite(fReceiveBuffer, frameSize, 1, fout);
fclose(fout);
// Then continue, to request the next frame of data:
continuePlaying();
}
Tim Gee<mailto:tim.gee at aldiscorp.com> | Senior R&D Engineer
Aldis<http://www.aldiscorp.com/> | 10545 Hardin Valley Rd. | Knoxville TN | 37932
o: 865-978-6535 | f: 865-249-6608
________________________________
From: live-devel-bounces at ns.live555.com <live-devel-bounces at ns.live555.com> on behalf of Ross Finlayson <finlayson at live555.com>
Sent: Tuesday, July 23, 2013 10:12 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] testRTSPClient and MJPEG decoding
I have been working with the testRTSPClient example for reading from an MJPEG camera. I understand that when afterGettingFrame() is called, fReceiveBuffer contains the raw RTP packet
You understand incorrectly. All of the RTP (and RTCP) processing is done by our code; that's why our code is there. When a RTP receiver (in this case, our "testRTSPClient" application) receives data, it will be a complete (audio or video) frame. In the case of a JPEG/RTP stream (served by a RTSP server - such as a network camera), the received data will be a complete JPEG frame.
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130724/1d4f49f7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image_0001.jpg
Type: image/jpeg
Size: 22202 bytes
Desc: image_0001.jpg
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130724/1d4f49f7/attachment-0001.jpg>
More information about the live-devel
mailing list