In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to realize Qt ffmpeg Android version". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "Qt ffmpeg Android version how to achieve"!
I. Foreword
I have always wanted to build an Android version of the video surveillance program. I got one a long time ago. It uses the lib file of the early ffmpeg2. For many network streaming media formats now, support is limited. Moreover, the new Qt writes Android programs. The structure has also changed. The new Android system permission requirements are different from those handled before. Now dynamic authorization is required. In the past, it was directly configured to write what permissions are needed. So recently deliberately rewritten all the Android version of the video surveillance program, the kernel is still using ffmpeg, replaced by the latest ffmpeg4 version, in ubuntu system with Android compiler compiled the corresponding lib file, and then put it on win to write Qt+ Android program.
In order to manage a version of ffmpeg video surveillance kernel program uniformly, modify the existing program directly, add the code of dynamic permission application, at the same time, the corresponding progress bar and check box are enlarged, convenient to select, the channel screen is limited to 4 by default, you can increase the number of screens by yourself, at the beginning of the test to save screenshots and video files, found that life and death are unsuccessful, after the dynamic permission application is successful, put it successfully, here for a long time, It turns out that the processing requirements for different Android systems are different. New technologies emerge one after another in the new era. Iteration is really very fast. It seems that we have to constantly learn and understand new technologies and new knowledge in order to maintain vitality. A promising programmer spends 60% of his time studying and 40% of his time working. This way, his salary can double every two years. Moreover, the most fatal thing is that programmers also have some talent. Not everyone is suitable. Most programmers spend their time in business logic and are finally eliminated! This is also the main cause of midlife crisis at 35 years old. In fact, the older a powerful programmer got, the more valuable he became.
II. Functional characteristics
Multi-thread real-time playback video stream + local video +USB camera, etc.
Windows+linux+mac support, ffmpeg3 and ffmpeg4 support, 32-bit and 64-bit support.
Multi-thread display image, not card main interface.
Automatically reconnect the webcam.
You can set the border size i.e. offset and border color.
Can set whether to draw OSD label, i.e. label text or picture and label position.
Two OSD positions and styles can be set.
You can set whether to save to a file and file name.
Drag files directly to the ffmpegwidget control for playback.
Support h365 video stream +rtmp and other common video streams.
You can pause and resume playback.
Support single video file storage and timed video file storage.
Customize the top float bar, send a signal notification by clicking, and set whether to enable it.
You can set the screen stretch fill or proportional fill.
Decoding can be set to speed first, quality first, equalization processing.
Screenshots (original images) and screenshots of videos are available.
Video file storage supports bare stream and MP4 files.
Perfect audio and video synchronization, using external clock synchronization strategy.
Support seek positioning playback position.
Support qsv, dxva2, d3d11va hard decoding.
Support opengl rendering video data, very low CPU usage.
Support Android and embedded Linux, cross-compile.
III. Effect Drawing
4. Core code #include "head.h"#include "frmtab.h"//dynamically set permission bool checkPermission(const QString &permission){#ifdef Q_OS_ANDROID#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) QtAndroid::PermissionResult result = QtAndroid::checkPermission(permission); if (result == QtAndroid::PermissionResult::Denied) { QtAndroid::requestPermissionsSync(QStringList() setStyleSheet(list.join(""));}int main(int argc, char *argv[]){#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);#endif#if (QT_VERSION > QT_VERSION_CHECK(5,4,0)) //Set opengl mode AA_UseDesktopOpenGL AA_UseSoftwareOpenGL AA_UseOpenGLES //QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);#endif QApplication a(argc, argv); App::setFont(); App::setCode(); App::ConfigFile = AppPath + "/video_ffmpeg.ini"; App::readConfig(); frmTab w;#ifdef Q_OS_ANDROID //Request permission checkPermission("android.permission.READ_EXTERNAL_STORAGE"); checkPermission("android.permission.WRITE_EXTERNAL_STORAGE"); QString strDir = AppPath + "/snap"; QDir dir(strDir); if (! dir.exists()) { dir.mkpath(strDir); } initStyle(); w.showMaximized();#else w.resize(1100, 700); w.setWindowTitle(QString("qt+ffmpeg example %1%2").arg(App::Version).arg (App::TitleFlag)); w.show(); App::setFormInCenter(&w);#endif return a.exec();} At this point, I believe everyone has a deeper understanding of "Qt ffmpeg Android version how to achieve", may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.