如何使用Vitamio为UDP流设置视频疗法?

发布于 2025-01-23 17:23:02 字数 2017 浏览 3 评论 0原文

我正在尝试从GoPro相机中获取UDP流。 https://github.com/konradit/goprostream/goprostream

我在使用Android Studio中使用Android Studio中的Python Code Red Vitamio。 但是由于某种原因,一旦我设定了路径,它就会崩溃,

_myVideoView.setVideoPath("udp://@10.5.5.100:8554");

但是如果删除它,则该应用程序可以启动,但是当然没有视频。 如果有人遇到同样的问题并找到了解决方案,那将对我有所帮助。

_myVideoView.setVideoPath("udp://@10.5.5.100:8554");
_myVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
_myVideoView.setBufferSize(2048);
_myVideoView.requestFocus();
_myVideoView.setMediaController(new MediaController(this));
_myVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
    @Override
    public void onPrepared(MediaPlayer mediaPlayer) {
        // optional need Vitamio 4.0
        mediaPlayer.setPlaybackSpeed(1.0f);
    }
});

_myVideoView.start();

我已经为ongreate:

if(!io.vov.vitamio.LibsChecker.checkVitamioLibs(this)){
            return;
        }
        Vitamio.initialize(this);

视频:

<io.vov.vitamio.widget.VideoView
        android:id="@+id/VideoView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="50dp"
        android:layout_marginTop="50dp"
        android:layout_marginEnd="50dp"
        android:layout_marginBottom="50dp"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/imageButtonLeft"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/WebView"
        tools:visibility="visible" />

构建graddle:

implementation project(path: ':vitamio')

ps:我试图将编译线放在graddle中,但是它找不到编译方法,但实现行似乎可以正常工作。

PS2:我只是尝试过,但即使是YouTube的HTTP链接也不起作用,我肯定犯了一个错误,但是Dunno在哪里

I'm trying to get a UDP stream from a GoPro camera.
https://github.com/KonradIT/GoProStream

I'm redoing this python code in android studio using vitamio.
But for some reason, as soon as I set the path, it crashes

_myVideoView.setVideoPath("udp://@10.5.5.100:8554");

But if I remove it, the app can launch but of course there is no video.
If someone encountered the same issue and found a solution, that would help me.

_myVideoView.setVideoPath("udp://@10.5.5.100:8554");
_myVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
_myVideoView.setBufferSize(2048);
_myVideoView.requestFocus();
_myVideoView.setMediaController(new MediaController(this));
_myVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
    @Override
    public void onPrepared(MediaPlayer mediaPlayer) {
        // optional need Vitamio 4.0
        mediaPlayer.setPlaybackSpeed(1.0f);
    }
});

_myVideoView.start();

I have done that for onCreate :

if(!io.vov.vitamio.LibsChecker.checkVitamioLibs(this)){
            return;
        }
        Vitamio.initialize(this);

the videoview :

<io.vov.vitamio.widget.VideoView
        android:id="@+id/VideoView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="50dp"
        android:layout_marginTop="50dp"
        android:layout_marginEnd="50dp"
        android:layout_marginBottom="50dp"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/imageButtonLeft"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/WebView"
        tools:visibility="visible" />

and the build graddle :

implementation project(path: ':vitamio')

ps : I've tried to put the compile line in graddle, but it can't find the method compile and the implement line seem to work just fine.

ps2 : I just tried but even http link from YouTube doesn't work, I've definitely made a mistake but dunno where

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疧_╮線 2025-01-30 17:23:02

找到了解决方案...

我只是在导入该项目,但我没有事先构建该项目
因此,它无法正常工作。

但是稍后我出于其他原因放弃了,我建议LIB VLC而不是Vitamio来显示UDP流的视频。

Found the solution...

I was just importing the project but I didn't build it beforehand
So there was no way it could work.

But I gave up later for other reasons and I would recommend lib vlc instead of vitamio for displaying video from udp streams.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文