2017-08-08 73 views
0

例如:如何使用FFmpeg在秒之间切换视频?

startMs = 2.4. 
endMs = 5.4 
I have tried this code: 
String[] complexCommand = {"-i", yourRealPath, "-ss", "" + startMs, "-acodec", "copy", "-vcodec", "copy", "-t", "" + (endMs - startMs), dest.getAbsolutePath()}; 

但切削过程发生具有完全值(INT值)...从“秒2”至“5秒”
是否有任何方式削减视频与“浮点值“?
谢谢

回答

0

你不能使用时间戳吗?喜欢的东西:

String startMs = "00:00:02.400"; 
String endMs = "00:00:05.400"; 
Srting totalMs = "00:00:03.000"; 

String[] complexCommand = {"-i", yourRealPath, "-ss", "" + startMs, "-acodec", "copy", "-vcodec", "copy", "-t", "" + (endMs - startMs), dest.getAbsolutePath()}; 

Refer to this link

您可能需要适应的东西,现在我无法测试它,但它是woth一试。祝你好运!

+0

谢谢,我试过了,但它不起作用。 –