ffmpeg开发rtsp live server,欢迎有经验的朋友进来.
最近被这个问题搞疯了。
自己写的一个RTSP小实现:实现RTP传输H.263实时载荷.
,在公司的电脑(double core/1GM)上表现不错,可以对多个连接提供不错的稳定的码流,一般几个小时都没问题,在家里的电脑(性能比公司的茶很多)上一般只能播放16秒钟,VLC, Real player就会断掉session,然后重新发起session:
现在VLC调试信息显示如下:
main debug: creating new input thread
main debug: waiting for thread completion
main debug: `rtsp://192.168.18.3/1.3gp ' gives access `rtsp ' demux ` ' path `192.168.18.3/1.3gp '
main debug: thread 3932 (input) created at priority 1 (input/input.c:261)
main debug: creating demux: access= 'rtsp ' demux= ' ' path= '192.168.18.3/1.3gp '
main debug: looking for access_demux module: 1 candidate
livedotcom debug: sdp=v=0
o=- 1289096773125000 1 IN IP4 0.0.0.0
s=1.3gp
c=IN IP4 0.0.0.0
a=AS:350
i=1.3gp
t=0 0
e=benztoy@163.com(Jerry(HTG)--MSN(tghu122@hotmail.com))
a=maxps:1600
a=tool:JTechStreaming
a=type:broadcast
a=Author:buffer; "eWFua2VlAA== "
a=Copyright:buffer; "d3d3LnlkeS5jb20A "
a=Title:buffer; "oba8+8+wutrDtbnlobctd3d3LnlkeS5jb20t1sbX98jLAA== "
a=control:*
a=range:npt=0-
a=x-qt-text-nam:1.3gp
a=x-qt-text-inf:1.3gp
m=video 0 RTP/AVP 96
a=rtpmap:96 H263-2000/90000
a=fmtp:96 profile=0;level=10;framesize=35
livedotcom debug: RTP subsession 'video/H263-2000 '
main debug: selecting program id=0
main debug: using access_demux module "livedotcom "
main debug: looking for a subtitle file in D:\Program Files\VideoLAN\VLC\
main debug: looking for decoder module: 27 candidates
ffmpeg debug: libavcodec already initialized
ffmpeg debug: postprocessing disabled
ffmpeg debug: using direct rendering
ffmpeg debug: ffmpeg codec (H263) started
main debug: using decoder module "ffmpeg "
main debug: thread 3924 (decoder) created at priority 0 (input/decoder.c:159)
main debug: `rtsp://192.168.18.3/1.3gp ' successfully opened
livedotcom debug: tk-> rtpSource-> hasBeenSynchronizedUsingRTCP()
main debug: no usable vout present, spawning one
main debug: window size: 192x144
main debug: Registering subpicture channel, ID: 2
main debug: Registering subpicture channel, ID: 3
main debug: Registering subpicture channel, ID: 4
main debug: Registering subpicture channel, ID: 5
main debug: looking for video output module: 5 candidates
vout_directx debug: creating DirectXEventThread
main debug: waiting for thread completion
vout_directx debug: DirectXCreateWindow
vout_directx debug: created video sub-window
main debug: thread 4072 (DirectX Events Thread) created at priority 0 (directx.c:263)
vout_directx debug: DirectXEventThread running
vout_directx debug: DirectXInitDDraw
vout_directx debug: directx-device:
vout_directx debug:
vout_directx debug: screen dimensions (0x0,1024x768)
vout_directx debug: DirectDraw Capabilities: overlay=1 yuvoverlay=1 can_deinterlace_overlay=1 colorkey=1 stretch=1 bltfourcc=1
vout_directx debug: align_boundary_src=0,0 align_boundary_dest=1,1 align_size_src=0,0 align_size_dest=0,0
vout_directx debug: End DirectXInitDDraw
vout_directx debug: DirectXCreateDisplay
vout_directx debug: DirectXCreateClipper
vout_directx debug: disabling screen saver
main debug: using video output module "vout_directx "
vout_directx debug: NewPictureVec overlay:no chroma:YV12
vout_directx debug: created plain surface of chroma:YV12
vout_directx debug: End NewPictureVec (succeeded)
main debug: got 1 direct buffer(s)
main debug: picture in 176x144 (0,0,176x144), chroma I420, ar 4:3, sar 12:11
main debug: picture user 176x144 (0,0,176x144), chroma I420, ar 4:3, sar 12:11
main debug: picture out 176x144 (0,0,176x144), chroma I420, ar 4:3, sar 12:11
main debug: direct render, mapping render pictures 0-6 to system pictures 1-7
main debug: waiting for thread completion
main debug: thread 4028 (video output) created at priority 1 (video_output/video_output.c:421)
ffmpeg warning: warning: first frame is no keyframe
(h263@00B35920)
main error: picture 066D84F8 refcount is -1
livedotcom debug: suspect EOF due to end of VoD session
main debug: EOF reached
main debug: waiting decoder fifos to empty
main warning: late picture skipped (155290)
main warning: late picture skipped (1447200)
main warning: late picture skipped (1323038)
main warning: late picture skipped (1152865)
main warning: late picture skipped (997830)
main warning: late picture skipped (873674)
main warning: late picture skipped (760912)
main debug: closing input
main debug: removing module "livedotcom "
ffmpeg debug: ffmpeg codec (H263) stopped
main debug: removing module "ffmpeg "
main debug: thread times: real 0m22.109375s, kernel 0m0.062500s, user 0m0.000000s
main debug: thread 3924 joined (input/decoder.c:191)
main debug: killing decoder fourcc `H263 ', 0 PES in FIFO
main debug: thread times: real 0m22.234375s, kernel 0m1.234375s, user 0m0.500000s
main debug: thread 3932 joined (input/input.c:399)
main: nothing to play
main debug: garbage collector destroys 1 vout
vout_directx debug: DirectXCloseSurface
vout_directx debug: DirectXCloseDisplay
vout_directx debug: DirectXCloseDisplay clipper
vout_directx debug: DirectXCloseDisplay display
vout_directx debug: DirectXCloseDDraw
vout_directx debug: CloseVideo
vout_directx debug: DirectXEventThread terminating
vout_directx debug: DirectXCloseWindow
vout_directx debug: WinProc WM_DESTROY
main debug: thread times: real 0m22.140625s, kernel 0m0.000000s, user 0m0.015625s
main debug: thread 4072 joined (directx.c:494)
main debug: removing module "vout_directx "
main debug: thread times: real 0m22.109375s, kernel 0m0.046875s, user 0m0.015625s
main debug: thread 4028 joined (video_output/video_output.c:461)
为了问题,痛苦不堪,我初步估计是pts的问题,这个时间戳,我想了很多办法
我现在是纪录采帧时候的每帧的tick数(11/1000秒),然后换算成90KHZ的时钟tick(1/90000),请问一下,我这个有什么问题吗?
Real player得信息显示:所有的frame全部dropped掉了
FramesDropped = ***
CurrentFramerate = 0
DisplayFrames = 0
郁闷死了
[解决办法]
不懂,帮顶
[解决办法]
UP
[解决办法]
qq:354032