[Live-devel] JPEG file over RTP
Andy Bell
andy at j2kvideo.com
Mon Jun 28 08:57:28 PDT 2010
Hi All,
I am wanting to stream a single JPEG file over RTP for test purposes, I load
the file and then create a video source to stream it to a client, in this
case VLC. I am using the following code on each frame:
void TestJPEGVideoSource::doGetNextFrame()
{
fFrameSize = this->sosSize;
if ( fFrameSize > fMaxSize )
{
printf( "Truncating frame!!\n" );
fNumTruncatedBytes = fFrameSize - fMaxSize;
fFrameSize = fMaxSize;
}
memcpy( fTo, this->buffer + this->sosIndex, fFrameSize );
if ( fPresentationTime.tv_sec == 0 && fPresentationTime.tv_usec == 0 )
{
gettimeofday( &fPresentationTime, NULL );
}
else
{
unsigned uSeconds = fPresentationTime.tv_usec + ( fTimePerFrame * 1000 );
fPresentationTime.tv_sec += uSeconds / 1000000;
fPresentationTime.tv_usec = uSeconds % 1000000;
}
fDurationInMicroseconds = fTimePerFrame * 1000;
nextTask() = envir().taskScheduler().scheduleDelayedTask( 0,
(TaskFunc*)FramedSource::afterGetting, this );
}
Where 'buffer' is the JPEG file, and sosIndex is the SOS marker index of the
file. The problem is that when I come to decode the stream in VLC the image
is far blockier than the original. Why is this? What am I doing wrong?
Thanks in advance
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100628/bd513e4a/attachment.html>
More information about the live-devel
mailing list