valbok / qtavplayer Goto Github PK
View Code? Open in Web Editor NEWFree and open-source Qt Media Player library based on FFmpeg, for Linux, Windows, macOS, iOS and Android.
License: MIT License
Free and open-source Qt Media Player library based on FFmpeg, for Linux, Windows, macOS, iOS and Android.
License: MIT License
For some reasons cmake-produced project for qml_video references Qt5MultimediaQuick.lib instead of Qt5MultimediaQuickd.lib on Windows. Qt 5.12.10 issue?
At the moment QtAVPlayer is 'Qt module', but there are some cases where it is more convenient to use it as the library so would be helpful if it could provide related pro / pri file.
Subfile input protocol of ffmpeg which allows providing a byte range of an input to read
Taking into account asynchronous nature of seek currently it is not possible to understand when exactly it is finished (and understanding when it is finished is critical for resolving actual post-seek position).
I see the following options to solve this:
Introduce 'SeekingState' into State - this way calling code would be able to listed for state changed signal and listen for 'SeekingState' => 'PausedState' or 'SeekingState' => 'PlayingState'. The drawback is in need to preserve previous state to 'auto-pause' or 'auto-play' after seek completion.
Introduce signal for 'wait' changes. Main issue with this approach is proper naming for this pretty low-level signal
Make 'seek' to accept callback - feels pretty unnatural / non-Qt way.
Any other ideas? I'm leaning towards the first option but want to hear thoughts before proceeding with implementation.
Return as closest frame as possible
Finally I've got some time to play with most recent changes (and started with 5.15.2 for simplicity).
Here is what I've got on windows using qml_video example:
Maybe because of 'QAudioOutput: open error, invalid format.' but it used to work in the past I think...
If executed from debugger:
If executed without debugger - window is black (in rare occasions I do see first frame from 'big buck bunny') - and then it crashes in a second.
... for example AV_PIX_FMT_YUV411P
QAVPlayer p;
QFileInfo fileInfo(path());
QFile file(path());
file.open(QFile::ReadOnly);
// works
/*
{
QAVVideoFrame frame;
QObject::connect(&p, &QAVPlayer::videoFrame, &p, [&frame](const QAVVideoFrame &f) {
qDebug() << "got frame";
});
p.setSource(QUrl(fileInfo.fileName()), &file);
p.stepForward();
QTest::qWait(1000);
}
*/
QBuffer buffer;
buffer.open(QIODevice::ReadWrite);
QAVVideoFrame frame;
QObject::connect(&p, &QAVPlayer::videoFrame, &p, [&frame](const QAVVideoFrame &f) {
qDebug() << "got frame";
});
p.setSource(QUrl(fileInfo.fileName()), &buffer);
while(!file.atEnd()) {
auto bytes = file.read(4096);
buffer.write(bytes);
p.stepForward();
}
QTest::qWait(10000);
What would it take to add Qt 5.12 support?
At the moment it doesn't seem to be working even after specifying 'flushMode: VideoOutput.LastFrame' on VideoFrame
... with API like 'setFilter(QString filterString)'
for example by specifying environment variable(s) FFMPEG / FFMPEG_INCLUDES / FFMPEG_LIBS
FAIL! : tst_QAVPlayer::lastFrame() Compared values are not the same
Loc: [tst_qavplayer.cpp(2077)]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.