deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.26k stars 301 forks source link

Identify why WebRTC stream stops after a few seconds #137

Open xiki808 opened 2 years ago

xiki808 commented 2 years ago

I have two IP cameras and both streams are configured. I have no problems with one, but with the other, the webrtc stream freezes after just a few seconds. Is it possible to point out if a camera has some settings that might break the webrtc stream?


root@raspberrypi:~# ffprobe -v error -show_format -show_streams rtsp://10.0.0.101:554/onvif1
[h264 @ 0x5589610650] out of range intra chroma pred mode
[h264 @ 0x5589610650] error while decoding MB 19 2
[h264 @ 0x5589610650] left block unavailable for requested intra mode
[h264 @ 0x5589610650] error while decoding MB 0 2
[h264 @ 0x5589610650] left block unavailable for requested intra mode
[h264 @ 0x5589610650] error while decoding MB 0 17
[h264 @ 0x5589610650] left block unavailable for requested intra mode
[h264 @ 0x5589610650] error while decoding MB 0 8
[h264 @ 0x5589610650] left block unavailable for requested intra mode
[h264 @ 0x5589610650] error while decoding MB 0 17
[h264 @ 0x5589610650] left block unavailable for requested intra mode
[h264 @ 0x5589610650] error while decoding MB 0 2
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Baseline
codec_type=video
codec_time_base=0/2
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=1280
height=720
coded_width=1280
coded_height=720
closed_captions=0
has_b_frames=1
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv420p
level=31
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=unspecified
field_order=progressive
timecode=N/A
refs=1
is_avc=false
nal_length_size=0
id=N/A
r_frame_rate=90000/1
avg_frame_rate=0/0
time_base=1/90000
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
[STREAM]
index=1
codec_name=pcm_alaw
codec_long_name=PCM A-law / G.711 A-law
profile=unknown
codec_type=audio
codec_time_base=1/8000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=s16
sample_rate=8000
channels=1
channel_layout=unknown
bits_per_sample=8
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/8000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=64000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
[FORMAT]
filename=rtsp://10.0.0.101:554/onvif1
nb_streams=2
nb_programs=0
format_name=rtsp
format_long_name=RTSP input
start_time=0.000000
duration=N/A
size=N/A
bit_rate=N/A
probe_score=100
TAG:title=H.264 Video, RtspServer_0.0.0.2
[/FORMAT]
deepch commented 2 years ago

tru ffprobe to source

xiki808 commented 2 years ago

Sorry but I know so much, how can I do that?

deepch commented 2 years ago

it you camera stream rtsp://10.0.0.101:554/onvif1

10.0.0.101 - camera? or server ?

deepch commented 2 years ago

In general, these errors say that your stream is broken.

1) Update camera firmware 2) Try resetting the camera to default settings

xiki808 commented 2 years ago

10.0.0.101 is the camera's IP

Firmware is updated, will try resetting

deepch commented 2 years ago

It's definitely a problem with the camera.

xiki808 commented 2 years ago

Thanks a lot gave it a reset and it worked fine now!

If there's any possible way with ffmpeg to figure out if a camera has issues with webrtc, I would like to know, to use some kind of validation in my scripts which is setting things up

xiki808 commented 2 years ago

because if could have used hlsll as that was working fine