java calls ffmpeg to intercept video from camera video stream to generate video is too slow, and the interception duration and setting duration are not correct(operating system-Windows)

dclhaolove 注册会员
2023-02-28 18:21

Monster Group and GPt-based tuning:
For the first problem, it may be caused by the use of FFmpeg commands or parameters that are not optimized enough. Here are some suggestions that might help:

Adjust FFmpeg's buffer size(buffer size) : You can increase the size of the buffer by adding the "-bufsize" parameter to improve reading speed. For example, -bufsize 4096k indicates that the buffer size is set to 4MB.

Adjust the buffer size of the input stream: If you are capturing the video stream from the camera, try increasing the buffer size, for example by using the "-duration 5000000-probesize 5000000" parameter to set FFmpeg to analyze the input stream for longer.

Adjusting video codecs: Different codecs have different effects on different video quality and speed. You can try encoding with a different codec, such as using the H.264 codec instead of the MPEG-2 codec.

For the second problem, it may be caused by FFmpeg not handling the end frame in the video stream correctly. You can try using the -t parameter to explicitly set the length of time to be captured. For example, -t 10 means to capture a 10-second video. You can also specify the frame rate of the output video in the command. For example, -r 25 indicates that the output video frame rate is 25 frames per second.

In general, the speed and accuracy of video capture and generation can be optimized by adjusting the commands and parameters of FFmpeg. Also, make sure your computer's hardware is configured to handle camera video streams, such as having enough memory and processor speed.

About the Author

Question Info

Publish Time
2023-02-28 18:21
Update Time
2023-02-28 18:21

Related Question


qt报错 error: LNK1104: 无法打开文件“libboost_atomic-vc142-mt-gd-x64-1_78.lib.lib”


与独立的spring boot嵌入式tomcat漏洞相比

操作' messages.insertOne() '缓冲在10000ms后超时

ImportBeanDefinitionRegistrar 注册bean


如何获取firebase firestore文档id

Octokit API Exception: "is at xx but expected yy"