-
Notifications
You must be signed in to change notification settings - Fork 55
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
Segmentation fault when video size is incorrect #140
Comments
As mentioned in #140 the video resolution for H.264 videos should be a multiple of 4.
Hi @kojix2! Thank you and @kou for reporting the issue and all the research on the problem. This should be fixed in 5c43fd1. Additionally the video resolution is set to the next larger width/height that is a multiple of 4 if the video is H.264 encoded, so that video creation should no longer fail due to a invalid resolution. Could you check if this solves your problem? |
Thanks! |
Thank you @danielkaiser and @kou. I'll close the issue. |
Hi! GR developers.
Summary
We found that segmentation faults occur when the video size is not specified, or when the video size is not specified correctly.
This is related to x264 and does not occur when using the official GR binaries.
red-data-tools/GR.rb#46
Step to reproduce
red-data-tools distributes a GR package for Linux.
I used this package to install GR . Then set the following environment variables
GKS_WSTYPE=100
GKS_VIDEO_OPTS='361x240@25@2x'
orunset GKS_VIDEO_OPTS
Use
beginprint()
andendprint()
to output the video. For example, in the case of RubyThis will cause a segmentation fault.
According to @kou 's research, x264 does not support cases where the video size is not a multiple of 4, so
avcode_open2()
will fail. (Similarly, it seems to fail if the video size is not specified.) Andmovie->fmt_ctx->pb
will be null. Even in that case,av_write_trailer()
will be called and a segmentation fault will occur.red-data-tools/GR.rb#46 (comment)
This does not happen when using the official binaries distributed in sciapp/gr. The reason for this was thought to be that
libopenh264
was used instead ofx264
.Thank you.
The text was updated successfully, but these errors were encountered: