-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
FFmpegFrameGrabber grab corrupted frame #845
Comments
Here is what I found.. |
Probably all codecs don't actually support odd width values like that
without some tricks. Could you check what the ffmpeg program does for that,
and we'll replicate it in FFmpegFrameRecorder?
|
@saudet Original video size is 854. Size of the picture from ffmpeg program 854 also and it is with out black line. If not using setImageWidth in
image is fine and not containing black line... (with width - 2 picture also fine) So seems like the problem not with odd values... And seems like changing width to any value, fix this problem somehow. |
Does this happen with FFmpeg 3.4 as well? |
The ffmpeg program uses SWS_BICUBIC by default, but FFmpegFrameGrabber uses SWS_BILINEAR: |
@saudet What exactly option of |
You'll have to modify the source code...
|
How can I disable FFmpeg's default output?
|
@gkozyryatskyy Any updates on this? I've just released JavaCV 1.4.1, which uses FFmpeg 3.4.2. Maybe this is a bug that has been fixed upstream, so please try again with this new release! @arianaa30 Just call |
@saudet Just tested it with 1.4.1.. Black line is still there =( Also for now I do not try to change pixel format... |
@gkozyryatskyy Have you also tried |
@saudet not yet.. this is a minor bug from my side and it is reproduced not everywhere... So for now it is in backlog.. |
…der`, with `SWS_BILINEAR` as default for FFmpeg (issue #845)
With JavaCV 1.4.3, we can now use |
@saudet |
This problem still occurs in JavaCV 1.5. Changing the ImageScalingFlags does not help. |
@svorlauf You'll need to call |
@saudet that is exactly what we do: |
Ok, do you have a way to reproduce this? |
example.zip |
It happens only with Java2DFrameConverter? It doesn't happen with anything
else?
|
The Java2DFrameConverter is only for the next steps. We also printed out the pixel data of the picture_rgb in the frame. These already have 0 values at the end of every line. But i am not sure if it is also the case before calling |
The stride can be larger than the width, that's not a problem. Make sure
you don't take pixels outside the width.
|
I rechecked the lineStride. It is 3 * the imageWidth. Exactly what to expect for rgb |
It seems to be related to this open bug: https://trac.ffmpeg.org/ticket/1031 |
So |
Something like that, their workaround appears to work fine: 1d06eaa |
Works great. Thanks a lot. Is there any release planned in the near future? Or do i have to do run my own build to integrate the fix into the jar? |
You could use the snapshots: http://bytedeco.org/builds/ |
JavaCV 1.5.1 has now been released with the fix! Enjoy |
Hello!
I have a video file and cutting image from it.
Here is a code example:
Everything seems like works fine, but
out.jpg
image has a black line at the right side... (https://www.dropbox.com/s/cvv2djhcl825xga/out.jpg?dl=0)Input video looks fine (there is no this line).
ffmpeg
using commandffmpeg -i https://www.dropbox.com/s/tu7m17pg9bvtkas/PorkBelly.mp4?dl=1 -ss 00:00:5.000 -vframes 1 ffmpegout.jpg
and everything fine there (there is no this black line)Also this happening not with all videos, but just with "some of them". Do not know what exactly causing this black line.
So, maybe you have some ideas how I can get rid of this, when grabbing frame using FFmpegFrameGrabber?
Thank you!
The text was updated successfully, but these errors were encountered: