[FFmpeg-user] Problems with videostreaming via ffmpeg

Андрей Сморкалов andrey.smorkalov at gmail.com
Thu May 23 08:19:52 CEST 2013


Hello again,

When video with audio didn't work (in both cases, when we use
synchronized audio and video and when asynchronous) we see these
messages in console:

Failed to compensate for timestamp delta of 62947.737062
frame= 3008 fps=8.8 q=14.0 size=      42kB time=00:05:46.66 bitrate=   1.0kbits/
frame= 3014 fps=8.8 q=14.0 size=      42kB time=00:05:47.19 bitrate=   1.0kbits/
Failed to compensate for timestamp delta of 62950.762422
frame= 3019 fps=8.8 q=13.0 size=      42kB time=00:05:47.66 bitrate=   1.0kbits/
frame= 3022 fps=8.8 q=13.0 size=      42kB time=00:05:48.13 bitrate=   1.0kbits/
Failed to compensate for timestamp delta of 62953.839282
frame= 3027 fps=8.8 q=16.0 size=      42kB time=00:05:48.73 bitrate=   1.0kbits/
frame= 3031 fps=8.8 q=16.0 size=      42kB time=00:05:49.26 bitrate=   1.0kbits/

In case when everything is ok, we didn't see message about "timestamp
delta" and have correct bitrate (200-500 kbits/s) in console.

Filling buffer with audio code from our DirectShow audio filter:

HRESULT CVAcademiaStream::FillBuffer(IMediaSample *pms)
{
    CheckPointer(pms,E_POINTER);

	BYTE *pData;
    long lDataLen;

    pms->GetPointer(&pData);
    lDataLen = pms->GetSize();

	CRefTime rtStart = m_rtSampleTime;
	int waitTime = m_timer.elapsed();

	while (!m_isFirstFill && m_iRepeatTime*1000 - waitTime > 0)
	{
		Sleep(1);
		waitTime = m_timer.elapsed();
	}

	ZeroMemory(pData, lDataLen);

	for (int i=0; i<m_captureObjects.size(); i++ )
	{
		SharedMemoryStreamSound* captureObject = m_captureObjects[i];
		bool haveEnoughForCapture = false;
		captureObject->CopyAudioDataBufferForRead();

		haveEnoughForCapture = StreamHaveEnoughData(captureObject, lDataLen);

		if (haveEnoughForCapture)
		{
			FillBufferFromStream(captureObject, pData, lDataLen);
		}	
	}

	m_fillCnt++;
	int currTime = timeGetTime();
	int deltaTime = currTime - m_startTime;

	// Increment to find the finish time
	if (m_isFirstFill)
		m_rtSampleTime += (LONG)m_iRepeatTime;
	else
	{
		m_rtSampleTime += (__int64)m_timer.elapsed()*10;
	}

    pms->SetTime((REFERENCE_TIME *) &rtStart,(REFERENCE_TIME *)
&m_rtSampleTime);

    pms->SetSyncPoint(TRUE);
	
	m_isFirstFill = false;
	m_timer.restart();

    return NOERROR;
} // FillBuffer

We compared our audio filter with some other open-source and tried to
make some changes to get ffmpeg works stable (but unsuccessfully).

Any ideas what can be wrong?

With best regards,
Andrey.

2013/5/21 Andrey Utkin <andrey.krieger.utkin at gmail.com>:
>> Any ideas?
>
> 1. Look suspiciously at your own code.
> 2. Run correct and problematic cases with -loglevel debug, post it
> here (but note that local guys don't like pastebin usage).
>
> --
> Andrey Utkin
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list