我正在尝试在命令行中使用 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) 我在 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) 我尝试检查手电筒是否已通过脚本正确安装:
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 安装):
环境:
不明白有什么问题