webrtc-streamer icon indicating copy to clipboard operation
webrtc-streamer copied to clipboard

can not play webrtc stream

Open dannyxu2015 opened this issue 7 months ago • 3 comments

Used ffmpeg to generate local rtsp stream, and vlc play well which url is rtsp://localhost:8554/live, ffmpeg command: ffmpeg -re -stream_loop -1 -i ~/Downloads/oceans.mp4 -s 426x240 -c:v libx264 -profile:v baseline -b:v 1M -r 24 -g 60 -an -f rtsp rtsp://localhost:8554/live

using bluenviron/mediamtx as the rtsp server. OS: macOS 15.4

then start the webrtc-streamer by docker
docker run --name webrtc-streamer -d -p 8000:8000 mpromonet/webrtc-streamer -n steamer -u rtsp://localhost:8554/live

access 'http://localhost:8000/webrtcstreamer.html?video=streamer&options=rtptransport%3Dtcp%26timeout%3D600&' with chrome, can not play the video

the docker log:

Image

the console capture:

Image

Looking forward your help, Thanks!

dannyxu2015 avatar Apr 18 '25 11:04 dannyxu2015

Hi @dannyxu2015

localhost is the docker itself, not the host that run the docker. Adding '--net host' to the docker command will share same network interface.

Best Regards Michel

mpromonet avatar Apr 18 '25 19:04 mpromonet

Thanks for the quick reply, '--net host' seems not work on Mac, so I use the 'host.docker.internal' for access host network

docker run --name webrtc-streamer -d -p 8000:8000 mpromonet/webrtc-streamer -n xxx -u rtsp://host.docker.internal:8554/live

But still can't access the video, log:

Version:v0.8.9-21-gf9b577c/Linux-x86_64 [email protected] webrtc@4030180fc5-dirty live555helper@bd5f554
{
	"urls" :
	{
		"xxx" :
		{
			"video" : "rtsp://host.docker.internal:8554/live"
		}
	}
}Logger level:4
HTTP Listen at 0.0.0.0:8000
Requested URL : rtsp://host.docker.internal:8554/live
Start playing sink for "video/H264" subsession
Close session: video/H264
Requested URL : rtsp://host.docker.internal:8554/live
Start playing sink for "video/H264" subsession
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
[h264 @ 0x7f3884002f00] non-existing PPS 0 referenced
[h264 @ 0x7f3884002f00] decode_slice_header error
[h264 @ 0x7f3884002f00] no frame!
Close session: video/H264

dannyxu2015 avatar Apr 21 '25 03:04 dannyxu2015

Hi @dannyxu2015

From the errors, it seems h264 stream header cannot be decoded, it may be a problem in your input stream or in h264 decoder, or in the code between.

Best regards Michel

mpromonet avatar May 04 '25 16:05 mpromonet