-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
OMX_EmptyThisBuffer hangs when encoding 1280 x 720 video via ffmpeg #851
Comments
ffmpeg libavcodec/omx.c has input_zerocopy feature for optimization (in omx_encode_frame function). It appears that whenever the zerocopy condition is satisfied (contiguous planes and stride alignment), the call to OMX_EmptyThisBuffer hangs. Why would OMX_EmptyThisBuffer hang when it is given a different buffer? |
Nice detective work. Can I check my understanding? It runs for some time at 1280x720, but then hangs? Or does it hang on the first frame? Have you tried adding |
@6by9 Thank you very much for your response. It makes perfect sense now. I think this is what happened:
If I want motion to support zerocopy feature, what's the correct way of doing it? Currently, this is what motion does:
To support zerocopy, what does motion need to do?
|
If I understand you correctly, using MMAL_PARAMETER_ZERO_COPY is going to be the key here. For reasons I don't fully understand the kernel has some magic flags against each allocation mapping. If a range of pages is mapped into memory using Using zero copy means that the gpu_mem allocation is mapped into the kernel and ends up with one of those flags set. That means VCHIQ as part of IL, MMAL, or DispmanX gets the failure on As to what needs to be done:
Don't worry about |
I have this very same issue. Ffmpeg freezes after 1-6 minutes of constant capture and encoding with h264_omx, deppending on the resolution, but only if it's 720p or higher. RPI 3b+ |
@andreluisos I don't believe you have the same issue. |
I can reproduce this
With the fix for https://trac.ffmpeg.org/ticket/6586 in http://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248784.html, you can now work-around the issue by passing |
I'm running motion software with ffmpeg h264_omx encoder and experiencing OMX_EmptyThisBuffer function hanging when encoding 1280 x 720 resolution video. It works flawlessly at 800 x 600 resolution, 1920 x 1080 appears to work too but haven't tested it much.
I've added
start_debug=1
to config.txt, andsudo vcdbg log assert
gave me nothing.My /etc/modprobe.d/bcm2835-v4l2.conf:
options bcm2835-v4l2 max_video_width=1920 max_video_height=1080
How do I debug this further?
More information about the versions tested here.
The text was updated successfully, but these errors were encountered: