bilibili / ijkplayer

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

有画面无声音 #2729

Open yeshibuzhong opened 7 years ago

yeshibuzhong commented 7 years ago

刚开始播放一个影片的时候锁屏, 然后解锁, 这个时候有一定的概率出现有画面无声音的情况

log如下: [IJKFFMoviePlayerController.m:411行] !!!!!!!!!! actual: ff3.2--ijk0.7.2-20161107--001 expect: ff3.2--ijk0.7.4--20161116--001

!!!!!!!!!!

av_version_info: ff3.2--ijk0.7.2-20161107--001 ijk_version_info: k0.7.5 ijkmp_set_inject_opaque(0x130ae1b70) ijkmp_set_inject_opaque()=void [IJKSDLGLView.m:319行] OK setup GL

[IJKSDLGLView.m:1920行] init sphere 12288 18432 [IJKSDLGLView.m:1797行] init sphere 12288 18432 ijkmp_ios_set_view(glView=0x1300c7a00) ijkmp_ios_set_view(glView=0x1300c7a00)=void [BBIJKPlayerVC.m:945行] {{0, 0}, {667, 375}} ijkmp_set_data_source(url="http://static.video360.vrbig.com/13748.m3u8?timestamp=1487763612&sign=a1adc59f0fcd70ec9c04963373917ef7") ijkmp_set_data_source(url="http://static.video360.vrbig.com/13748.m3u8?timestamp=1487763612&sign=a1adc59f0fcd70ec9c04963373917ef7")=0 ijkmp_prepare_async() ===== versions ===== [FFPlayer @ 0x13086e7f0] ijkplayer : k0.7.5 [FFPlayer @ 0x13086e7f0] FFmpeg : ff3.2--ijk0.7.2-20161107--001 [FFPlayer @ 0x13086e7f0] libavutil : 55.34.100 [FFPlayer @ 0x13086e7f0] libavcodec : 57.64.100 [FFPlayer @ 0x13086e7f0] libavformat : 57.56.100 [FFPlayer @ 0x13086e7f0] libswscale : 4.2.100 [FFPlayer @ 0x13086e7f0] libswresample: 2.3.100 ===== options ===== [FFPlayer @ 0x13086e7f0] player-opts : start-on-prepared = 1 [FFPlayer @ 0x13086e7f0] player-opts : overlay-format = fcc-_es2 [FFPlayer @ 0x13086e7f0] player-opts : max-fps = 30 [FFPlayer @ 0x13086e7f0] player-opts : framedrop = 0 [FFPlayer @ 0x13086e7f0] player-opts : videotoolbox-max-frame-width = 3840 [FFPlayer @ 0x13086e7f0] player-opts : videotoolbox = 1 [FFPlayer @ 0x13086e7f0] player-opts : video-pictq-size = 3 [FFPlayer @ 0x13086e7f0] format-opts : ijkapplication = 5130704416 [FFPlayer @ 0x13086e7f0] format-opts : user-agent = ijkplayer [FFPlayer @ 0x13086e7f0] format-opts : auto_convert = 0 [FFPlayer @ 0x13086e7f0] format-opts : timeout = 30000000 [FFPlayer @ 0x13086e7f0] format-opts : reconnect = 1 [FFPlayer @ 0x13086e7f0] format-opts : safe = 0 [FFPlayer @ 0x13086e7f0] codec-opts : skip_loop_filter = 0 [FFPlayer @ 0x13086e7f0] codec-opts : skip_frame = 0

ijkmp_prepare_async()=0 [http @ 0x130e58930] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy' [http @ 0x12f8f4200] the user-agent option is deprecated, please use user_agent option [http @ 0x130e58930] request: GET /13748.m3u8?timestamp=1487763612&sign=a1adc59f0fcd70ec9c04963373917ef7 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=0-

Connection: close

Host: static.video360.vrbig.com

Icy-MetaData: 1

[http @ 0x12f8f4200] the user-agent option is deprecated, please use user_agent option [http @ 0x130e58930] request: GET /static.vide.........373917ef7 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=0-

Connection: close

Host: 183.131.55.16

Icy-MetaData: 1

[hls,applehttp @ 0x12f959800] Format hls,applehttp probed with size=2048 and score=100 [hls,applehttp @ 0x12f959800] HLS request for url 'http:/dc59f0fcd70ec9c04963373917ef7', offset 0, playlist 0 [http @ 0x1301e0a00] the user-agent option is deprecated, please use user_agent option [http @ 0x1308de080] request: GET /static.vif0fcd70ec9c04963373917ef7 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Connection: close

Host: 183.131.55.16

Icy-MetaData: 1

Format mpegts probed with size=2048 and score=50 [mpegts @ 0x1301e4c00] stream=0 stream_type=1b pid=100 prog_reg_desc= [mpegts @ 0x1301e4c00] stream=1 stream_type=f pid=101 prog_reg_desc= Option safe not found. [hls,applehttp @ 0x12f959800] Before avformat_find_stream_info() pos: 4182 bytes read:4182 seeks:0 nb_streams:2 [mpegts @ 0x1301e4c00] All programs have pmt, headers found [NULL @ 0x130252c00] user data:"x264 - core 144 r2525+52 a9a0b2b xiaowan [8-bit@all X86] - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:1:1 analyse=0x3:0x133 me=umh subme=10 psy=1 fade_compensate=0.00 psy_rd=0.00:0.00 mixed_ref=1 me_range=32 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 fgo=0 bframes=4 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=75 keyint_min=1 scenecut=60 intra_refresh=0 rc_lookahead=60 rc=abr mbtree=1 bitrate=2200 ratetol=1.0 qcomp=0.60 qpmin=0:0:0 qpmax=69:69:69 qpstep=4 vbv_maxrate=5000 vbv_bufsize=1800 nal_hrd=none filler=0 ip_ratio=1.40 aq=3:0.50 aq-sensitivity=10.00 aq-factor=1.00:1.00:1.00 aq2=0 aq3=0" [h264 @ 0x1300b8a00] nal_unit_type: 9, nal_ref_idc: 0 [h264 @ 0x1300b8a00] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x1300b8a00] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x1300b8a00] nal_unit_type: 8, nal_ref_idc: 3 [h264 @ 0x1300b8a00] nal_unit_type: 5, nal_ref_idc: 3 [h264 @ 0x1300b8a00] user data:"x264 - core 144 r2525+52 a9a0b2b xiaowan [8-bit@all X86] - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:1:1 analyse=0x3:0x133 me=umh subme=10 psy=1 fade_compensate=0.00 psy_rd=0.00:0.00 mixed_ref=1 me_range=32 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 fgo=0 bframes=4 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=75 keyint_min=1 scenecut=60 intra_refresh=0 rc_lookahead=60 rc=abr mbtree=1 bitrate=2200 ratetol=1.0 qcomp=0.60 qpmin=0:0:0 qpmax=69:69:69 qpstep=4 vbv_maxrate=5000 vbv_bufsize=1800 nal_hrd=none filler=0 ip_ratio=1.40 aq=3:0.50 aq-sensitivity=10.00 aq-factor=1.00:1.00:1.00 aq2=0 aq3=0" [h264 @ 0x1300b8a00] Reinit context to 2048x1024, pix_fmt: yuv420p [h264 @ 0x1300b8a00] no picture [hls,applehttp @ 0x12f959800] All info found [hls,applehttp @ 0x12f959800] Setting avg frame rate based on r frame rate [hls,applehttp @ 0x12f959800] After avformat_find_stream_info() pos: 4182 bytes read:4182 seeks:0 frames:53 [FFPlayer @ 0x13086e7f0] max_frame_duration: 10.000 Input #0, hls,applehttp, from 'http://static.video360.vrbig.com/13748.m3u8?timestamp=1487763612&sign=a1adc59f0fcd70ec9c04963373917ef7': Duration: 00:04:40.68, start: 1.480000, bitrate: 0 kb/s Program 0 Metadata: variant_bitrate : 0 Stream #0:0, 21, 1/90000: Video: h264, 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(tv, bt709/unknown/unknown, left), 2048x1024 [SAR 1:1 DAR 2:1], 0/1, 25 fps, 25 tbr, 90k tbn, 50k tbc Metadata: variant_bitrate : 0 Stream #0:1, 32, 1/90000: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp Metadata: variant_bitrate : 0 aout_open_audio() [IJKSDLAudioQueueController.m:91行] AudioQueue: AudioQueueStart failed (561015905)

aout_open_audio_n: failed to new AudioTrcak() SDL_OpenAudio (2 channels, 48000 Hz): (null) aout_open_audio() [IJKSDLAudioQueueController.m:91行] AudioQueue: AudioQueueStart failed (561015905)

aout_open_audio_n: failed to new AudioTrcak() SDL_OpenAudio (1 channels, 48000 Hz): (null) aout_open_audio() [IJKSDLAudioQueueController.m:91行] AudioQueue: AudioQueueStart failed (561015905)

aout_open_audio_n: failed to new AudioTrcak() SDL_OpenAudio (2 channels, 44100 Hz): (null) aout_open_audio() [IJKSDLAudioQueueController.m:91行] AudioQueue: AudioQueueStart failed (561015905)

aout_open_audio_n: failed to new AudioTrcak() SDL_OpenAudio (1 channels, 44100 Hz): (null) No more combinations to try, audio open failed [h264 @ 0x130126c00] nal_unit_type: 9, nal_ref_idc: 0 [h264 @ 0x130126c00] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x130126c00] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x130126c00] nal_unit_type: 8, nal_ref_idc: 3 [h264 @ 0x130126c00] Ignoring NAL type 9 in extradata [h264 @ 0x130126c00] Ignoring NAL type 6 in extradata m_max_ref_frames 4 m_max_ref_frames 4 after scale width 2048 height 1024 [FFPlayer @ 0x13086e7f0] fps: 25.000000 (normal) [FFPlayer @ 0x13086e7f0] fps: 25.000000 (normal) flushed last keyframe pts 0 ijkmp_get_msg: FFP_MSG_PREPARED m_max_ref_frames 4 after scale width 2048 height 1024 [BBIJKPlayerVC.m:596行] 0.000000 ijkmp_pause() ijkmp_get_msg: FFP_REQ_PAUSE aout_pause_audio(1) ijkmp_pause()=0 [IJKSDLGLView.m:1417行] IJKSDLGLView:applicationWillResignActive: 0 [IJKFFMoviePlayerController.m:1528行] IJKFFMoviePlayerController:applicationWillResignActive: 0 [AppDelegate.m:236行] 2017-02-22 11:40:13 +0000 [IJKSDLGLView.m:1423行] IJKSDLGLView:applicationDidEnterBackground: 2 [IJKFFMoviePlayerController.m:1538行] IJKFFMoviePlayerController:applicationDidEnterBackground: 2 SDL_VoutVideoToolBox_CreateOverlay(w=2048, h=1024, fmt=_VTB, dp=0x134184e30) Video: first frame decoded [IJKAudioKit.m:85行] AVAudioSessionInterruptionTypeBegan

[IJKFFMoviePlayerController.m:1491行] IJKFFMoviePlayerController:audioSessionInterrupt: begin

SDL_VoutVideoToolBox_CreateOverlay(w=2048, h=1024, fmt=_VTB, dp=0x134184e30) ijkmp_pause() ijkmp_get_msg: FFP_REQ_PAUSE aout_pause_audio(1) ijkmp_pause()=0 SDL_VoutVideoToolBox_CreateOverlay(w=2048, h=1024, fmt=_VTB, dp=0x134184e30) [IJKFFMoviePlayerController.m:1076行] FFP_MSG_VIDEO_DECODER_OPEN: true

[IJKFFMoviePlayerController.m:1005行] FFP_MSG_VIDEO_SIZE_CHANGED: 2048, 1024

[IJKFFMoviePlayerController.m:1013行] FFP_MSG_SAR_CHANGED: 1, 1

[IJKFFMoviePlayerController.m:898行] FFP_MSG_PREPARED:

ijkmp_get_meta_l ijkmp_get_meta_l()=void [IJKFFMoviePlayerController.m:952行] fps in meta 25.000000

ijkmp_set_playback_rate(1.000000) ijkmp_set_playback_rate()=void ijkmp_set_playback_volume(1.000000) ijkmp_set_playback_volume()=void [BBIJKPlayerVC.m:3540行] 280.680000 ijkmp_pause() ijkmp_get_msg: FFP_REQ_PAUSE aout_pause_audio(1) ijkmp_pause()=0

我发现这里有问题但是不知道怎么解决, 请大神指点

[IJKSDLAudioQueueController.m:91行] AudioQueue: AudioQueueStart failed (561015905)

aout_open_audio_n: failed to new AudioTrcak() SDL_OpenAudio (2 channels, 44100 Hz): (null) aout_open_audio()

junfundev commented 7 years ago

这个问题我之前也遇到过、ijk播放的时候有画面没有声音、查了原因是因为推流端推的时候设置声音编码的编解码器是MP3格式的,调成AAC的就可以正常拉流观看了

junfundev commented 7 years ago

希望能帮到你

yeshibuzhong commented 7 years ago

@junfunlee 我这边是因为刚开始播放的时候就锁屏, 导致音频关闭, 只需要在再次播放的时候检测有没有音频在输出就行了, 没有输出就重启音频服务.

autismbug commented 6 years ago

@yeshibuzhong 你好,是怎么检测的音频输出

LingChen19950 commented 1 year ago

怎么调呢?