【问题标题】:Play video file with broken AVI index on iOS using MobileVLCKit使用 MobileVLCKit 在 iOS 上播放 AVI 索引损坏的视频文件
【发布时间】:2015-02-23 14:32:39
【问题描述】:

我正在开发一款适用于 iOS 的视频流媒体应用,但遇到了一个问题 - 该应用应该能够播放部分下载的视频。我无法直接从服务器流式传输视频,因为没有服务器,视频是使用 P2P 网络下载的。下载从文件开头开始,大约 20% 后我希望能够播放文件。

目前我正在尝试使用MobileVLCKit。当我尝试在我的 Mac 上使用 VLC 播放器播放部分下载的文件(大约 30%)时,VLC 告诉我:“损坏或丢失 AVI 索引”并提供“按原样播放”或“建立索引然后播放”,当我选择“按原样播放”时,视频开始播放,但在 iOS 上,当我尝试播放相同的视频时当MobileVLCKit 调用AVI_IndexCreate 时,我得到BAD_ACCESS。有没有办法强制MobileVLCKit 以损坏的索引“按原样”播放视频,或者我可以有其他一些选择吗?非常感谢。

更新:

控制台输出:

[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

【问题讨论】:

  • 请为您的问题添加回溯,以便我们查看崩溃的位置。预计这将按照您在 Mac 上描述的方式工作。
  • 添加了回溯和控制台。另外我忘了提到我正在使用可通过 CocoaPods 获得的最新版本的 MobileVLCKit。在 podspec 中它是 2.2.1 版的市场,但它使用来自这里的来源 download.videolan.org/pub/videolan/vlc-iOS/2.3.0/… ,所以我不知道哪个版本号是正确的。

标签: ios video video-streaming vlc


【解决方案1】:

默认情况下,VLCKit 会尝试修复损坏的 AVI 索引,要禁用此行为,您需要将 --avi-index=2 参数传递给播放器。在 iOS 上,您可以在 init 上执行此操作,如下所示:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-06
    • 1970-01-01
    • 1970-01-01
    • 2012-04-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多