天!! 怎么ffmpeg的-t和-to放在output前,效果一样呢?
dwing吧
全部回复
仅看楼主
level 5
syklabs 楼主
-t duration (input/output)
When used as an input option (before -i), limit the duration of data read from the input file.
When used as an output option (before an output filename), stop writing the output after its duration reaches duration.
duration may be a number in seconds, or in hh:mm:ss[.xxx] form.
-to and -t are mutually exclusive and -t has priority.
-to position (output)
Stop writing the output at position. position may be a number in seconds, or in hh:mm:ss[.xxx] form.
-to and -t are mutually exclusive and -t has priority.
上面是-t和-to的官方文档的解释,,我没理解错的话,-to是指到指定位置停止写入,怎么我的做法ffmpeg -ss 00:05:19 -i asdf.mkv -to 00:06:49 2.mp3 出来的却是一个6分49秒的音频呢?他这样跟-t没区别了啊,应该是到视频的6分49秒就停止啊!!
2014年11月16日 16点11分 1
level 5
-to和-t的不一样的地方就是-t可以用在-i之前,别的区别没有发现。
ffmpeg -t 20 -i in.mp4 -ss 10 -c copy ok.mp4
ffmpeg -to 20 -i in.mp4 -ss 10 -c copy ok.mp4
第一个命令是可以的,第二个会提示错误。仅代表个人看法,而且我也不知道用在-i之前有什么特别的地方。
楼主想用to指定输入文件的时间点为止,这个我也尝试过,不管是mencoder还是ffmpeg好像都不支持这种方法。都得自己计算一下想截取的片断的Duration,如果有其它办法也请大家明示!
2014年11月17日 07点11分 2
level 8
目测,把-ss作为输出选项,就会出现不一样的结果。
2014年11月18日 10点11分 3
level 8
The real answer is that it works as expected. The -ss option specified before the input lets ffmpeg seek to that position first and then start encoding at 00:00:00 as a time stamp.
This means that it does not matter if you encode for 5 minutes with -t or encode up to 00:05:00 with -to – because you started at 00:00:00.
If you want to start at a later timestamp, cut the file by using -ss after -i. That way, ffmpeg will encode, but start outputting at the specified time stamp, which makes the options work as you expect them to.
2014年11月18日 10点11分 4
1