Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to encode MPEG stream due to EAGAIN returned by avcodec_receive_packet #4104

Open
LordMZTE opened this issue Jul 28, 2024 · 2 comments

Comments

@LordMZTE
Copy link

Describe Your Environment

  • Version of ZoneMinder: Commit 1ae223b
  • How you installed ZoneMinder: A lightly modified version of the nixpkgs package for the given commit
  • NixOS Vicuna 24.11
  • Browser name and version: Librewolf 128

Describe the bug
When attempting the view an MPEG stream through the web interface, the stream loads indefinetely and the attached errors are printed to the debug log.

To Reproduce
This has been reproduces on a system with an NVidia T400 GPU intended for hardware decoding and encoding.

  1. Enable MPEG streaming
  2. Set these settings:
  • MPEG_LIVE_FORMAT = webm (also seems reproducable with mp4 here)
  • MPEG_REPLAY_FORMAT = webm
  • FFMPEG_INPUT_OPTIONS = -nostdin -err_detect aggressive -fflags discardcorrupt -vsync 0 -hwaccel cuvid -c:v h264_cuvid
  • FFMPEG_OUTPUT_OPTIONS = -c:v h264_nvenc -c:a copy -movflags frag_keyframe+empty_moov+faststart
    I don't quite recall where I got the latter two options from, but this seems to also happeen with them set to their defaults.
  1. Open any stream.

Expected behavior
The stream is hardware encoded with the GPU and shows up properly in the browser.

Debug Logs
https://gist.github.com/LordMZTE/f43463c8569cba69c4f15cb4f994cfe2

Additional Notes

It seems like the invokation to avcodec_receive_packet here returns EAGAIN which is incorrectly being treated as an error condition while it actually signals that more data is needed.

Copy link

welcome bot commented Jul 28, 2024

Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!

@connortechnology
Copy link
Member

Just a heads up until I can get around to looking further: I don't think the mpeg live view has worked for many years. It depended on flash actually.
We currently support janus and rtsp2web for live view h264 (h265 doesn't work yet). Long term will likely go with go2rtc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants