Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有的MP4文件播放不了。 #2060

Closed
biezhihua opened this issue Sep 29, 2016 · 8 comments
Closed

有的MP4文件播放不了。 #2060

biezhihua opened this issue Sep 29, 2016 · 8 comments

Comments

@biezhihua
Copy link

@bbcallen

非常不好意思,@了您。

有个疑问需要请教您。

问题

我在播放本地的mp4文件是碰到如下log:

09-29 16:01:09.478 32655-3073/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 16:01:09.488 32655-3073/? E/IJKMEDIA: stream 0, offset 0x30: partial file

我在ijkplayer的issues中搜索的到这个issues:
#1141

看到了您的回答:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559861e170] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 249 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options

我用grep搜索了所有带有analyzeduration和probesize的文件,但是不知道在哪里添加您所说的这两个选项。

非常希望得到您的帮助。

@biezhihua
Copy link
Author

我已经将 /ijkplayer/ijkmedia/ijkplayer/ijkavformat/ijklivehook.c中的

 av_dict_set_int(&tmp_opts, "probesize",         avf->probesize, 1);
 av_dict_set_int(&tmp_opts, "formatprobesize",   avf->format_probesize, 0);
 av_dict_set_int(&tmp_opts, "analyzeduration",   avf->max_analyze_duration, 1);
 av_dict_set_int(&tmp_opts, "fpsprobesize",      avf->fps_probe_size, 0);
 av_dict_set_int(&tmp_opts, "max_ts_probe",      avf->max_ts_probe, 0);

再一次执行完这个

./init-android.sh
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all
./compile-ijk.sh all

发现还有如下错误:

09-29 16:59:18.578 10544-10711/? E/IJKMEDIA: Option ijkapplication not found.
09-29 16:59:18.588 10544-10711/? E/IJKMEDIA: stream 0, offset 0x30: partial file

请问一下 option ijkapplication 是在哪里呢、

@biezhihua
Copy link
Author

#非常希望得到帮助

这里是部分开始播放时的日志:

 ===== versions =====
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: FFmpeg       : ff3.1--ijk0.6.1--20160824--001
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: libavutil    : 55.27.100
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: libavcodec   : 57.48.101
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: libavformat  : 57.40.101
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: libswscale   : 4.1.100
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: libswresample: 2.1.100
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: ===== options =====
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: player-opts : framedrop                    = 1
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: player-opts : start-on-prepared            = 1
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: format-opts : ijkapplication               = -767328560
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: codec-opts  : skip_loop_filter             = 48
09-29 17:55:31.218 17105-17207/? I/IJKMEDIA: ===================
09-29 17:55:31.218 17105-17207/? D/IJKMEDIA: ijkmp_prepare_async()=0
09-29 17:55:31.218 17105-17207/? E/EasyMovieTexture: Load: prepareAsync
09-29 17:55:31.218 17105-18437/? I/IJKMEDIA: SDL_RunThread: [18437] ff_msg_loop
09-29 17:55:31.218 17105-18437/? D/IJKMEDIA: message_loop
09-29 17:55:31.218 17105-18437/? D/IJKMEDIA: FFP_MSG_FLUSH:
09-29 17:55:31.228 17105-18439/? I/IJKMEDIA: SDL_RunThread: [18439] ff_read
09-29 17:55:31.238 17105-18438/? I/IJKMEDIA: SDL_RunThread: [18438] ff_vout
09-29 17:55:31.278 17105-18439/? E/IJKMEDIA: Option ijkapplication not found.
09-29 17:55:31.278 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.278 17105-18439/? W/IJKMEDIA: Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 4607 kb/s): unspecified pixel format
                                             Consider increasing the value for the 'analyzeduration' and 'probesize' options
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: max_frame_duration: 10.000
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:68':
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:   Metadata:
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     major_brand     : 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: isom
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     minor_version   : 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: 512
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     compatible_brands: 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: isomiso2avc1mp41
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     encoder         : 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: Lavf56.25.101
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:   Duration: 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: 00:02:26.61
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: , bitrate: 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: N/A
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     Stream #0:0
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: (und)
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: : Video: h264 (avc1 / 0x31637661), none, 1280x720, 4607 kb/s
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: , 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: 30 fps, 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: 30 tbr, 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: 15360 tbn, 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: 30720 tbc
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:  (default)
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     Metadata:
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:       handler_name    : 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: VideoHandler
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     Stream #0:1
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: (eng)
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:  (default)
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:     Metadata:
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA:       handler_name    : 
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: SoundHandler
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: SDL_Android_AudioTrack: CHANNEL_OUT_STEREO
09-29 17:55:31.278 17105-18439/? I/IJKMEDIA: SDL_Android_AudioTrack: ENCODING_PCM_16BIT
09-29 17:55:31.278 937-1686/? D/AudioFlinger: [DUAL_CLOCK_V2] add track flag TRACK_DUAL_CLOCK
09-29 17:55:31.278 937-1686/? V/audio_hw_primary: out_get_latency: Latency 80
09-29 17:55:31.278 937-1686/? I/AudioEffectStage: getStageBuffer(stage PRIMARY_MEDIA_NORMAL, uhq 0)
09-29 17:55:31.288 17105-18439/? I/IJKMEDIA: SDL_Android_AudioTrack_new_from_spec: init volume as 1.000000/(0.000000,1.000000)
09-29 17:55:31.288 17105-18439/? I/IJKMEDIA: audio_session_id = 1663
09-29 17:55:31.288 17105-18439/? I/IJKMEDIA: AudioCodec: avcodec, aac
09-29 17:55:31.288 17105-18441/? I/IJKMEDIA: SDL_RunThread: [18441] ff_aout_android
09-29 17:55:31.288 17105-18442/? I/IJKMEDIA: SDL_RunThread: [18442] ff_audio_dec
09-29 17:55:31.288 937-2105/? W/AudioPolicyIntefaceImpl: Skipped to add effects on session 1663
09-29 17:55:31.288 17105-18439/? I/IJKMEDIA: VideoCodec: avcodec, h264
09-29 17:55:31.288 17105-18439/? W/IJKMEDIA: fps: 30.000000 (normal)
09-29 17:55:31.288 17105-18439/? W/IJKMEDIA: fps: 30.000000 (normal)
09-29 17:55:31.288 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.288 17105-18437/? D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 1280, 720
09-29 17:55:31.288 17105-18437/? D/IJKMEDIA: FFP_MSG_SAR_CHANGED: 0, 1
09-29 17:55:31.288 17105-18449/? I/IJKMEDIA: SDL_RunThread: [18449] ff_video_dec
09-29 17:55:31.288 17105-18437/? D/IJKMEDIA: ijkmp_get_msg: FFP_MSG_PREPARED
09-29 17:55:31.288 17105-18437/? D/IJKMEDIA: FFP_MSG_PREPARED:
09-29 17:55:31.288 17105-18437/? D/IJKMEDIA: FFP_MSG_VIDEO_ROTATION_CHANGED: 0
09-29 17:55:31.288 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.298 937-2105/? I/APM::AudioPolicyManager: startOutput() output 2, stream 3, session 1663
09-29 17:55:31.298 937-2105/? V/audio_hw_primary: out_get_parameters: enter: keys - isActiveInput
09-29 17:55:31.298 937-2105/? V/audio_hw_primary: out_get_parameters: exit: returns - FALSE
09-29 17:55:31.298 937-2105/? D/AudioFlinger: [DUAL_CLOCK_V2] MixerThread::sendReconfigClock(), mOutput(-252815064), mOutput->flags(0xa), isWritingUHQA(false), currentSampleRate(48000)
09-29 17:55:31.298 937-2105/? I/AudioEffectStage: setNormalSampleRate mNormalSampleRate = 48000, normalSampleRate = 48000
09-29 17:55:31.298 937-2105/? D/AudioFlinger: [DUAL_CLOCK_V2] reset main stage buffer for DUAL_CLOCK 0, 512
09-29 17:55:31.298 937-2105/? I/AudioEffectStage: getStageBuffer(stage PRIMARY_MEDIA_NORMAL, uhq 0)
09-29 17:55:31.298 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: IjkMediaPlayer_start
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: ijkmp_start()
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: ijkmp_start()=0
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: IjkMediaPlayer_setVolume
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: ijkmp_android_set_volume(1.000000, 1.000000)
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: ffpipeline_set_volume
09-29 17:55:31.308 17105-17173/? D/IJKMEDIA: ijkmp_android_set_volume(1.000000, 1.000000)=void
09-29 17:55:31.308 17105-18437/? D/IJKMEDIA: ijkmp_get_msg: FFP_REQ_START
09-29 17:55:31.308 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.318 937-1483/? I/AudioMixer: create resampler src 44100, 2, dst 48000, 2
09-29 17:55:31.318 937-1483/? D/SoundAliveResampler: [SoundAliveResampler] Init+++
09-29 17:55:31.318 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.328 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.338 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.358 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.358 937-1483/? D/AudioFlinger: mixer(0xeea40000) throttle end: throttle time(10)
09-29 17:55:31.368 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.378 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file
09-29 17:55:31.388 1269-5897/? D/SSRM:n: SIOP:: AP = 540, PST = 478 (W:6), CP = 47, CUR = -670, LCD = 185
09-29 17:55:31.388 1269-5897/? D/M: limitCPUFreq:: freq = 1632000
09-29 17:55:31.388 1269-5897/? D/CustomFrequencyManagerService: acquireDVFSLockLocked : type : DVFS_MAX_LIMIT  frequency : 1632000  uid : 1000  pid : 1269  pkgName : SIOP_ARM_MAX@34
09-29 17:55:31.388 1269-5897/? D/M: limitGPUFreq:: freq = 510000000
09-29 17:55:31.388 17105-18439/? E/IJKMEDIA: stream 0, offset 0x30: partial file

非常希望得到帮助

@biezhihua
Copy link
Author

我测试了一下ijkplayer-example的app,发现demo中去播放视频都没有问题:

09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Download/张强-你是我最牵挂的人[68mtv.com]2.mp4':
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:   Metadata:
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     major_brand     : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: mp42
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     minor_version   : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 512
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     compatible_brands: 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: isomiso2avc1mp41
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     creation_time   : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 2016-09-29 13:01:20
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     encoder         : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: HandBrake 0.10.5 2016021100
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:   Duration: 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 00:04:42.47
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: , start: 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 0.000000
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: , bitrate: 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 3547 kb/s
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     Stream #0:0
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: (und)
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: : Video: h264 (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 704x480 [SAR 32:27 DAR 704:405], 3378 kb/s
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: , 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 24 fps, 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 24 tbr, 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 90k tbn, 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 180k tbc
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:  (default)
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     Metadata:
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:       creation_time   : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 2016-09-29 13:01:20
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:       handler_name    : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: VideoHandler
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     Stream #0:1
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: (und)
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 164 kb/s
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:  (default)
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:     Metadata:
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:       creation_time   : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: 2016-09-29 13:01:20
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA:       handler_name    : 
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: Stereo
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_Android_AudioTrack: CHANNEL_OUT_STEREO
09-30 10:44:32.883 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_Android_AudioTrack: ENCODING_PCM_16BIT
09-30 10:44:32.893 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_Android_AudioTrack_new_from_spec: init volume as 1.000000/(0.000000,1.000000)
09-30 10:44:32.893 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: audio_session_id = 1802
09-30 10:44:32.893 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: AudioCodec: avcodec, aac
09-30 10:44:32.893 25609-27347/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_RunThread: [27347] ff_aout_android
09-30 10:44:32.893 25609-27348/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_RunThread: [27348] ff_audio_dec
09-30 10:44:32.893 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: VideoCodec: avcodec, h264
09-30 10:44:32.893 25609-27345/tv.danmaku.ijk.media.example W/IJKMEDIA: fps: 24.000000 (normal)
09-30 10:44:32.893 25609-27345/tv.danmaku.ijk.media.example W/IJKMEDIA: fps: 24.000000 (normal)
09-30 10:44:32.893 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 704, 480
09-30 10:44:32.893 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_SAR_CHANGED: 32, 27
09-30 10:44:32.893 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_get_msg: FFP_MSG_PREPARED
09-30 10:44:32.893 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_PREPARED:
09-30 10:44:32.893 25609-27354/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_RunThread: [27354] ff_video_dec
09-30 10:44:32.893 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_VIDEO_ROTATION_CHANGED: 0
09-30 10:44:32.923 25609-27354/tv.danmaku.ijk.media.example D/IJKMEDIA: SDL_VoutFFmpeg_CreateOverlay(w=704, h=480, fmt=RV32(0x32335652, dp=0xdb7ffca0)
09-30 10:44:32.923 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 704, 480
09-30 10:44:32.923 25609-27354/tv.danmaku.ijk.media.example D/IJKMEDIA: Video: first frame decoded
09-30 10:44:32.933 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 704, 480
09-30 10:44:32.943 25609-27344/tv.danmaku.ijk.media.example D/IJKMEDIA: ANativeWindow_setBuffersGeometry: w=1440, h=2464, f=�(0x4) => w=704, h=480, f=RV32(0x32335652)
09-30 10:44:32.943 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_VIDEO_RENDERING_START:
09-30 10:44:32.943 25609-27354/tv.danmaku.ijk.media.example D/IJKMEDIA: SDL_VoutFFmpeg_CreateOverlay(w=704, h=480, fmt=RV32(0x32335652, dp=0xdb7ffca0)
09-30 10:44:32.953 25609-27354/tv.danmaku.ijk.media.example D/IJKMEDIA: SDL_VoutFFmpeg_CreateOverlay(w=704, h=480, fmt=RV32(0x32335652, dp=0xdb7ffca0)
09-30 10:44:32.953 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_VIDEO_SIZE_CHANGED: 704, 480
09-30 10:44:32.953 25609-27347/tv.danmaku.ijk.media.example D/IJKMEDIA: avcodec/Audio: first frame decoded
09-30 10:44:32.953 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: FFP_MSG_AUDIO_RENDERING_START:
09-30 10:44:32.973 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: IjkMediaPlayer_start
09-30 10:44:32.973 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_start()
09-30 10:44:32.973 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_start()=0
09-30 10:44:32.973 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_get_msg: FFP_REQ_START
09-30 10:44:32.993 25609-25609/tv.danmaku.ijk.media.example I/tv.danmaku.ijk.media.player.IjkMediaPlayer: Info: MEDIA_INFO_VIDEO_RENDERING_START
09-30 10:44:33.693 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: IjkMediaPlayer_setVideoSurface
09-30 10:44:33.693 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_set_android_surface(surface=0x0)
09-30 10:44:33.693 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ffpipeline_set_surface()
09-30 10:44:33.693 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_set_android_surface(surface=0x0)=void
09-30 10:44:33.723 25609-27344/tv.danmaku.ijk.media.example W/IJKMEDIA: func_display_overlay_l: NULL native_window
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_stop()
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_stop()=0
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: IjkMediaPlayer_release
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_set_android_surface(surface=0x0)
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ffpipeline_set_surface()
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_set_android_surface(surface=0x0)=void
09-30 10:44:33.953 25609-25609/tv.danmaku.ijk.media.example D/IJKMEDIA: ijkmp_shutdown_l()
09-30 10:44:33.953 25609-27343/tv.danmaku.ijk.media.example D/IJKMEDIA: message_loop exit
09-30 10:44:33.953 25609-27343/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [27343]
09-30 10:44:33.963 25609-27345/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [27345]
09-30 10:44:33.963 25609-27348/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [27348]
09-30 10:44:33.963 25609-27344/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [27344]
09-30 10:44:34.013 25609-27347/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [27347]
09-30 10:44:34.013 25609-27354/tv.danmaku.ijk.media.example I/IJKMEDIA: SDL_JNI_DetachThreadEnv: [27354]
09-30 10:44:34.023 25609-25609/tv.danmaku.ijk.media.example E/IJKMEDIA: SDL_Overlay(ffmpeg): overlay_free_l(0xd91ac9c0)

而在我的项目中是将ijkplayer作为解码,我讲ijkplayer-java-release.arr以及ijkplyer-armv7a-release.aar等文件单独放入到我们的Unity3D项目中,作为Android的插件使用。

在使用的时候也和ijkplayerDemo中的IjkMediaPlayer的使用一致.

ijkDemo中的使用

ijkMediaPlijkMediaPlayer = new IjkMediaPlayer();
ijkMediaPlayer.native_setLogLevel(IjkMediaPlayer.IJK_LOG_DEBUG);

if (mSettings.getUsingMediaCodec()) {

    ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", 1);
    ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-avc", 1);
    ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-hevc", 1);
    ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-mpeg2", 1);
    ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-mpeg4", 1);

    if (mSettings.getUsingMediaCodecAutoRotate()) {
        ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-auto-rotate", 1);
    } else {
        ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-auto-rotate", 0);
    }
    if (mSettings.getMediaCodecHandleResolutionChange()) {
        ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-handle-resolution-change", 1);
    } else {
        ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-handle-resolution-change", 0);
    }
} else {
    ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", 0);
}

而在我的项目中是这么使用的:

IjkMediaPlayer ijkMediaPlayer = new IjkMediaPlayer();
ijkMediaPlayer.native_setLogLevel(IjkMediaPlayer.IJK_LOG_DEBUG);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", 0);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "opensles", 0);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "overlay-format", IjkMediaPlayer.SDL_FCC_RV32);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "framedrop", 1);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "start-on-prepared", 1);
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_CODEC, "skip_loop_filter", 48);
...

理论上说这些代码是一致的,同时使用的aar文件是一致的,但是在播放同一个视频mp4文件时,ijkDemo中就可以播放,而在我的项目中就不可以播放。

@biezhihua
Copy link
Author

@bbcallen 请问一下,还需要哪些信息呢?

@biezhihua
Copy link
Author

@bbcallen 您好,请问您知道ffmpeg的analyzeduration和probesize选项在哪里设置么。
我看0.6.2版本中,没有设置这个的选项

非常希望获得回答,感激不尽

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x559861e170] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 249 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options

@biezhihua
Copy link
Author

biezhihua commented Oct 8, 2016

ffmpeg的analyzeduration和probesize选项可以在ff_ffplay.c的ffp_prepare_async_l函数中设置;

 av_dict_set(&ffp->format_opts, "probesize", "4096", 0);
    av_dict_set(&ffp->format_opts, "analyzeduration", "10000000", 0);

@biezhihua biezhihua reopened this Oct 11, 2016
@biezhihua
Copy link
Author

unsloved

@AlanJaver
Copy link

@biezhihua 遇到同样的问题,能否给些建议。snapchat app分享视频到 ijkplayer-example 打开,黑屏。log一样。试过增加probesize和analyzeduration,没有效果。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants