为什么写这篇文章? 起因是项目中会用到rtsp流,用于分析视频,和语音口令,还有就是控制摄像头和做监控时候做云端存储功能。在网上找了一大圈发现这方面资料很少,资料中大部分人还是FFmpeg的安装程序加代码的方式实现。 其实JAVACV和OPENCV是非常强大的。当然我了解的也不多(因为源码没有什么注释!!理解起来很困难)。这篇文章最主要是针对于目前GPT和通义前问中提供的代码进行纠错和改正(特别是从rtsp中只取出音频)。 部分代码是他人提供,所以看起来会有差异,不过我会进行说明。 pom <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacv-platform</artifactId> <version>1.5.9</version> </dependency> 取出视频保存为mp4代码 public static void videoPuller(String rtspUrl, int duration, String outputFile) { FFmpegFrameGrabber grabber =...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with .setAudio
Contact .setAudio, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack