小编Kra*_*ebr的帖子

ffmpeg:在流 #1 中找不到编解码器的标签,容器当前不支持编解码器

我正在尝试在命令行中使用 ffmpeg 从我的 ip 摄像机流录制视频

fmpeg -rtsp_transport tcp \
>  -i rtsp://192.168.0.250/stream1 \
>  -c copy \
>  -map 0 \
>  -f segment \
>  -segment_time 60 \
>  -segment_format mp4 \
>  "/home/video/stream-%010d.mp4"
Run Code Online (Sandbox Code Playgroud)

并得到下一个输出:

ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame …
Run Code Online (Sandbox Code Playgroud)

video ubuntu ffmpeg rtsp

6
推荐指数
1
解决办法
2万
查看次数

kubernetes 中服务之间的 websocket 连接

我在 Kubernetes (k3s) 中有两个服务,一个是后端,另一个是前端,我需要通过 websocket 将数据从后端传输到前端。当我在 docker-compose 中调试时它可以工作。因此,当在后端 docker-compose 中运行时,我有(python):

import websockets
...
start_server = websockets.serve(server, "0.0.0.0", 8001)
...
Run Code Online (Sandbox Code Playgroud)

在前面我有(html):

...
var ws = new WebSocket('ws://localhost:8001');
...
Run Code Online (Sandbox Code Playgroud)

我有关闭功能:

        ws.onclose = function (e) {
            document.getElementById("textArea").innerHTML = 'Socket is closed. Reconnect will be attempted in 5 seconds...' + e.reason;
            setTimeout(function () {
                connect();
            }, 5000);
        };
Run Code Online (Sandbox Code Playgroud)

它的工作原理应该是这样的。

当我使用 k3s 时我得到Socket is closed. Reconnect will be attempted in 5 seconds...

这是我的后端(应用程序)部署:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: app-deployment
  namespace: my-namespace
  labels:
    app: …
Run Code Online (Sandbox Code Playgroud)

websocket kubernetes

6
推荐指数
0
解决办法
1387
查看次数

AttributeError:模块“torch”没有属性“__version__”

我尝试检查手电筒是否已通过脚本正确安装:

    import torch
    print(torch.__version__) 
Run Code Online (Sandbox Code Playgroud)

并得到结果: AttributeError: module 'torch' has no attribute ' version '

我通过以下方式检查了 torch 是否安装在我的 venv 中:

    pip freeze
Run Code Online (Sandbox Code Playgroud)

并且它已安装(我尝试按照https://pytorch.org/ 的建议通过 conda 安装和通过 pip 安装):

  • 火炬==1.7.1+cu110
  • 火炬音频==0.7.2
  • 火炬视觉==0.8.2+cu110

环境:

  • 操作系统:Ubuntu 18.04
  • GPU Geforce RTX 3070
  • 驱动程序版本460.39
  • Cuda工具包V11.0.194
  • 卡顿V8.0.5.39
  • Python V3.6.9

不明白有什么问题

python pytorch

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

ffmpeg ×1

kubernetes ×1

python ×1

pytorch ×1

rtsp ×1

ubuntu ×1

video ×1

websocket ×1