bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.53k stars 8.13k forks source link

播放记录仪的RTSP码流,必须要关掉蜂窝网络,否则会连接断开,不出画面,是不是还有那个地方需要适配的? #5294

Open Chenbo0624 opened 3 years ago

Chenbo0624 commented 3 years ago

同样的集成方法,安卓手机播放是正常的,但是苹果手机在连接同一款记录仪播放RTSP码流的时候,打印Log发现是FFMPEG的TCP连接断开,手机上的表现就是不出画面。当把手机的蜂窝网络关闭的时候就正常出画面了。这个是试由什么引起的呢?难道说跟手机的蜂窝网络的通道想冲了?还是说需要哪里配置什么信息,使用VLC去播放的话不关闭蜂窝网络也是正常的。Log信息如下: ijkmediaplayer version : 1.0.2-3-ga9bc487===== custom modules begin ===== register demuxer : ijklivehook ===== custom modules end ===== av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_set_inject_opaque(0x106a0d040) ijkmp_set_inject_opaque()=void ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4409278912 format-opts : probesize = 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0 format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 remove 'timeout' option for rtmp. SET rtsp_transport udp ijkmp_start() ijkmp_start()=-3 jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start No default whitelist set jxwlog ff_socket start jxwlog ff_socket end 25 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 socket--连接失败:0socket--连接失败:1 触发ijkplayer自定义10S超时机制 ijkmp_pause() ijkmp_pause()=-3 ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_set_inject_opaque(0x106b0cb70) ijkmp_set_inject_opaque()=void ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 ijkmp_shutdown_l() aout_pause_audio(1) aout_pause_audio(1) wait for read_tid ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4407230752 format-opts : probesize = 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0

format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 remove 'timeout' option for rtmp. SET rtsp_transport udp ijkmp_start() ijkmp_start()=-3 jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start No default whitelist set jxwlog ff_socket start jxwlog ff_socket end 31 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 jxwlog ff_listen_connect end -1414092869 jxwlog ffurl_open_whitelist fail end -1414092869 jxwlog ff_rtsp_connect end -1414092869 jxwlog iformat->read_header && (ret = s->iformat->read_header rtsp://192.168.1.254/xxx.mov: Immediate exit requested wait for video_refresh_tid ijkmp_shutdown_l()=void ijkmp_set_inject_opaque(0x0) ijkmp_set_inject_opaque()=void ijkmp_set_ijkio_inject_opaque(0x0) ijkmp_set_ijkio_inject_opaque()=void ijkmp_dec_ref(): ref=0 ijkmp_shutdown_l() ijkmp_shutdown_l()=void aout_close_audio() socket--连接失败:2 触发ijkplayer自定义10S超时机制 ijkmp_pause() ijkmp_pause()=-3 socket--连接失败:3ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_set_inject_opaque(0x106c0bf50) ijkmp_set_inject_opaque()=void ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_stop() ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 aout_pause_audio(1) ijkmp_stop()=0 ijkmp_shutdown_l() aout_pause_audio(1) aout_pause_audio(1) wait for read_tid ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4408264256 format-opts : probesize = 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0 format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 remove 'timeout' option for rtmp. SET rtsp_transport udp ijkmp_start() ijkmp_start()=-3 jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start No default whitelist set jxwlog ff_socket start jxwlog ff_socket end 25 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 jxwlog ff_listen_connect end -1414092869 jxwlog ffurl_open_whitelist fail end -1414092869 jxwlog ff_rtsp_connect end -1414092869 jxwlog iformat->read_header && (ret = s->iformat->read_header rtsp://192.168.1.254/xxx.mov: Immediate exit requested wait for video_refresh_tid ijkmp_shutdown_l()=void ijkmp_set_inject_opaque(0x0) ijkmp_set_inject_opaque()=void ijkmp_set_ijkio_inject_opaque(0x0) ijkmp_set_ijkio_inject_opaque()=void ijkmp_dec_ref(): ref=0 ijkmp_shutdown_l() ijkmp_shutdown_l()=void aout_close_audio() socket--连接失败:4 触发ijkplayer自定义10S超时机制 ijkmp_pause() ijkmp_pause()=-3 ijkmp_stop() aout_pause_aud

io(1) ijkmp_stop()=0 av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_set_inject_opaque(0x106d13220) ijkmp_set_inject_opaque()=void ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 ijkmp_shutdown_l() aout_pause_audio(1) aout_pause_audio(1) wait for read_tid ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4409346384 format-opts : probesize = 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0 format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 remove 'timeout' option for rtmp. SET rtsp_transport udp ijkmp_start() ijkmp_start()=-3 jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start No default whitelist set jxwlog ff_socket start jxwlog ff_socket end 31 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 jxwlog ff_listen_connect end -1414092869 jxwlog ffurl_open_whitelist fail end -1414092869 jxwlog ff_rtsp_connect end -1414092869 jxwlog iformat->read_header && (ret = s->iformat->read_header rtsp://192.168.1.254/xxx.mov: Immediate exit requested wait for video_refresh_tid ijkmp_shutdown_l()=void ijkmp_set_inject_opaque(0x0) ijkmp_set_inject_opaque()=void ijkmp_set_ijkio_inject_opaque(0x0) ijkmp_set_ijkio_inject_opaque()=void ijkmp_dec_ref(): ref=0 ijkmp_shutdown_l() ijkmp_shutdown_l()=void aout_close_audio() socket--连接失败:5socket--连接失败:6 触发ijkplayer自定义10S超时机制 ijkmp_pause() ijkmp_pause()=-3 ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_set_inject_opaque(0x106d07e30) ijkmp_set_inject_opaque()=void ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4409278912 format-opts : probesize

= 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0 format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 ijkmp_start() ijkmp_start()=-3 remove 'timeout' option for rtmp. SET rtsp_transport udp jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start ijkmp_stop() No default whitelist set aout_pause_audio(1) ijkmp_stop()=0 ijkmp_shutdown_l() aout_pause_audio(1) aout_pause_audio(1) wait for read_tid jxwlog ff_socket start jxwlog ff_socket end 30 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 jxwlog ff_listen_connect end -1414092869 jxwlog ffurl_open_whitelist fail end -1414092869 jxwlog ff_rtsp_connect end -1414092869 jxwlog iformat->read_header && (ret = s->iformat->read_header rtsp://192.168.1.254/xxx.mov: Immediate exit requested wait for video_refresh_tid ijkmp_shutdown_l()=void ijkmp_set_inject_opaque(0x0) ijkmp_set_inject_opaque()=void ijkmp_set_ijkio_inject_opaque(0x0) ijkmp_set_ijkio_inject_opaque()=void ijkmp_dec_ref(): ref=0 ijkmp_shutdown_l() ijkmp_shutdown_l()=void aout_close_audio() socket--连接失败:7socket--连接失败:8 触发ijkplayer自定义10S超时机制 ijkmp_pause() ijkmp_pause()=-3 ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_set_inject_opaque(0x106c0c790) ijkmp_set_inject_opaque()=void ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 ijkmp_shutdown_l() aout_pause_audio(1) aout_pause_audio(1) wait for read_tid ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4408250176 format-opts : probesize = 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0 format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 remove 'timeout' option for rtmp. SET rtsp_transport udp ijkmp_start() ijkmp_start()=-3 jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start No default whitelist set jxwlog ff_socket start jxwlog ff_socket end 31 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 jxwlog ff_listen_connect end -1414092869 jxwlog ffurl_open_whitelist fail end -1414092869 jxwlog ff_rtsp_connect end -1414092869 jxwlog iformat->read_header && (ret = s->iformat->read_header rtsp://192.168.1.254/xxx.mov: Immediate exit requested wait for video_refresh_tid ijkmp_shutdown_l()=void ijkmp_set_inject_opaque(0x0) ijkmp_set_inject_opaque()=void 2021-06-22 19:30:27.878 LuckyCam[19902:2034288] { Cmd = 3016; Status = 0; "__name" = Function; }

ijkmp_set_ijkio_inject_opaque(0x0) ijkmp_set_ijkio_inject_opaque()=void ijkmp_dec_ref(): ref=0 ijkmp_shutdown_l() ijkmp_shutdown_l()=void aout_close_audio() socket--连接失败:9socket--连接失败:10 触发ijkplayer自定义10S超时机制 ijkmp_pause() ijkmp_pause()=-3 socket--尝试连接10次失败ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 av_version_info: ff3.4--ijk0.8.7--20180103--001 ijk_version_info: 1.0.2-3-ga9bc487 ijkmp_stop() aout_pause_audio(1) ijkmp_stop()=0 ijkmp_shutdown_l() aout_pause_audio(1) aout_pause_audio(1) ijkmp_set_inject_opaque(0x106c0b6d0) ijkmp_set_inject_opaque()=void ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov") ijkmp_set_data_source(url="rtsp://192.168.1.254/xxx.mov")=0 ijkmp_prepare_async() remove 'timeout' option for rtmp. ===== versions ===== ijkplayer : 1.0.2-3-ga9bc487 FFmpeg : ff3.4--ijk0.8.7--20180103--001 libavutil : 55.78.100 libavcodec : 57.107.100 libavformat : 57.83.100 libswscale : 4.8.100 libswresample: 2.9.100 ===== options ===== player-opts : framedrop = 5 player-opts : video-pictq-size = 3 player-opts : max-fps = 30 player-opts : overlay-format = fcc-i420 player-opts : start-on-prepared = 1 player-opts : r = 29 player-opts : packet-buffering = 0 player-opts : fflags = nobuffer player-opts : infbuf = 1 player-opts : videotoolbox = 0 player-opts : videotoolbox-max-frame-width = 960 player-opts : max_cached_duration = 0 format-opts : ijkapplication = 4408236816 format-opts : probesize = 10240 format-opts : rtsp_transport = udp format-opts : dns_cache_clear = 1 format-opts : auto_convert = 0 format-opts : safe = 0 format-opts : analyzeduration = 50000 format-opts : reconnect = 1 format-opts : user_agent = ijkplayer codec-opts : skip_frame = 0 codec-opts : skip_loop_filter = 0

ijkmp_prepare_async()=0 remove 'timeout' option for rtmp. SET rtsp_transport udp ijkmp_start() ijkmp_start()=-3 jxwlog ff_rtsp_connect start jxwlog ffurl_open_whitelist start No default whitelist set jxwlog ff_socket start jxwlog ff_socket end 25 jxwlog ff_listen_connect start jxwlog ff_listen_connect connect -36 jxwlog ff_listen_connect end -1414092869 jxwlog ffurl_open_whitelist fail end -1414092869 jxwlog ff_rtsp_connect end -1414092869 jxwlog iformat->read_header && (ret = s->iformat->read_header rtsp://192.168.1.254/xxx.mov: Immediate exit requested wait for video_refresh_tid ijkmp_shutdown_l()=void ijkmp_set_inject_opaque(0x0) ijkmp_set_inject_opaque()=void ijkmp_set_ijkio_inject_opaque(0x0) ijkmp_set_ijkio_inject_opaque()=void ijkmp_dec_ref(): ref=0 ijkmp_shutdown_l() ijkmp_shutdown_l()=void aout_close_audio()

xf51577 commented 2 months ago

@Chenbo0624 How did you resolve this issue? Use VLC or update ffmpeg to specified version?