连接套接字被拒绝(Android:VideoView)

时间:2019-04-12 05:05:41

标签: android networking video android-videoview

我不确定这是硬件还是软件问题。我已经编写了一个应用程序(片段),该应用程序应该在屏幕上显示视频。

这适用于许多视频(请参见源代码中的注释)。我无法在海康威视监控摄像头(DS-2CD2063GO-I)上拍摄照片。它不显示视频(在实际硬件上),然后通过对话框报告访问错误。

VideoView中的哪些设置错误?

海康威视中的设置:

Stream Type: Main Stream
Resolution: 1280 * 720P
Bit rate: Variable
Video quality: +++++
Frame rate: 20
Max. Bit rate 8192
Video encoding: H.265 (H.264 does not work either)
H.265 +: OFF
Profile: main profile
I-frame interval: 50
SVC: OFF

通过相同的地址访问通过VLC起作用。

源代码:

package com.wiboni.autohome;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.VideoView;

public class MessageFragment extends Fragment {
    //private static final String MOVIE_URL = "https://archive.org/download/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4";
    //private static final String MOVIE_URL = "rtsp://:@wowzaec2demo.streamlock.net:554/vod/mp4:BigBuckBunny_115k.mov";

    //doesn't work:
    private static final String MOVIE_URL = "rtsp://admin:12345678@192.168.178.42:554"; 
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_message,container,false);
    }

    @Override
    public void onStart() {
        VideoView mVideoView=(VideoView)getView().findViewById(R.id.mVideoView);
        mVideoView.setVideoURI(Uri.parse(MOVIE_URL));
        mVideoView.requestFocus();
        mVideoView.start();
        super.onStart();
    }

}

日志:

04-11 21:50:39.989 11637-11637/? E/adbd: recv: OPEN 00000578 00000000 0015:73 68 65 6C 6C 3A 6C 6F 67 63 61 74 20 2D 76 20 6C 6F 6E 67 00 
04-11 21:50:42.941 11637-11637/? E/adbd: recv: OPEN 00000579 00000000 0014:73 68 65 6C 6C 3A 70 6D 20 6C 69 73 74 20 75 73 65 72 73 00 
04-11 21:50:43.619 12749-12749/? E/appproc: Enhanced Zygote ASLR: ro.knox.enhance.zygote.aslr != 1. Enhanced Zygote ASLR is DISABLED!
04-11 21:50:43.850 12749-12749/? E/SemAffinityControl: SemAffinityControl: registerfunction enter
04-11 21:50:43.894 11637-11637/? E/adbd: recv: OPEN 0000057a 00000000 001a:73 68 65 6C 6C 3A 61 6D 20 67 65 74 2D 63 75 72 72 65 6E 74 2D 75 73 65 72 00 
04-11 21:50:43.983 11637-11637/? E/adbd: recv: OPEN 0000057b 00000000 002a:73 68 65 6C 6C 3A 64 75 6D 70 73 79 73 20 70 61 63 6B 61 67 65 20 63 6F 6D 2E 77 69 62 6F 6E 69 2E 61 75 74 6F 68 6F 6D 65 00 
04-11 21:50:44.081 11637-11637/? E/adbd: recv: OPEN 0000057c 00000000 002a:73 68 65 6C 6C 3A 64 75 6D 70 73 79 73 20 70 61 63 6B 61 67 65 20 63 6F 6D 2E 77 69 62 6F 6E 69 2E 61 75 74 6F 68 6F 6D 65 00 
04-11 21:50:44.172 11637-11637/? E/adbd: recv: OPEN 0000057d 00000000 0006:73 79 6E 63 3A 00 
04-11 21:50:44.209 11637-11637/? E/adbd: recv: OPEN 0000057f 00000000 0022:6C 6F 63 61 6C 61 62 73 74 72 61 63 74 3A 63 6F 6D 2E 77 69 62 6F 6E 69 2E 61 75 74 6F 68 6F 6D 65 00 
    failed to connect to socket 'localabstract:com.wiboni.autohome': Connection refused
04-11 21:50:44.223 11637-11637/? E/adbd: recv: OPEN 00000581 00000000 0014:73 68 65 6C 6C 3A 70 6D 20 6C 69 73 74 20 75 73 65 72 73 00 
04-11 21:50:44.912 12772-12772/? E/appproc: Enhanced Zygote ASLR: ro.knox.enhance.zygote.aslr != 1. Enhanced Zygote ASLR is DISABLED!
04-11 21:50:45.138 12772-12772/? E/SemAffinityControl: SemAffinityControl: registerfunction enter
04-11 21:50:47.231 11637-11637/? E/adbd: recv: OPEN 00000582 00000000 0028:73 68 65 6C 6C 3A 61 6D 20 66 6F 72 63 65 2D 73 74 6F 70 20 63 6F 6D 2E 77 69 62 6F 6E 69 2E 61 75 74 6F 68 6F 6D 65 00 
04-11 21:50:47.234 11637-11637/? E/adbd: recv: OPEN 00000583 00000000 001a:73 68 65 6C 6C 3A 77 6D 20 64 69 73 6D 69 73 73 2D 6B 65 79 67 75 61 72 64 00 
04-11 21:50:47.339 11637-11637/? E/adbd: recv: OPEN 00000584 00000000 0006:73 79 6E 63 3A 00 
04-11 21:50:47.373 11637-11637/? E/adbd: recv: OPEN 00000585 00000000 008b:73 68 65 6C 6C 3A 61 6D 20 73 74 61 72 74 20 2D 6E 20 22 63 6F 6D 2E 77 69 62 6F 6E 69 2E 61 75 74 6F 68 6F 6D 65 2F 63 6F 6D 2E 77 69 62 6F 6E 69 2E 61 75 74 6F 68 6F 6D 65 2E 4D 61 69 6E 41 63 74 69 76 69 74 79 22 20 2D 61 20 61 6E 64 72 6F 69 64 2E 69 6E 74 65 6E 74 2E 61 63 74 69 6F 6E 2E 4D 41 49 4E 20 2D 63 20 61 6E 64 72 6F 69 64 2E 69 6E 74 65 6E 74 2E 63 61 74 65 67 6F 72 79 2E 4C 41 55 4E 43 48 45 52 00 
04-11 21:50:47.474 12815-12815/? E/Zygote: isWhitelistProcess - Process is Whitelisted
04-11 21:50:47.474 12815-12815/? E/libpersona: scanKnoxPersonas
04-11 21:50:47.475 12815-12815/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
04-11 21:50:47.541 11637-11637/? E/adbd: recv: OPEN 00000586 00000000 000b:6A 64 77 70 3A 31 32 38 31 35 00 
04-11 21:50:47.882 2916-3101/? E/MdnieScenarioControlService: Exception : java.io.FileNotFoundException: /sys/class/mdnie/mdnie/scenario (No such file or directory) , in : null , value : null , length : 0
04-11 21:50:47.958 12804-12804/? E/appproc: Enhanced Zygote ASLR: ro.knox.enhance.zygote.aslr != 1. Enhanced Zygote ASLR is DISABLED!
04-11 21:50:48.103 2916-3063/? E/WindowManager: win=Window{a621fd9 u0 com.android.settings/com.android.settings.Settings EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=false win.mRemoveOnExit=false win.mViewVisibility=8, caller=com.android.server.wm.AppWindowToken.destroySurfaces:748 com.android.server.wm.AppWindowToken.destroySurfaces:732 com.android.server.wm.WindowState.onExitAnimationDone:5646 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:517 com.android.server.wm.AppWindowToken.stepAppWindowsAnimation:1745 
04-11 21:50:48.212 12804-12804/? E/SemAffinityControl: SemAffinityControl: registerfunction enter
04-11 21:50:48.985 12815-12827/com.wiboni.autohome E/MediaPlayerNative: error (1, -2147483648)
04-11 21:50:49.049 12815-12815/com.wiboni.autohome E/MediaPlayer: Error (1,-2147483648)
04-11 21:50:49.207 2916-3063/? E/WindowManager: win=Window{c2c0b4d u0 Splash Screen com.wiboni.autohome EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0, caller=com.android.server.wm.AppWindowToken.destroySurfaces:748 com.android.server.wm.AppWindowToken.destroySurfaces:732 com.android.server.wm.WindowState.onExitAnimationDone:5646 com.android.server.wm.WindowStateAnimator.stepAnimationLocked:553 com.android.server.wm.DisplayContent.lambda$-com_android_server_wm_DisplayContent_21578:476 
04-11 21:50:49.289 12815-12815/com.wiboni.autohome E/MediaPlayerNative: isPlaying: called in state MEDIA_PLAYER_STATE_ERROR
04-11 21:50:49.608 2916-3101/? E/MdnieScenarioControlService: Exception : java.io.FileNotFoundException: /sys/class/mdnie/mdnie/scenario (No such file or directory) , in : null , value : null , length : 0

0 个答案:

没有答案