In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Qt how to achieve Haikang sdk local playback", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to achieve Haikang sdk local playback" bar!
I. Preface
Haikang sdk includes a MP4 decoding playback library, and the corresponding API functions all begin with PlayM4. As the name implies, playing MP4, Haikang videos can be saved as MP4 files by default and can be played with a general-purpose player. This is why all kinds of kernel video storage mentioned in many previous articles are changed to MP4 storage, vlc, mpv, ffmpeg, etc., and finally the video storage is converted into MP4 files. It seems that what big companies and big factories do is also saved into MP4 files, there must be a reason for him. As for how much truth there is, just follow him to deal with it in this way. You don't have to ask about it first, and you can just go to the code by hand. Some things need to be studied deeply, but there is no need to inquire too carefully about some things. It is necessary to toss down into a dead end, such as knowing 1: 1, 1: 2, as for why = 2. Just leave it to a special researcher to study it.
Haikang sdk's MP4 decoding library supports not only its own MP4 files, but also conventional MP4 files, and the latest version also supports AVI file format. Local MP4 files are also supported. If you need to get audio and video data, you only need to call the decoding callback function set by PlayM4_SetDecCallBackMend, which is much simpler than the callback process of video stream. You just need to decode it and convert it to QImage. The local file also needs to add a file end callback, so that you can know when the file playback is completed and send the corresponding signal for processing. You can call the PlayM4_SetFileEndCallback callback function to set the file playback. In the FileEndCallback callback function, the interface is notified by asynchronously executing the QMetaObject::invokeMethod stop function.
Please note the following about local files:
PlayM4_CloseStream cannot be called when playing in file mode.
Streaming is put down and the PlayM4_CloseFile API cannot be called.
Stream switch interface and file switch interface cannot be cross-used.
II. Functional features
Support for playback of video streams and local MP4 files.
Both handle and callback modes are supported.
Multi-thread display image, do not card the main interface.
Automatically reconnect the webcam.
The border size can be set, that is, the offset and the border color.
You can set whether to draw OSD tags, that is, label text or pictures and label locations.
There are two OSD locations and styles that can be set.
You can set whether to save to a file and the file name.
You can drag the file directly to the haikangwidget control to play.
H364/h365 video streaming is supported.
Playback can be paused and resumed.
Support for storing individual video files and storing video files at regular intervals.
Customize the top suspension bar and send click signal notification, which can be set whether it is enabled or not.
Can set screen stretch fill or proportional fill.
Programmable decoding is speed priority, quality priority and balanced processing.
You can take screenshots (original pictures) and screenshots (video forms) of the video.
The video file is stored as a MP4 file.
Support focal length control, head control.
Customizable function.
Third, effect picture
4. The core code bool HaiKangThread::playLocal () {/ / transcode to support the Chinese path QTextCodec * codec = QTextCodec::codecForName ("gb2312"); QByteArray data = codec- > fromUnicode (url); PlayM4_GetPort (& port); bool ok = PlayM4_OpenFile (port, data.data ()); if (ok) {/ / sets the callback function PlayM4_SetFileEndCallback (port, FileEndCallback, this) after the file is played / / callback can get audio and video data, otherwise if (callback) {PlayM4_SetDecCallBackMend (port, DecCallBack, (quser) this); PlayM4_Play (port, NULL);} else {PlayM4_Play (port, (HWND) playWidget- > winId ());} / / play sound PlayM4_PlaySound (port) at the same time / / rewind / / PlayM4_ReversePlay (port); / / Fast forward playback, faster to call / / PlayM4_Fast (port); / / PlayM4_Fast (port); ok = true; qDebug ()
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
Method: 1. Use when the file has no git operation. "
© 2024 shulou.com SLNews company. All rights reserved.