bilibili / ijkplayer

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

ijkplayer 0.8.4以后的版本无法支持FTP协议 #4773

Open lm3515 opened 5 years ago

lm3515 commented 5 years ago

最近一直在弄播放器,试了很多个版本,发现ijkplayer 0.8.4以后的版本无法支持FTP协议,这应该不是ijkplayer的问题,是ffmpeg版本的问题。高版本中avformat_find_stream_info无法读取到ftp服务器中音频、视频的流信息,所以无法播放。附上ijkplayer的日志

ijkmp_set_data_source(url="ftp://192.168.0.109/sda1/fel3ss.mp3")
ijkmp_set_data_source(url="ftp://192.168.0.109/sda1/fel3ss.mp3")=0
ijkmp_prepare_async()
===== versions =====
ijkplayer    : k0.8.8
FFmpeg       : ff3.4--ijk0.8.7--20180103--001
libavutil    : 55.78.100
libavcodec   : 57.107.100
libavformat  : 57.25.100
libswscale   : 4.0.100
libswresample: 2.0.101
===== options =====
player-opts : video-pictq-size             = 3
player-opts : overlay-format               = fcc-_es2
player-opts : max-fps                      = 30
player-opts : framedrop                    = 0
player-opts : videotoolbox-max-frame-width = 960
player-opts : videotoolbox                 = 0
player-opts : start-on-prepared            = 1
format-opts : ijkapplication               = 4393979744
format-opts : ijkiomanager                 = 4394276832
format-opts : user-agent                   = ijkplayer
format-opts : auto_convert                 = 0
format-opts : timeout                      = 30000000
format-opts : reconnect                    = 1
format-opts : safe                         = 0
===================
ijkmp_prepare_async()=0
2019-06-26 15:03:52.836291+0800 MyTV[26014:4774694] invalidateRenderBuffer
2019-06-26 15:03:52.840392+0800 MyTV[26014:4774827] IJKSDLGLView: setupDisplay not ready
ftp://192.168.0.109/sda1/fel3ss.mp3: Protocol not found
2019-06-26 15:03:52.898739+0800 MyTV[26014:4774694] FFP_MSG_ERROR: 0
ijkmp_seek_to(0)
ijkmp_seek_to(0)=-3
2019-06-26 15:03:53.435642+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.437065+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.437865+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.438026+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.440602+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.441098+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.441556+0800 MyTV[26014:4774694] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.442239+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.443124+0800 MyTV[26014:4774694] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-26 15:03:53.547895+0800 MyTV[26014:4774849] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
befovy commented 5 years ago

there is ftp://192.168.0.109/sda1/fel3ss.mp3: Protocol not found in the log. you need to reconfigure ffmpeg to support ftp protocol

lm3515 commented 5 years ago

@befovy How to add ftp protocol?Thanks

befovy commented 5 years ago

export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-protocol=ftp"

add this line into config/module.sh, and recompile ffmpeg. @lm3515

lm3515 commented 5 years ago

@befovy ftp protocol has been added,But it still doesn't play

av_version_info: ff3.4--ijk0.8.7--20180103--001
ijk_version_info: k0.8.8
ijkmp_set_inject_opaque(0x280e705c0)
ijkmp_set_inject_opaque()=void
ijkmp_set_ijkio_inject_opaque(0x280e705c0)
ijkmp_set_ijkio_inject_opaque()=void
2019-06-27 10:26:18.582295+0800 MyTV[519:57253] OK setup GL
ijkmp_ios_set_view(glView=0x103144290)
ijkmp_ios_set_view(glView=0x103144290)=void
2019-06-27 10:26:18.591441+0800 MyTV[519:57253] invalidateRenderBuffer
2019-06-27 10:26:18.592820+0800 MyTV[519:57957] IJKSDLGLView: setupDisplay not ready
ijkmp_set_data_source(url="ftp://192.168.0.100/sda1/fel3ss.mp3")
ijkmp_set_data_source(url="ftp://192.168.0.100/sda1/fel3ss.mp3")=0
ijkmp_prepare_async()
===== versions =====
[FFPlayer @ 0x1040b2600] ijkplayer    : k0.8.8
[FFPlayer @ 0x1040b2600] FFmpeg       : ff3.4--ijk0.8.7--20180103--001
[FFPlayer @ 0x1040b2600] libavutil    : 55.78.100
[FFPlayer @ 0x1040b2600] libavcodec   : 57.107.100
[FFPlayer @ 0x1040b2600] libavformat  : 57.83.100
[FFPlayer @ 0x1040b2600] libswscale   : 4.8.100
[FFPlayer @ 0x1040b2600] libswresample: 2.9.100
===== options =====
[FFPlayer @ 0x1040b2600] player-opts : video-pictq-size             = 3
[FFPlayer @ 0x1040b2600] player-opts : overlay-format               = fcc-_es2
[FFPlayer @ 0x1040b2600] player-opts : max-fps                      = 30
[FFPlayer @ 0x1040b2600] player-opts : framedrop                    = 0
[FFPlayer @ 0x1040b2600] player-opts : videotoolbox-max-frame-width = 960
[FFPlayer @ 0x1040b2600] player-opts : videotoolbox                 = 0
[FFPlayer @ 0x1040b2600] player-opts : start-on-prepared            = 1
[FFPlayer @ 0x1040b2600] format-opts : ijkapplication               = 4345735376
[FFPlayer @ 0x1040b2600] format-opts : ijkiomanager                 = 4345870864
[FFPlayer @ 0x1040b2600] format-opts : user-agent                   = ijkplayer
[FFPlayer @ 0x1040b2600] format-opts : auto_convert                 = 0
[FFPlayer @ 0x1040b2600] format-opts : timeout                      = 30000000
[FFPlayer @ 0x1040b2600] format-opts : reconnect                    = 1
[FFPlayer @ 0x1040b2600] format-opts : safe                         = 0
===================
ijkmp_prepare_async()=0
2019-06-27 10:26:18.687419+0800 MyTV[519:57253] invalidateRenderBuffer
2019-06-27 10:26:18.687642+0800 MyTV[519:57957] IJKSDLGLView: setupDisplay not ready
[NULL @ 0x10416f200] Opening 'ftp://192.168.0.100/sda1/fel3ss.mp3' for reading
[ftp @ 0x10319f3d0] Setting default whitelist 'tcp'
Hit DNS cache hostname = 192.168.0.100
[ftp @ 0x10395ca00] 220 Operation successful
[ftp @ 0x10395ca00] 230 Operation successful
[ftp @ 0x10395ca00] 200 Operation successful
[ftp @ 0x10395ca00] 211-Features:
[ftp @ 0x10395ca00]  EPSV
[ftp @ 0x10395ca00]  PASV
[ftp @ 0x10395ca00]  REST STREAM
[ftp @ 0x10395ca00]  MDTM
[ftp @ 0x10395ca00]  SIZE
[ftp @ 0x10395ca00] 211 Ok
[ftp @ 0x10395ca00] 257 "/"
[ftp @ 0x10395ca00] 350 Operation successful
[ftp @ 0x10395ca00] 213 3297324
[ftp @ 0x10395ca00] 229 EPSV ok (|||37369|)
Hit DNS cache hostname = 192.168.0.100
2019-06-27 10:26:19.290198+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.290597+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.291893+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.292019+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.293938+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.294336+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.294904+0800 MyTV[519:57253] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.297129+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.297595+0800 MyTV[519:57253] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:19.396766+0800 MyTV[519:57803] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.732984+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.733346+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.734262+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.734975+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.738481+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.739074+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.739750+0800 MyTV[519:57253] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.741168+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.741609+0800 MyTV[519:57253] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
2019-06-27 10:26:46.837406+0800 MyTV[519:58139] [MediaRemote] OutputDeviceUID is nil 扬声器: (null)
[AVIOContext @ 0x1031bdcf0] Statistics: 0 bytes read, 0 seeks
ftp://192.168.0.100/sda1/fel3ss.mp3: Input/output error
2019-06-27 10:26:49.001462+0800 MyTV[519:57253] FFP_MSG_ERROR: 0
ijkmp_seek_to(0)
ijkmp_seek_to(0)=-3
befovy commented 5 years ago

yes, the player had found ftp protocol, but some error occurs when open the file.

ftp://192.168.0.100/sda1/fel3ss.mp3: Input/output error.

Maybe you should dive into the ffmpeg ftp protocol to find why if failed. Use the desktop version of ffplay play this file firstly to make true this file can play.

@lm3515

wnpllrzodiac commented 5 years ago

可以 提供个公网测试文件。 应该还是能fix的。再不行,降ffmpeg版本到你说的支持的版本