我正在开发 Xamarin.Android 项目,该项目具有简单的布局和来自 IP 摄像机的流式 RTSP 视频。
但是,我签出并构建了官方示例:RTSP Mosaic https://code.videolan.org/mfkl/libvlcsharp-samples/tree/master/VideoMosaic/VideoMosaic.Android
它似乎不稳定,1 分钟后 VLC 流媒体关闭,但如果我下载 VLC 播放器并从 URL 流媒体,它是稳定的。
以下是 VS2017 流式关闭之前的调试日志:
06-26 17:31:26.895 I/MediaCodec(30979): setCodecState state : 0
06-26 17:31:28.317 E/VLC (30979): [00000074eba29690/791e] libvlc input: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1000 ms)
06-26 17:31:28.319 I/ACodec (30979): [OMX.qcom.video.decoder.avc] signalFlush
06-26 17:31:28.320 I/ACodec (30979): [OMX.qcom.video.decoder.avc] ExecutingState flushing now (codec owns 1/4 input, 10/15 output).
06-26 17:31:28.321 E/NdkMediaCodec(30979): sf error code: -38
06-26 17:31:28.329 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Flushing
06-26 17:31:28.337 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,1)
06-26 17:31:28.337 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,0)
06-26 17:31:28.337 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Executing
06-26 17:31:28.469 I/MediaCodec(30979): setCodecState state : 1
06-26 17:31:49.475 I/MediaCodec(30979): setCodecState state : 0
06-26 17:31:57.456 E/VLC (30979): [00000074e86c9210/7933] libvlc decoder: Decoder is draining
06-26 17:31:57.478 I/MediaCodec(30979): setCodecState state : 1
06-26 17:31:57.558 E/NdkMediaCodec(30979): sf error code: -38
06-26 17:31:57.558 I/ACodec (30979): [OMX.qcom.video.decoder.avc] signalFlush
06-26 17:31:57.559 I/ACodec (30979): [OMX.qcom.video.decoder.avc] ExecutingState flushing now (codec owns 0/4 input, 8/15 output).
06-26 17:31:57.560 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Flushing
06-26 17:31:57.564 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,1)
06-26 17:31:57.564 I/ACodec (30979): [OMX.qcom.video.decoder.avc] FlushingState onOMXEvent(0,1,0)
06-26 17:31:57.564 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Executing
06-26 17:31:57.572 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Executing->Idle
06-26 17:31:57.592 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Idle->Loaded
06-26 17:31:57.594 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now Loaded
06-26 17:31:57.594 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now kWhatShutdownCompleted event : 8563
06-26 17:31:57.594 D/SurfaceUtils(30979): disconnecting from surface 0x75075b0010, reason disconnectFromSurface
06-26 17:31:57.606 I/ACodec (30979): [OMX.qcom.video.decoder.avc] Now uninitialized
06-26 17:31:57.606 I/ACodec (30979): [] Now kWhatShutdownCompleted event : 8563
06-26 17:31:57.610 I/MediaCodec(30979): Codec shutdown complete