rockcarry / fanplayer

A portable video player based on ffmpeg for windows and android platform.
GNU Lesser General Public License v3.0
619 stars 163 forks source link

使用testplayer打开摄像头画面有延迟 #68

Open liquanguo opened 2 years ago

liquanguo commented 2 years ago

使用player_open("vfwcap", GetSafeHwnd(), NULL);打开摄像头画面有延迟,延迟大概在1秒到2秒左右 使用vlc和mpc-hc都是正常的

环境:win10+vs2010,PC:realme笔记本

rockcarry commented 2 years ago

设置 fanplayer.ini 的下面的参数: avts_syncmode = 2; video_bufpktn = 1; audio_bufpktn = 1;

试试

liquanguo commented 2 years ago

设置 fanplayer.ini 的下面的参数: avts_syncmode = 2; video_bufpktn = 1; audio_bufpktn = 1;

试试

刚刚试了,没有效果

rockcarry commented 2 years ago

dshow 方式试过没,我这边测试 dshow 模式是正常的。

rockcarry commented 2 years ago

试下修改 player_prepare 这个函数里面,把 player->init_params.avts_syncmode 设置为 2

liquanguo commented 2 years ago

dshow 方式试过没,我这边测试 dshow 模式是正常的。

我的摄像头名称是 720p HD Camera,我这样打开后没有图像 player_open("dshow://video=720p HD Camera", GetSafeHwnd(), NULL);

rockcarry commented 2 years ago

fanplayer dshow://video="open_uvc_cam#Camera" 或者 fanplayer dshow://video="open_uvc_cam#720p" 用这个试下

liquanguo commented 2 years ago

设置了这两个都不行 player_open("dshow://video=open_uvc_cam#Camera", GetSafeHwnd(), NULL); player_open("dshow://video=open_uvc_cam#720p", GetSafeHwnd(), NULL); 一直提示报错,如下: unable to decode APP fields: Invalid data found when processing input real-time buffer [open_uvc_cam#720p] [video input] too full or near too full (82% of size: 3041280 [rtbufsize parameter])! frame dropped!