我遇到的问题是,我的 IP 摄像头(大华)无法将 640x480 作为子流传输到我的 2N Verso 作为外置摄像头。它仅支持 1280x720 或 704x?? 和 320x288。
我尝试了一下 FFmpeg,让它以 http 流的形式工作。但 Verso 只接受 RTSP 流。
我是否有机会获得以 mjpeg 形式运行的 h264 流或 720p mjpeg(分辨率为 640x480)rtsp://ip-cam:554/stream.mjpg
?
docker-compose.yaml
除了我的评论之外,这里还有我的 rtsp2mjpeg代码:
version: '3'
services:
rtsp2mjpg:
image: eroji/rtsp2mjpg
restart: always
expose:
- "8090"
volumes:
- /etc/localtime:/etc/localtime:ro
# Uncomment below if you want to override default ffserver.conf
# - ./ffserver.conf:/etc/ffserver.conf:ro
environment:
# Override the env vars below as needed
RTSP_URL: rtsp://2n:[email protected]:554/cam/realmonitor?channel=1&subtype=0
FFSERVER_LOG_LEVEL: error
FFMPEG_LOG_LEVEL: warning
FFMPEG_INPUT_OPTS: -use_wallclock_as_timestamps 1
FFMPEG_OUTPUT_OPTS: -async 1 -vsync 1
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8090/still.jpg --max-time 1 --output /dev/null || exit 1"]
interval: 15s
timeout: 1s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
nginx:
image: nginx:alpine
restart: always
links:
- rtsp2mjpg
ports:
- "80:80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
还有ffserver.conf
:
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
<Feed feed.ffm>
File /tmp/feed.ffm
FileMaxSize 50M
</Feed>
<Stream live.mjpg>
Feed feed.ffm
Format mpjpeg
VideoFrameRate 15
VideoSize 640x480
VideoQMin 1
VideoQMax 15
VideoIntraOnly
NoAudio
Strict -1
NoDefaults
</Stream>
<Stream still.jpg>
Feed feed.ffm
Format jpeg
VideoFrameRate 2
VideoSize 1920x1080
VideoQMin 1
VideoQMax 15
VideoIntraOnly
NoAudio
Strict -1
NoDefaults
</Stream>
我可以在这里插入转码和 rtsp 输出吗?