1137
Link: @CplusplusQt Embedded: @EMBCpp • No DM without prior permission • Behave friendly • No NSFW • No Spam • No unauthorized Bots • Don't advertise other groups
Make it a component of its own, so you can reuse it -- call it PausableTimer or some such, then you can have it available whenever you need it :)
Читать полностью…
Well, I guess they thought a timer measures the time between a beginning and an end. 😉
Читать полностью…
Not necessarily.
Use new Date().getTime()
If you get the time when the timer starts, you can also get the time when you pause it (add a js function to your Timer for this), calculate the elapsed time, and subtract that from your Timer interval. Then you can reset the interval to the remaining time. Next time the timer starts, it would be considered resumed from being paused. You'd want to keep track of the actual interval in a separate property, so when the timer expires and fires, you can reset the interval back to the full interval.
Good question, but creating an own timer with that capability shouldn’t be that hard I suppose?
Читать полностью…
Welcome to the group, @adi011235! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
You can see from my first attempt - modifying the metadata to alter the rotation in the metadata for each frame doesn't work — Qt Multimedia honors it and sets the aspect ratio it renders to proper for the rotation, but the underlying video still renders in it's original orientation.
The second impl is a pure Qt Quick impl.
The third is taking that Qt Quick impl, and embedding it in the Widgets window.
https://github.com/keithel/multimedia-video-modify-orientation
Читать полностью…
Unfortunately, I don't have a video right now that I could share for a bug report.
Читать полностью…
A separate observation: When grabbing a frame and saving it to disk (as a png or jpg), for SOME videos, the saved image will be much brighter than the video.
Читать полностью…
I suppose a QOpenGLWidget subclass could be more efficient
Читать полностью…
But then, the playback isn't really optimized. It's then all software.
Читать полностью…
I'll shoot a link to the repo I used for my testing... I haven't implemented the QGraphicsScene approach.
Читать полностью…
Pausing it is not really something they had in mind. And I'd see that part of the interface in the user's responsibility.
Читать полностью…
Yeah, that's actually what I'm doing now. Just a bummer that I'll have to do it myself because it seems like a basic function of a timer 😅
But I guess there's a technical reason or something why it's not there
But that would probably need to be done in C++, right?
Читать полностью…
Why can't we pause and resume a Timer? :(
Should I just use animation which can be paused? LOL
Videos from my cell phone are okay. Need to find out what cell phones trigger this.
Читать полностью…
As a bonus, I made Qt Designer plugin to add QVideoWidget to the Qt Designer Widget Box, since it isn't there by default.
Читать полностью…
Just point at Big Buck Bunny — it's commonly used for testing video stuff.
Читать полностью…
When I copy the frame into a new image (with QPainter) and then save this new picture, everything is as expected.
Читать полностью…
I wrote a suggestion for Qt: https://bugreports.qt.io/browse/QTBUG-141989
Читать полностью…
I'd probably implement it with grabbing the frame whenever it changes and then drawing it after rotation in the paint event.
Читать полностью…
I investigated this a bit last night and this morning, and I haven't figured out a good way to do this.
The way to do this that is most optimized would be to do the video playback in Qt Quick, and embed it in your Widgets app using a QQuickWidget — this way you get optimized rendering.
I don't know of a "pure widgets" way to do it, but another way that occurred to me is to do it in a QGraphicsScene - as that provides a way to transform Qt Widgets.