如何在 RTSP 中的 FFMPEG 中流式传输视频捕获?

如何在 RTSP 中的 FFMPEG 中流式传输视频捕获?

Linux:

ffmpeg -re -i /dev/video0 -f rtsp -muxdelay 0.1 rtsp://127.0.0.1:1234/live.sdp
/usr/share/libdrm/amdgpu.ids: No such file or directory
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-cuda --enable-cuda-sdk --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libnpp --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 2487.058359, bitrate: 165888 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 165888 kb/s, 5 fps, 5 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[tcp @ 0x556468045840] Connection to tcp://127.0.0.1:1234?timeout=0 failed: Connection refused
Could not write header for output file #0 (**incorrect codec parameters ?**): Connection refused
Error initializing output stream 0:0 -- 
Conversion failed!

我真正的问题是从 NVR 的 HDMI 输出流式传输到小米电视棒。

因为使用 XMEYE 的 DVR 的 RTSP 输出在 Android TV 上效果不佳。它们变得很慢而且很差。

有人还有其他解决方案吗?

问题:

NVR → HDMI → USB CAPTURE → LINUX (FFMPEG) → RTSP → ---(wifi)--- → 小米电视棒

相关内容