iOSDevLog / ijkplayer

Bilibili/ijkplayer cocoapods,iOS video player based on FFmpeg n3.3, with MediaCodec, VideoToolbox support.
GNU Lesser General Public License v2.1
80 stars 34 forks source link

can not play rtsp link #12

Closed fukemy closed 6 years ago

fukemy commented 6 years ago

Hello. Today i write a project again, that just play rtsp link, but dont know why it's failled. pod file:

 use_frameworks!

  # Pods for iCameraConfig
  pod 'ijkplayerssl', '~> 1.1.3'
  pod 'UITextView+Placeholder'

error:

ijkmediaplayer version : k0.8.8-1-g91c97e61===== custom modules begin =====
register demuxer : ijklivehook
===== custom modules end =====
av_version_info: ff3.4--ijk0.8.7--20180103--001
ijk_version_info: k0.8.8-1-g91c97e61
ijkmp_set_inject_opaque(0x604000013d30)
ijkmp_set_inject_opaque()=void
ijkmp_set_ijkio_inject_opaque(0x604000013d30)
ijkmp_set_ijkio_inject_opaque()=void
2018-10-04 16:00:43.707847+0700 iCameraConfig[28254:1229843] OK setup GL
ijkmp_ios_set_view(glView=0x7fea49c013f0)
ijkmp_ios_set_view(glView=0x7fea49c013f0)=void
2018-10-04 16:00:43.727434+0700 iCameraConfig[28254:1229843] invalidateRenderBuffer
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 28254, TID: 1229925, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   IJKMediaFrameworkWithSSL            0x000000010e3e08bf -[IJKSDLGLView isApplicationActive] + 86
5   IJKMediaFrameworkWithSSL            0x000000010e3e0dd0 -[IJKSDLGLView display:] + 53
6   libdispatch.dylib                   0x0000000113db07ab _dispatch_call_block_and_release + 12
7   libdispatch.dylib                   0x0000000113db17ec _dispatch_client_callout + 8
8   libdispatch.dylib                   0x0000000113dbd61d _dispatch_root_queue_drain + 1353
9   libdispatch.dylib                   0x0000000113dbd076 _dispatch_worker_thread3 + 132
10  libsystem_pthread.dylib             0x000000011430c169 _pthread_wqthread + 1387
11  libsystem_pthread.dylib             0x000000011430bbe9 start_wqthread + 13
2018-10-04 16:00:43.728505+0700 iCameraConfig[28254:1229925] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 28254, TID: 1229925, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
Backtrace:
4   IJKMediaFrameworkWithSSL            0x000000010e3e08bf -[IJKSDLGLView isApplicationActive] + 86
5   IJKMediaFrameworkWithSSL            0x000000010e3e0dd0 -[IJKSDLGLView display:] + 53
6   libdispatch.dylib                   0x0000000113db07ab _dispatch_call_block_and_release + 12
7   libdispatch.dylib                   0x0000000113db17ec _dispatch_client_callout + 8
8   libdispatch.dylib                   0x0000000113dbd61d _dispatch_root_queue_drain + 1353
9   libdispatch.dylib                   0x0000000113dbd076 _dispatch_worker_thread3 + 132
10  libsystem_pthread.dylib             0x000000011430c169 _pthread_wqthread + 1387
11  libsystem_pthread.dylib             0x000000011430bbe9 start_wqthread + 13
2018-10-04 16:00:43.842179+0700 iCameraConfig[28254:1229925] IJKSDLGLView:display: unable to tryLock GL active: 0
ijkmp_set_data_source(url="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov")
ijkmp_set_data_source(url="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov")=0
ijkmp_prepare_async()
ijkmp_prepare_async()=0
2018-10-04 16:00:43.864687+0700 iCameraConfig[28254:1229843] invalidateRenderBuffer
2018-10-04 16:00:43.864872+0700 iCameraConfig[28254:1229925] IJKSDLGLView: setupDisplay not ready
2018-10-04 16:00:43.892890+0700 iCameraConfig[28254:1229843] FFP_MSG_ERROR: 0
IJKMPMoviePlayBackStateDidChange Optional(__C.IJKMPMoviePlaybackState): paused
playbackStateDidChange: IJKMPMovieFinishReasonPlaybackError: 1

onFailed PlayerDelegate: error!

Tested in VLC player with url "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" -> run normal

simulator screen shot - iphone 8 plus - 2018-10-04 at 16 00 29

i zipped project, can u take a look. Tks.

iCameraConfig.zip

UPDATE: i tested url "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov" in your sample project but can not run too

fukemy commented 6 years ago

Hi. After searching in Bilibili Ijkplayer i think the problem is we forgot to enable demuxer for rtsp. Can you modify it? @jiaxianhua

export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-protocol=rtp" export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-demuxer=rtsp" export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-protocol=tcp"

jiaxianhua commented 6 years ago

@fukemy I'm sorry for later.

I update it to 1.1.4 with you code support rtsp.

and test it with your project, it works.

you can try it now.

  pod 'ijkplayerssl', '~> 1.1.4'

simulator screen shot - iphone 8 plus - 2018-10-11 at 02 03 07

fukemy commented 6 years ago

yeah. thanks u very much. But i got this error:

CocoaPods could not find compatible versions for pod "ijkplayerssl":
  In Podfile:
    ijkplayerssl (~> 1.1.4)

May be i have to wait a few days before the pod already publish

jiaxianhua commented 6 years ago
$ pod repo update
Updating spec repo `master`

update the cocoapods repo. then you can find it.

2018-10-11 2 09 13

1.1.4 or 1.1.3 use the same framework, so change 1.1.4 to 1.1.3 also works. @fukemy

fukemy commented 6 years ago

it's worked. tks