bilibili / ijkplayer

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

遇到一个.mp4格式网络视频无法播放,请帮忙查看下原因 #1996

Open chenycu opened 8 years ago

chenycu commented 8 years ago

log日志如下 09-19 15:33:36.136 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_native_init 09-19 15:33:36.136 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_native_setup 09-19 15:33:36.136 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: av_version_info: ff3.0--ijk0.5.0--dev0.4.5--rc11 09-19 15:33:36.136 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ffpipeline_create_from_android() 09-19 15:33:36.136 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_set_inject_opaque(0x2006e2) 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_set_inject_opaque()=void 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_android_set_mediacodec_select_callback() 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ffpipeline_set_mediacodec_select_callback 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_android_set_mediacodec_select_callback()=void 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_native_setLogLevel(3) 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: moncleanup 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.137 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setOptionLong 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/tv.danmaku.ijk.media.player.IjkMediaPlayer: Couldn't open file on client side, trying server side 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setDataSourceAndHeaders 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor V/IJKMEDIA: setDataSource: path http://120.76.228.112:8080/upload/videos/2016/09/09/1473147616256.mp4 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_set_data_source(url="http://120.76.228.112:8080/upload/videos/2016/09/09/1473147616256.mp4") 09-19 15:33:36.138 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_set_data_source(url="http://120.76.228.112:8080/upload/videos/2016/09/09/1473147616256.mp4")=0 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_setVideoSurface 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_set_android_surface(surface=0x7ff11e09d8) 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ffpipeline_set_surface() 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_set_android_surface(surface=0x7ff11e09d8)=void 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: IjkMediaPlayer_prepareAsync 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_prepare_async() 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: ===== versions ===== 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: FFmpeg : ff3.0--ijk0.5.0--dev0.4.5--rc11 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: libavutil : 55.17.103 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: libavcodec : 57.24.102 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: libavformat : 57.25.100 09-19 15:33:36.139 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: libswscale : 4.0.100 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: libswresample: 2.0.101 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: ===== options ===== 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: player-opts : mediacodec = 0 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: player-opts : opensles = 0 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: player-opts : overlay-format = 842225234 09-19 15:33:36.140 10291-10712/com.xinsundoc.doctor I/IJKMEDIA: SDL_RunThread: [10712] ff_msg_loop 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: player-opts : framedrop = 1 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: player-opts : start-on-prepared = 0 09-19 15:33:36.140 10291-10712/com.xinsundoc.doctor D/IJKMEDIA: message_loop 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: format-opts : ijkinject-opaque = 2098914 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: format-opts : ijkapplication = 547503294160 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: format-opts : http-detect-range-support = 0 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: format-opts : timeout = 10000000 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: format-opts : reconnect = 1 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: codec-opts : skip_loop_filter = 48 09-19 15:33:36.140 10291-10291/com.xinsundoc.doctor I/IJKMEDIA: =================== 09-19 15:33:36.143 10291-10712/com.xinsundoc.doctor D/IJKMEDIA: FFP_MSG_FLUSH: 09-19 15:33:36.144 10291-10291/com.xinsundoc.doctor D/IJKMEDIA: ijkmp_prepare_async()=0 09-19 15:33:36.144 10291-10716/com.xinsundoc.doctor I/IJKMEDIA: SDL_RunThread: [10716] ff_read 09-19 15:33:36.145 10291-10715/com.xinsundoc.doctor I/IJKMEDIA: SDL_RunThread: [10715] ff_vout 09-19 15:33:36.146 10291-10716/com.xinsundoc.doctor D/IJKMEDIA: Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto' 09-19 15:33:42.442 10291-10716/com.xinsundoc.doctor W/IJKMEDIA: Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible! 09-19 15:33:42.706 10291-10716/com.xinsundoc.doctor W/IJKMEDIA: HTTP error 416 Requested Range Not Satisfiable 09-19 15:33:42.917 10291-10716/com.xinsundoc.doctor W/IJKMEDIA: HTTP error 416 Requested Range Not Satisfiable 09-19 15:33:42.918 10291-10716/com.xinsundoc.doctor E/IJKMEDIA: moov atom not found 09-19 15:33:42.921 10291-10716/com.xinsundoc.doctor D/IJKMEDIA: Statistics: 1048706 bytes read, 0 seeks 09-19 15:33:42.929 10291-10716/com.xinsundoc.doctor E/IJKMEDIA: http://120.76.228.112:8080/upload/videos/2016/09/09/1473147616256.mp4: Invalid data found when processing input 09-19 15:33:42.931 10291-10712/com.xinsundoc.doctor D/IJKMEDIA: FFP_MSG_ERROR: 0 09-19 15:33:42.931 10291-10716/com.xinsundoc.doctor I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [10716] 09-19 15:33:42.946 10291-10291/com.xinsundoc.doctor E/tv.danmaku.ijk.media.player.IjkMediaPlayer: Error (-10000,0) 09-19 15:33:42.946 10291-10291/com.xinsundoc.doctor D/IjkVideoView: Error: -10000,0 09-19 15:33:43.084 10291-10325/com.xinsundoc.doctor V/RenderScript: 0x7f790f4000 Launching thread(s), CPUs 4

raymond1012 commented 8 years ago

09-19 15:33:42.918 10291-10716/com.xinsundoc.doctor E/IJKMEDIA: moov atom not found 无效文件

chenycu commented 8 years ago

@raymond1012 但是在浏览器中视频文件是可以播放的,为啥在手机上出现这种原因呢?您可以点这个链接看看http://120.76.228.112:8080/upload/videos/2016/09/09/1473147616256.mp4

raymond1012 commented 8 years ago
if (!mov->found_moov) {
    av_log(s, AV_LOG_ERROR, "moov atom not found\n");
    mov_read_close(s);
    return AVERROR_INVALIDDATA;
}

播放器实现不同,ffmpeg不支持不带moov或者moov位置错误的mp4

chenycu commented 8 years ago

@raymond1012 谢谢您,由于我对ffmpeg这块不是太熟悉,还想请问您这种moov错误有没有好的解决方法呢?

raymond1012 commented 8 years ago

你的文件根本不是MP4,从里面看,这个文件是mkv

chenycu commented 8 years ago

@raymond1012 谢谢

yaochangliang159 commented 5 years ago

@raymond1012 你从哪里看的这个视频不是MP4而是MKV?我下载下来以后看详细信息,我看它的编码格式是MPEG4啊。。