當版本大於 2.8.15 時,我在使用 FFMPEG 時遇到問題(不是邊界 - 只是 v3 和 v4 不起作用)。 ffprobe 也不起作用。
版本 3:
ffprobe -rtsp_transport tcp rtsp://user:password@ipaddress:5544/live0.264
返回:
[h264 @ 0xcd6e70] Overread VUI by 8 bits
[rtsp @ 0xcd3b10] Failed to open codec in av_find_stream_info
[NULL @ 0xcd6e70] Overread VUI by 8 bits
[h264 @ 0xcd6e70] Overread VUI by 8 bits
[rtsp @ 0xcd3b10] Could not find codec parameters for stream 0 (Video: h264 (High), none(progressive)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://user:password@ipaddress:5544/live0.264':
Metadata:
title : Session Streamed by LIBZRTSP
comment : live0.264
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (High), none(progressive), 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
和
ffmpeg -f rtsp -rtsp_transport tcp -y -i "rtsp://user:password@ipaddress:5544/live0.264" -f image2 -vframes 1 -vsync 2 -pix_fmt yuvj420p "/home/james/photo_$(date +%Y.%m.%d_%H:%M:%S).jpg"
回報
[h264 @ 0x1634680] Overread VUI by 8 bits
[rtsp @ 0x16312f0] Failed to open codec in av_find_stream_info
[NULL @ 0x1634680] Overread VUI by 8 bits
[h264 @ 0x1634680] Overread VUI by 8 bits
[rtsp @ 0x16312f0] Could not find codec parameters for stream 0 (Video: h264 (High), none(progressive)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://user:password@ipaddress:5544/live0.264':
Metadata:
title : Session Streamed by LIBZRTSP
comment : live0.264
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (High), none(progressive), 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
[buffer @ 0x177e510] Unable to parse option value "0x0" as image size
[buffer @ 0x177e510] Unable to parse option value "-1" as pixel format
[buffer @ 0x177e510] Unable to parse option value "0x0" as image size
[buffer @ 0x177e510] Error setting option video_size to value 0x0.
[graph 0 input from stream 0:0 @ 0x177e490] Error applying options to the filter.
Error opening filters!
版本 4 是相同的,只是它提到了 avformat_find_stream_info 而不是 av_find_stream_info
但...
2.8.15 版本:
ffmpeg -f rtsp -rtsp_transport tcp -y -i "rtsp://user:password@ipaddress:5544/live0.264" -f image2 -vframes 1 -vsync 2 -pix_fmt yuvj420p "/home/james/photo_$(date +%Y.%m.%d_%H:%M:%S).jpg"
返回:
[h264 @ 0x2243e80] Overread VUI by 8 bits
Last message repeated 5 times
Invalid UE golomb code
Last message repeated 1 times
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://user:password@ipaddress:5544/live0.264':
Metadata:
title : Session Streamed by LIBZRTSP
comment : live0.264
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709), 1920x1080, 10 fps, 10 tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
[h264 @ 0x242bd60] Overread VUI by 8 bits
Last message repeated 2 times
Output #0, image2, to '/home/james/photo_2019.04.04_10:17:03.jpg':
Metadata:
title : Session Streamed by LIBZRTSP
comment : live0.264
encoder : Lavf56.40.101
Stream #0:0: Video: mjpeg, yuvj420p(pc), 1920x1080, q=2-31, 200 kb/s, 10 fps, 10 tbn, 10 tbc
Metadata:
encoder : Lavc56.60.100 mjpeg
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
Invalid UE golomb code
frame= 1 fps=0.0 q=9.5 Lsize=N/A time=00:00:00.10 bitrate=N/A
video:146kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
但絕對有效並返回正確的照片。
出於診斷目的,我還從相機中輸出了較低的分辨率流:rtsp://user:password@ipaddress:5544/live1.264 適用於所有版本!
無論如何,我可以查看steam資訊來看看差異嗎?
是否因為 RTSP 流無效,但對 v2 可用(對 v3 被拒絕)?或者還有其他問題可以透過更改參數來修復嗎?
任何關於讓它在至少 v3 上工作的指導將不勝感激。
不幸的是,這些攝影機看起來像 PIR 警報感測器,並且透過乙太網路供電,因此市場上實際上沒有其他選擇。
謝謝,如果您需要任何其他信息,請告訴我?
更新 04/04/2019 17:20 倫敦: 我嘗試過相機中的串流設置,發現當我將串流設置為 720p 時,可以使用更高解析度的串流。但當我切換回 1080p 時,它又失敗了。不確定這是否有幫助。
答案1
相機正在產生無效的 VUI,它是 SPS 的一部分。您需要修補 ffmpeg 以更優雅地處理此錯誤,或者相機製造商需要透過韌體更新來修復它。