2015-02-23 356 views
1

我正在爲iOS的視頻流應用程序工作,並且我遇到了一個問題 - 應用程序應該能夠播放部分下載的視頻。我無法直接從服務器流式傳輸視頻,因爲沒有服務器,使用P2P網絡下載視頻。下載從文件的開始處開始,在大約20%之後,我希望能夠播放該文件。使用MobileVLCKit在iOS上播放視頻文件與破碎的AVI索引

目前我正在嘗試使用MobileVLCKit。當我嘗試在我的Mac上使用VLC播放器播放部分下載的文件(約30%)時,VLC告訴我:「損壞或缺少AVI索引」,並提供「播放」或「」比玩「,當我選擇」發揮爲「視頻開始播放,但在iOS上,當我嘗試播放相同的視頻時,我得到BAD_ACCESSMobileVLCKit調用AVI_IndexCreate。有沒有辦法強制MobileVLCKit播放帶有損壞索引的「原樣」視頻,或者有其他選擇,我可以如何做到這一點?非常感謝。

UPDATE:

控制檯輸出:

[1389:617849] creating player instance using shared library 
[1759f504] core generic error: option marq-color does not exist 
[1759f504] core generic error: option marq-opacity does not exist 
[1759f504] core generic error: option marq-position does not exist 
[1759f504] core generic error: option marq-refresh does not exist 
[1759f504] core generic error: option marq-size does not exist 
[1759f504] core generic error: option marq-timeout does not exist 
[1759f504] core generic error: option marq-x does not exist 
[1759f504] core generic error: option marq-y does not exist 
[176f8264] avi demux error: no key frame set for track 0 
[176f8264] avi demux error: no key frame set for track 1 

回溯:

(lldb) bt 
* thread #8: tid = 0x976f9, 0x20000000, stop reason = EXC_BAD_ACCESS (code=1, address=0x20000000) 
    frame #0: 0x20000000 
    * frame #1: 0x00675d72 testApp'Open [inlined] AVI_IndexCreate + 542 at avi.c:2407 
    frame #2: 0x00675b54 testApp'Open(p_this=<unavailable>) + 5228 at avi.c:631 
    frame #3: 0x0065111e testApp'vlc_module_load [inlined] module_load(obj=<unavailable>, init=<unavailable>, args=0x04d29d94, args=0x04d29d94, args=<unavailable>) + 814 at modules.c:185 
    frame #4: 0x00651100 testApp'vlc_module_load(obj=0x155f7654, capability=0x008fdd2e, name=<unavailable>, strict=false, probe=<unavailable>) + 784 at modules.c:277 
    frame #5: 0x0065129a testApp'module_need(obj=<unavailable>, cap=<unavailable>, name=<unavailable>, strict=<unavailable>) + 30 at modules.c:366 
    frame #6: 0x0062ae9a testApp'demux_New + 734 
    frame #7: 0x00634a4c testApp'InputSourceInit + 2624 
    frame #8: 0x00631e74 testApp'Init + 580 
    frame #9: 0x00633c7a testApp'Run + 18 
    frame #10: 0x35542e92 libsystem_pthread.dylib'_pthread_body + 138 
    frame #11: 0x35542e06 libsystem_pthread.dylib'_pthread_start + 118 
+0

請回溯添加到您的問題,所以我們可以看到它崩潰。預計這種方式就像你從Mac上描述它的方式一樣。 – feepk 2015-02-23 20:48:49

+0

增加了回溯和控制檯。此外,我忘了提及我正在使用通過CocoaPods提供的最新版本的MobileVLCKit。在podspec中它是市場版本2.2.1,但它使用來自這裏的資源http://download.videolan.org/pub/videolan/vlc-iOS/2.3.0/MobileVLCKit-2.2.0-rc1-binary .zip,所以我不知道哪個版本號是正確的。 – danylokostyshyn 2015-02-23 21:29:16

回答

0

默認情況下VLCKit嘗試修復損壞的AVI指數,禁止這種行爲,你需要--avi-index=2 PARAM傳遞給一個玩家。在iOS上,你可以做到這一點的初始化,像這樣:

VLCMediaPlayer *player = [[VLCMediaPlayer alloc] initWithOptions:@[@"--avi-index=2"]];