Low framerate while playing streaming content

用户在使用Windows系统播放高比特率流媒体内容时遇到帧率过低的问题,通过测试发现该问题与CPU使用率及流媒体服务器无关。文中提供了完整的源代码,包括如何从路径或URL加载电影文件,并实现电影播放过程中的帧率测量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

来自mail list

 

 

Low framerate while playing streaming content


  • SubjectLow framerate while playing streaming content
  • From: "Marcin Sokalski" <email@hidden>
  • Date: Thu, 19 Jun 2008 18:00:01 +0200
  • Delivered-to: email@hidden
  • Delivered-to: email@hidden

Hi,

I need to play streaming content (on Windows).
For tests i use Darwin Streaming Server 555.

Unfortunately I've encountered serious problem:
if the stream is >300kbit/s my player displays only every second
frame,
but playing same file directly from file works just fine.

Problem is not related to CPU usage (currently 1%),
and is not related to streaming server.

Quicktime Player plays the stream perfectly.
VLC player also!

I'm lost, anyone can help?

Marcin Sokalski
ATSI SA

email@hidden


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Below full source code. (no MovieControl, offscreen GWorld,
simple blitting to screen on MovieDrawingCompleteProc callback)


// qttest.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "qttest.h"

#include "QTML.h"
#include "Movies.h"
#include "ImageCompression.h"
#include "MacErrors.h"

#pragma comment(lib,"QTMLClient.lib")


void UpdateMovieGWorld(Movie m)
{
CGrafPtr port;
GDHandle dev;
GetMovieGWorld(m,&port,&dev);

Rect box;
GetMovieNaturalBoundsRect(m,&box);

MacOffsetRect (&box, -box.left, -box.top);
SetMovieBox (m, &box);

int width=box.right;
int height=box.bottom;

GWorldPtr movieGWorld;
void* pixels=malloc(width*height*4);

NewGWorldFromPtr(&movieGWorld,k32BGRAPixelFormat,&box,0,0,0,(Ptr)pixels,width*4);

SetMovieGWorld (m, (CGrafPtr)movieGWorld, nil);

if (port && !dev)
{
pixels=port->portPixMap[0]->baseAddr;
DisposeGWorld(port);
free(pixels);
}
}

void MyMoviePrePrerollCompleteProc(Movie theMovie, OSErr prerollErr,
void *refcon)
{
Fixed rate=GetMoviePreferredRate(theMovie);
PrerollMovie(theMovie,0,rate);
SetMovieRate(theMovie,rate);
StartMovie(theMovie);
}

OSErr MyMovieDrawingCompleteProc(Movie theMovie, long refCon)
{
// measure fps here
static int bias=0;
bias++;
if (bias==10)
bias=0;

if (!bias)
{
static DWORD t0=GetTickCount();

DWORD t1=GetTickCount();

DWORD t=t1-t0;
t0=t1;

if (!t)
t=-1;

int fps=10000/t;

wchar_t dbg[64];

swprintf_s(dbg,L"fps:%d/n",fps);
OutputDebugString(dbg);
}

CGrafPtr port;
GDHandle dev;
GetMovieGWorld(theMovie,&port,&dev);

char* pixels=port->portPixMap[0]->baseAddr;
int pixels_width=port->portPixMap[0]->bounds.right;
int pixels_height=port->portPixMap[0]->bounds.bottom;

BITMAPINFOHEADER bih;

bih.biSize = sizeof(BITMAPINFOHEADER);
bih.biWidth = pixels_width;
bih.biHeight = -1 * pixels_height; // top down dib
bih.biPlanes = 1;
bih.biBitCount = 32;
bih.biCompression = BI_RGB;
bih.biSizeImage = 0;
bih.biXPelsPerMeter = 0;
bih.biYPelsPerMeter = 0;
bih.biClrUsed = 0;
bih.biClrImportant = 0;

HDC dc=GetDC(0);
SetDIBitsToDevice(dc,0,0,pixels_width,pixels_height,0,0,0,pixels_height,pixels,(BITMAPINFO*)&bih,DIB_RGB_COLORS);
ReleaseDC(0,dc);

return noErr;
}


bool LoadMovieFromPath(Movie* m, const char* thePath)
{
char fullpath[255];
strcpy(fullpath,thePath);
c2pstr(fullpath);

short theFile = 0;
FSSpec sfFile;

FSMakeFSSpec (0, 0L, (ConstStr255Param)fullpath, &sfFile);

int err=OpenMovieFile (&sfFile, &theFile, fsRdPerm);
if (err!=noErr)
return false;

err=NewMovieFromFile (m, theFile, nil, nil, newMovieActive,
nil);

CloseMovieFile (theFile);

if (err!=noErr)
return false;

UpdateMovieGWorld(*m);

MyMoviePrePrerollCompleteProc(*m,0,0);

return true;
}

bool LoadMovieFromURL(Movie* m, const char* theURL)
{
Handle myHandle = NULL;
Size mySize = 0;

// get the size of the specified URL
mySize = (Size)strlen(theURL) + 1;
if (mySize == 0)
return false;

// allocate a new handle
myHandle = NewHandleClear(mySize);
if (myHandle == NULL)
return false;

// copy the URL into the handle
BlockMove(theURL, *myHandle, mySize);

// instantiate a movie from the specified URL
OSErr err=
NewMovieFromDataRef(m, newMovieActive | newMovieAsyncOK,
NULL, myHandle, URLDataHandlerSubType);

DisposeHandle(myHandle);

if (err!=noErr)
{
return false;
}

UpdateMovieGWorld(*m);

SetMovieDrawingCompleteProc(*m, movieDrawingCallWhenChanged,
MyMovieDrawingCompleteProc, 0 /*refCon*/);

SetMoviePlayHints(*m, hintsAllowDynamicResize,
hintsAllowDynamicResize);

err=PrePrerollMovie(*m, 0, GetMoviePreferredRate(*m),
NewMoviePrePrerollCompleteProc(MyMoviePrePrerollCompleteProc),
(void *)0L);

return true;
}


int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// init qt
OSErr err;
err = InitializeQTML(kInitializeQTMLUseGDIFlag);

err = EnterMovies ();

// check ver
long version;
OSErr result;

result = Gestalt(gestaltQuickTime,&version);
if ((result == noErr) && (version >= 0x05020000))
{
/* we have version 5.0.2 or later */
}
else
return 0;

// get the movie from url or file path
Movie theMovie;

const char* url="rtsp://10.48.2.84/wallie";;
const char* path="C://Program Files//Darwin Streaming
Server//Movies//WALLE_~3.MOV";
//if (!LoadMovieFromPath(&theMovie,path))
if (!LoadMovieFromURL(&theMovie,url))
return 0;

SetMovieDrawingCompleteProc(theMovie,
movieDrawingCallWhenChanged, MyMovieDrawingCompleteProc, 0
/*refCon*/);

Rect box;
GetMovieNaturalBoundsRect(theMovie,&box);

DWORD bias=GetTickCount();

while ( !IsMovieDone(theMovie) )
{
// Handle resize and update events...
Rect r;
GetMovieNaturalBoundsRect(theMovie,&r);
if (r.right!=box.right || r.bottom!=box.bottom)
{
box.right=r.right;
box.bottom=r.bottom;
UpdateMovieGWorld(theMovie);
}

// internal QT message pump, YUCK!
MSG msg;
while (PeekMessage(&msg,0,0,0,PM_REMOVE))
{
if (msg.hwnd)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
MoviesTask (theMovie, 5000);
Sleep(1);
}

CGrafPtr port;
GDHandle dev;
GetMovieGWorld(theMovie,&port,&dev);
DisposeGWorld(port);

DisposeMovie (theMovie);

ExitMovies();
TerminateQTML();

return 0;
}


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
End of source code




CONFIDENTIALITY NOTICE
This message is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, privileged, confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please delete all copies of this message and notify the sender immediately by return mail or fax ATSI S.A.(+4812) 285 36 04.
Any email attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden

 

内容概要:该PPT详细介绍了企业架构设计的方法论,涵盖业务架构、数据架构、应用架构和技术架构四大核心模块。首先分析了企业架构现状,包括业务、数据、应用和技术四大架构的内容和关系,明确了企业架构设计的重要性。接着,阐述了新版企业架构总体框架(CSG-EAF 2.0)的形成过程,强调其融合了传统架构设计(TOGAF)和领域驱动设计(DDD)的优势,以适应数字化转型需求。业务架构部分通过梳理企业级和专业级价值流,细化业务能力、流程和对象,确保业务战略的有效落地。数据架构部分则遵循五大原则,确保数据的准确、一致和高效使用。应用架构方面,提出了分层解耦和服务化的设计原则,以提高灵活性和响应速度。最后,技术架构部分围绕技术框架、组件、平台和部署节点进行了详细设计,确保技术架构的稳定性和扩展性。 适合人群:适用于具有一定企业架构设计经验的IT架构师、项目经理和业务分析师,特别是那些希望深入了解如何将企业架构设计与数字化转型相结合的专业人士。 使用场景及目标:①帮助企业和组织梳理业务流程,优化业务能力,实现战略目标;②指导数据管理和应用开发,确保数据的一致性和应用的高效性;③为技术选型和系统部署提供科学依据,确保技术架构的稳定性和扩展性。 阅读建议:此资源内容详尽,涵盖企业架构设计的各个方面。建议读者在学习过程中,结合实际案例进行理解和实践,重点关注各架构模块之间的关联和协同,以便更好地应用于实际工作中。
资 源 简 介 独立分量分析(Independent Component Analysis,简称ICA)是近二十年来逐渐发展起来的一种盲信号分离方法。它是一种统计方法,其目的是从由传感器收集到的混合信号中分离相互独立的源信号,使得这些分离出来的源信号之间尽可能独立。它在语音识别、电信和医学信号处理等信号处理方面有着广泛的应用,目前已成为盲信号处理,人工神经网络等研究领域中的一个研究热点。本文简要的阐述了ICA的发展、应用和现状,详细地论述了ICA的原理及实现过程,系统地介绍了目前几种主要ICA算法以及它们之间的内在联系, 详 情 说 明 独立分量分析(Independent Component Analysis,简称ICA)是近二十年来逐渐发展起来的一种盲信号分离方法。它是一种统计方法,其目的是从由传感器收集到的混合信号中分离相互独立的源信号,使得这些分离出来的源信号之间尽可能独立。它在语音识别、电信和医学信号处理等信号处理方面有着广泛的应用,目前已成为盲信号处理,人工神经网络等研究领域中的一个研究热点。 本文简要的阐述了ICA的发展、应用和现状,详细地论述了ICA的原理及实现过程,系统地介绍了目前几种主要ICA算法以及它们之间的内在联系,在此基础上重点分析了一种快速ICA实现算法一FastICA。物质的非线性荧光谱信号可以看成是由多个相互独立的源信号组合成的混合信号,而这些独立的源信号可以看成是光谱的特征信号。为了更好的了解光谱信号的特征,本文利用独立分量分析的思想和方法,提出了利用FastICA算法提取光谱信号的特征的方案,并进行了详细的仿真实验。 此外,我们还进行了进一步的研究,探索了其他可能的ICA应用领域,如音乐信号处理、图像处理以及金融数据分析等。通过在这些领域中的实验和应用,我们发现ICA在提取信号特征、降噪和信号分离等方面具有广泛的潜力和应用前景。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值