-
Notifications
You must be signed in to change notification settings - Fork 547
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
segfault when using h264_v4l2m2m encoder + ffmpeg 4.14 #977
Comments
The function |
Yes, the |
I was just looking at this. Unfortunately, it does not appear that I have a device that this will work upon. I specified a codec of From your debug, it seems to be getting an invalid size and I'd recommend validating the size and data buffer parameters inside of Motion as it is called. Effectively to see whether Motion provided the values in the frame and they were lost along the way to the decoder in FFmpeg or whether Motion got a bad frame, sent it along and other encoders ignored it but this one seg faulted. If it is the latter, then we can see about specifying the size and other parameters better or skipping invalid input frames. If instead it is being lost instead of the FFmpeg processing, that would be a different course. A debug print similar to the one provided but also upon the frame sent from Motion should illuminate the situation. |
Turns out that the encoder expects
|
I added
|
Did you really mean Try adding your May also want to revise the second parameter to 0 rather than 8 and let FFmpeg decide the alignment. |
Turns out that this encoder only accepts multi-planar buffer, and the ffmpeg v4l2 code only looks for the image Y channel in As a test, after Now I have a couple of questions:
|
No. We set the pointers in the data struct.
Is it even possible for Motion to do this? I do not recall seeing in any of the FFmpeg examples a demonstration of this being done. If they don't have it in an example, then I'd say that it would be upon FFmpeg to do the appropriate conversions.
From what you've described, it seems like a small function to work around it for this encoder would be needed in Motion. The larger issue regarding what to do with all the other encoders is tougher since we do not know what each encoder is expecting. (Hence why it would seem to be needed in FFmpeg as part of their implementation for each encoder) |
Closed via #991 |
Motion is able to configure the encoder's parameters like bitrate etc, but as soon as the first frame is sent over to ffmpeg, I get a segfault. I've added more debug prints in ffmpeg library to see where it actually segfaults. Here's the log:
This is the function after I've added debug print.
Not sure whether it's motion's bug or ffmpeg's bug, hoping you guys might be able to give me some pointers.
The text was updated successfully, but these errors were encountered: