AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://airensoft.com/ome.html
MIT License
514 stars 126 forks source link

Player takes several time to load local stream #348

Closed bfigueir closed 9 months ago

bfigueir commented 1 year ago

Hi all,

I'm streaming a local camera with fffmpeg to a local OME and then using the OverPlayer to view the stream. But the player takes several seconds (sometimes over 1min) to load the stream. The loading shows and it stays there over and over.

ffmpeg is streaming at 25 fps average, 640x480

ffmpeg -rtsp_transport tcp -i "rtsp://my.camera" -an -vcodec libx264 -filter:v scale=w=640:h=480 -b 900k -tune zerolatency -movflags +faststart -f flv rtmp://localhost:1935/app/stream_name

I'm connecting to OME via (ws://localhost:3333/app/stream_name)

Any thoughts what might be happening?

On the OME logs the only thing I see is "FMP4 Packager | fmp4_storage.cpp:180 | LLHLS stream(#default#app/stream_name) is creating segments that are too large(10000.000000 ms). It seems that the keyframe interval is longer than the configured segment size."

Thanks Bruno

naanlizard commented 1 year ago

The rtmp key frame interval is too long, webrtc playback can only begin on a keyframe.

I believe llhls has a similar limitation but I'm not sure exactly how it interacts.

I'd suggest setting the camera to generate keyframes more frequently, set ffmpeg to reencode the stream with keyframes every 2 or 4 seconds, or set ome to reencode the stream with keyframes every 2 or 4 seconds depending on which you prefer

bfigueir commented 1 year ago

Thanks @naanlizard for the quick reply. Any thoughts on how to do that on ffmpeg? (still learning it)

Thanks

naanlizard commented 1 year ago

I've got to sleep for now but Google should have an answer. If you have specific questions just ask and I'll reply in the morning

bfigueir commented 1 year ago

ok thanks nonetheless @naanlizard . Cheers

SangwonOh commented 9 months ago

Thansks @naanlizard

We are closing the issue due to a long period of inactivity. If further discussion is needed, please reopen the issue.