RSATom / QmlVlc

[ABANDONED] libvlc wrapper for Qt Quick 2/Qml
Other
139 stars 56 forks source link

VlcVideoSurface flickering with animation #1

Closed pincopallopino closed 10 years ago

pincopallopino commented 10 years ago

if i start an animation like this one, the video starts flickering until the animation has not finished:

NumberAnimation { id: slide target: mVlcVideoSurface properties: "y" from: 500 to: 0 duration: 5000 }

RSATom commented 10 years ago

Thanks, I'll try to fix it today.

RSATom commented 10 years ago

I've checked your code, and don't see any flickering. What hardware do you have?

pincopallopino commented 10 years ago

this is the full qml code: https://gist.github.com/pincopallopino/2b6c99783970dc0b779d

i'm on xubuntu 12.04 32 bit cpu: Intel® Core™ i5-2310 CPU @ 2.90GHz × 4 ram: 3,8 Gib and the graphic card: VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

pincopallopino commented 10 years ago

if you want i can send you a video that show the flickering

RSATom commented 10 years ago

I forgot you are on linux... and yes, several seconds of video will be useful.

pincopallopino commented 10 years ago

how can i send it to you?

RSATom commented 10 years ago

YouTube?

pincopallopino commented 10 years ago

https://www.youtube.com/watch?v=jYWRMX2D1Ps&feature=youtu.be

RSATom commented 10 years ago

ok, thanks.

RSATom commented 10 years ago

I don't see any flickering with your qml too. It seems I have to try on linux... But I could do it only on weekends.

You could try replace VlcVideoSurface with filled by some color rectangle, and check if flickering will gone. If it will, then problem definitely in qmlvlc...

pincopallopino commented 10 years ago

i tried replacing the VlcVideoSurface with a rectangle and there is no flickering...

pincopallopino commented 10 years ago

i had a similar problem some time ago... the issue was related with the updating of the bounding rect.. maybe it can help you

RSATom commented 10 years ago

I thought a little about this issue, and decide restore support of QtMultimedia's video output for QmlVlc. I think it will be more stable solution than custom video surface implementation. And it allow use QmlVlc on mobile and other platforms which QtMultimedia supports. It will have one disadvantage - QtMultimedia does not supports video output from one source to multiple video surfaces.

But WebChimera will continue to use own video surface implementation for security reasons.

pincopallopino commented 10 years ago

ok, tell me when you'll update the repository, i will try this solution

RSATom commented 10 years ago

I'm almost finished, it will be available today or tomorrow.

RSATom commented 10 years ago

I've updated demo. Try it please.

pincopallopino commented 10 years ago

i've tried... now there is no flickering... but after 10-20 seconds it crashes... this is the backtrace:

~"#0 __memcpy_ssse3_rep () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S:191\n" ~"#1 0xb6a6a3a1 in plane_CopyPixels (p_dst=0xafa52444, p_src=0xafa52d04) at /usr/include/i386-linux-gnu/bits/string3.h:52\n" ~"#2 0xb6a6a469 in picture_CopyPixels (p_dst=0xafa523e8, p_src=0xafa52ca8) at misc/picture.c:334\n" ~"#3 0xb6a6a4ae in picture_Copy (p_dst=0xafa523e8, p_src=0xafa52ca8) at misc/picture.c:339\n" ~"#4 0xb6a4978c in ThreadDisplayRenderPicture (is_forced=false, vout=0x83f86d8) at video_output/video_output.c:994\n" ~"#5 ThreadDisplayPicture (vout=0x83f86d8, now=40, deadline=0xace8b2f8) at video_output/video_output.c:1125\n" ~"#6 0xb6a4ae3c in ThreadManage (interlacing=0xace8b2ec, deadline=0xace8b2f8, vout=0x83f86d8) at video_output/video_output.c:1136\n" ~"#7 Thread (object=0x83f86d8) at video_output/video_output.c:1569\n" ~"#8 0xb6d8dd4c in start_thread (arg=0xace8bb40) at pthread_create.c:308\n" ~"#9 0xb6bc9bae in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130\n"

RSATom commented 10 years ago

Crash is better than flickering since it easier to fix. So it's event better. I'll look today. Thank you.

RSATom commented 10 years ago

Which vlc version do you have? Crash is somewhere in vlc.

pincopallopino commented 10 years ago

i have vlc 2.1.3.. it is the last version

pincopallopino commented 10 years ago

i update the repository, now the problem is gone

RSATom commented 10 years ago

Great, thanks! Now I should try fix flickering...

pincopallopino commented 10 years ago

there is no flickering now

RSATom commented 10 years ago

even with VlcVideoSurface?

pincopallopino commented 10 years ago

sorry, i mean with VideoOutput there is no flickering.. if i use vlcvideosurface there is flickering

RSATom commented 10 years ago

yea, and it should be fixed too...

RSATom commented 10 years ago

VlcVideoSurface is fixed too ( by 4e604b6085 and ad7b9050e5 )

pincopallopino commented 10 years ago

hi, the flickering is mostly disappeared, but sometimes i see it again, specially when there are multiple animations at the same time.. if i remove the streams the flickering disappear.. which could be the cause?

RSATom commented 10 years ago

Do you see flickering when resize main window?

pincopallopino commented 10 years ago

no, the window is full screen

RSATom commented 10 years ago

I just want to say, I see rare flickering too (on xubuntu 12.04). Even when qml does not contains QmVlc items at all. And when I resize window by mouse I see very much flickering. Don't sure why this happens, maybe it's a problem with QQuickView background filling.

pincopallopino commented 10 years ago

i make a video: https://www.youtube.com/watch?v=d8HcBz6kykg&feature=youtu.be

RSATom commented 10 years ago

I see, it's annoying.

Maybe this will help: https://qt-project.org/forums/viewthread/23995 http://qt-project.org/doc/qt-5.0/qtquick/qquickwindow.html#setClearBeforeRendering http://qt-project.org/doc/qt-5.0/qtquick/qquickwindow.html#color-prop

i.e. try disable background cleanup:

view.setClearBeforeRendering(false);

or set cleanup color to black:

view.setColor( QColor( Qt::black )  );
RSATom commented 10 years ago

btw, did you still use QtMultimedia's VideoOutput item?

pincopallopino commented 10 years ago

no, now i'm using VlcVideoSurface.. btw i put "view.setClearBeforeRendering(false);" in the main.cpp and now the flickering is disappeared. thank you so much

RSATom commented 10 years ago

But if use VideoOutput - is it flickering too ( without setClearBeforeRendering(false) )? Maybe VlcVideoSurface needs some more optimizations...

pincopallopino commented 10 years ago

no no, the flickering happens also with videoOutput