修复问题

This commit is contained in:
2025-09-28 18:30:39 +08:00
parent 516f4e94c9
commit 1e5166c403
2 changed files with 35 additions and 2 deletions

View File

@@ -36,13 +36,22 @@
<groupId>org.bytedeco</groupId>
<artifactId>javacv-platform</artifactId>
<version>1.5.12</version>
<exclusions>
<exclusion>
<groupId>org.bytedeco</groupId>
<artifactId>opencv</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 明确指定OpenCV版本 -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>opencv-platform</artifactId>
<version>4.11.0-1.5.12</version>
</dependency>
<!-- 解析 models.json-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
@@ -79,4 +88,28 @@
</dependencies>
<build>
<plugins>
<!-- 其他插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<dependencyConvergence />
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -480,8 +480,8 @@ public class MediaTransferFlvByJavacv extends MediaTransfer implements Runnable
}
// 记录帧
if (frame != null) {
long now = System.currentTimeMillis();
if (frame != null) { long now = System.currentTimeMillis();
if (startTime == 0) startTime = now;
videoTS = 1000 * (now - startTime);
if (videoTS > recorder.getTimestamp()) recorder.setTimestamp(videoTS);