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

crash and bad frames generated #101

Open
jaffa4 opened this issue Mar 3, 2016 · 5 comments
Open

crash and bad frames generated #101

jaffa4 opened this issue Mar 3, 2016 · 5 comments

Comments

@jaffa4
Copy link

jaffa4 commented Mar 3, 2016

Hi,

If you run segfault.sh, you will see a crash in customer because the resolution of the image is not what is expect, an image with a bad resolution is copied.

It also causes bad frames in video, broken frames, noisy pictures..
Try artifacts.sh

My debugging showed me what for first frame , the producer returns bad resolution, not for the rest.

artifacts.zip

@ddennedy
Copy link
Member

ddennedy commented Mar 3, 2016

I only took a quick look into this, and I am not very motivated at the moment to dig into it deeper. Most people that want to use composite as a filter use the watermark filter, and filter_transition is actually seldom used. However, I see you are also doing geometry animation, and composite/watermark really sucks for that because it does not support sub-pixel interpolation, and it operates in YUV 4:2:2, which means it only has 2 pixel precision - not even 1! Therefore, I recommend using the affine transition/filter, which does interpolation.

@jaffa4
Copy link
Author

jaffa4 commented Mar 5, 2016

But you are going to fix it, right? On one day?

@bmatherly
Copy link
Member

Someone will probably look at it some day. It is difficult to determine the priority because we don't know anything about your project or how many people it affects.

@max-verem
Copy link
Contributor

max-verem commented Oct 4, 2016

Problem reproduced by segfault.sh in at:

(gdb) bt
#0  0x0000003253339add in __memcpy_ssse3 () from /lib64/libc.so.6
#1  0x00007fffef71befd in consumer_thread (arg=0x619610) at consumer_avformat.c:1789
#2  0x0000003253607d90 in start_thread () from /lib64/libpthread.so.0
#3  0x00000032532f119d in clone () from /lib64/libc.so.6

it happens because of size of image returned from:

1773: mlt_frame_get_image( frame, &image, &img_fmt, &img_width, &img_height, 0 );

differ:

consumer_thread:1772 img_width=1280, img_height=720, width=1280, height=720
consumer_thread:1775 img_width=514, img_height=105, width=1280, height=720

then image allocated at video_avframe

as result it cause memcpy to access memory outside of received image.

May be scaler not inserted?

@max-verem
Copy link
Contributor

Problem reproduced by artifacts.sh has similar nature.

Frame 0 (broken/corrupted)

consumer_thread:1772 img_width=1280, img_height=720, width=1280, height=720
consumer_thread:1775 img_width=1216, img_height=760, width=1280, height=720

Frame 1 (broken/corrupted)

consumer_thread:1772 img_width=1216, img_height=760, width=1280, height=720
consumer_thread:1775 img_width=1280, img_height=720, width=1280, height=720

Frame 2 (normal)

consumer_thread:1772 img_width=1280, img_height=720, width=1280, height=720
consumer_thread:1775 img_width=1280, img_height=720, width=1280, height=720

It seems no normalizing filters attached/executed. as result avformat consumer receives frames that is not in profile sizes...

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

4 participants