У меня есть камера Unifi UVC, которую я хочу просмотреть на веб-сайте. Я запускал ffmpeg для этого несколько недель. Но нет, это больше не будет работать. Я могу просматривать поток прямо с камеры с помощью unifyi Video. На IP камеры. Я могу открыть поток rtsp с помощью vlc, но он прерывается через несколько секунд.
Мой ffserver.conf:
Port 8090
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 1000
# max bandwidth per-client (kb/s)
MaxBandwidth 100000
# Suppress that if you want to launch ffserver as a daemon.
NoDaemon
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 500M
</Feed>
<Stream test.mjpeg>
Feed feed1.ffm
Format mpjpeg
#VideoCodec mjpeg
VideoFrameRate 24
VideoBufferSize 80000
VideoBitRate 1016
VideoQMin 1
VideoQMax 5
VideoSize 1024x576
PreRoll 0
Noaudio
</Stream>
Мой стартовый синтаксис ffmpeg:
ffmpeg -rtsp_transport tcp -i "rtsp://user:pass@CAM-IP:554/s2" http://localhost:8090/feed1.ffm
С отладкой -loglevel:
[h264 @ 0x7fc352d96720] nal_unit_type: 5, nal_ref_idc: 3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 10 times
[h264 @ 0x7fc352d0ed20] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7fc352d0ed20] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7fc352d0ed20] nal_unit_type: 5, nal_ref_idc: 3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[h264 @ 0x7fc352e585a0] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7fc352e585a0] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7fc352e585a0] nal_unit_type: 5, nal_ref_idc: 3
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream) 0x
Last message repeated 17 times
Clipping frame in rate conversion by 0.000008
*** 23 dup!
[h264 @ 0x7fc352e5e500] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7fc352e5e500] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7fc352e5e500] nal_unit_type: 5, nal_ref_idc: 3
*** 47 dup! fps=7.5 q=24.8 size= 1532kB time=00:00:00.95 bitrate=13095.8kbits/s dup=23 drop=0 speed=0.298x
[h264 @ 0x7fc352e3aea0] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7fc352e3aea0] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7fc352e3aea0] nal_unit_type: 5, nal_ref_idc: 3
*** 48 dup! fps= 12 q=24.8 size= 4604kB time=00:00:02.95 bitrate=12749.1kbits/s dup=70 drop=0 speed=0.489x
[h264 @ 0x7fc352d96720] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x7fc352d96720] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x7fc352d96720] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x7fc352d0ed20] nal_unit_type: 7, nal_ref_idc: 3.00 bitrate=12681.2kbits/s dup=118 drop=0 speed=0.598x
[h264 @ 0x7fc352d0ed20] nal_unit_type: 8, nal_ref_idc: 3
Clipping frame in rate conversion by 0.159996
*** 23 dup!
[h264 @ 0x7fc352d0ed20] nal_unit_type: 5, nal_ref_idc: 3
*** 23 dup!
Last message repeated 1 times
*** 44 dup!
*** 24 dup! fps= 27 q=24.8 size= 15220kB time=00:00:09.87 bitrate=12626.0kbits/s dup=231 drop=0 speed=1.11x
[output stream 0:0 @ 0x7fc352e3cc20] EOF on sink link output stream 0:0:default.
*** 0 dup!
No more output streams to write to, finishing.
frame= 264 fps= 28 q=24.8 Lsize= 16888kB time=00:00:10.95 bitrate=12624.8kbits/s dup=256 drop=0 speed=1.17x
video:16820kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.405773%
Input file #0 (rtsp://user:pass@CAM-IP:554/s2):
Input stream #0:0 (audio): 113 packets read (41132 bytes);
Input stream #0:1 (video): 8 packets read (1021648 bytes); 8 frames decoded;
Total: 121 packets (1062780 bytes) demuxed
Output file #0 (http://localhost:8090/feed1.ffm):
Output stream #0:0 (video): 264 frames encoded; 264 packets muxed (17223424 bytes);
Total: 264 packets (17223424 bytes) muxed
8 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fc352d32960] Statistics: 0 seeks, 4222 writeouts
Нормальный старт / стоп
[h264 @ 0x7f4fed44e240] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f4fed44e240] error while decoding MB 0 19, bytestream 58299
[h264 @ 0x7f4fed44e240] concealing 1137 DC, 1137 AC, 1137 MV errors in I frame
[rtsp @ 0x7f4fed4479c0] decoding for stream 1 failed
Input #0, rtsp, from 'rtsp://user:pass@CAM-IP:554/s2':
Metadata:
title : s2
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: aac (LC), 11025 Hz, mono, fltp
Stream #0:1: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1024x576 [SAR 189:190 DAR 168:95], 1 fps, 1 tbr, 90k tbn, 2 tbc
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
Metadata:
title : s2
creation_time : now
encoder : Lavf57.56.101
Stream #0:0: Video: mjpeg, yuvj420p(pc), 1024x576 [SAR 189:190 DAR 168:95], q=1-5, 1016 kb/s, 1 fps, 1000k tbn, 24 tbc
Metadata:
encoder : Lavc57.64.101 mjpeg
Side data:
cpb: bitrate max/min/avg: 2032000/0/1016000 buffer size: 655360000 vbv_delay: -1
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[h264 @ 0x7f4fed593920] Invalid NAL unit 0, skipping.
[h264 @ 0x7f4fed5c2900] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f4fed5c2900] error while decoding MB 0 19, bytestream 58299
[h264 @ 0x7f4fed5c2900] concealing 1137 DC, 1137 AC, 1137 MV errors in I frame
[h264 @ 0x7f4fed593920] concealing 1194 DC, 1194 AC, 1194 MV errors in I frame
[h264 @ 0x7f4fed502540] cabac decode of qscale diff failed at 36 17=12699.4kbits/s dup=80 drop=0 speed=0.653x
[h264 @ 0x7f4fed502540] error while decoding MB 36 17, bytestream 60272
[h264 @ 0x7f4fed502540] concealing 1229 DC, 1229 AC, 1229 MV errors in I frame
Past duration 1.279991 too large 9948kB time=00:00:06.41 bitrate=12700.4kbits/s dup=151 drop=0 speed=0.728x
Past duration 2.111992 too large 15968kB time=00:00:10.33 bitrate=12659.0kbits/s dup=242 drop=0 speed=0.769x
[h264 @ 0x7f4fed5a5fe0] error while decoding MB 17 12, bytestream -612617.6kbits/s dup=332 drop=0 speed=0.822x
[h264 @ 0x7f4fed5a5fe0] concealing 1568 DC, 1568 AC, 1568 MV errors in I frame
Past duration 1.351997 too large 29656kB time=00:00:19.29 bitrate=12593.1kbits/s dup=452 drop=0 speed=0.987x
frame= 555 fps= 27 q=24.8 Lsize= 35484kB time=00:00:23.08 bitrate=12592.8kbits/s dup=540 drop=0 speed=1.14x
video:35350kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.379247%