level 7
在请问一下 这是 封装 时候的 语句吗?
ffmpeg -i <input_file> -ss <timecode> -t <timecode> -vcodec copy -acodec copy <output_file>
那两个 <timecode> 应该如何写 - -? 是不是 就是直接 TXT 文件?
谢谢了...
2012年03月01日 11点03分
1
level 1
‘-t duration (output)’
Stop writing the output after its duration reaches duration. duration may be a number in seconds, or in hh:mm:ss[.xxx] form.
‘-ss position (input/output)’
When used as an input option (before -i), seeks in this input file to position. When used as an output option (before an output filename), decodes but discards input until the timestamps reachposition. This is slower, but more accurate.position may be either in seconds or in hh:mm:ss[.xxx] form.
见ffmpeg文档,这两个参数是用来截取的
2012年03月01日 12点03分
2
level 1
抽tc
mp4用lsmash附带的boxdumper
boxdumper --timestamp inputfile
mkv用mkvextraxt
mkvextract timecodes_v2 "a movie.mkv" 1:timecodes_track1.txt
或者ffms2附带的ffmsindex
ffmsindex -c inputfile
2012年03月01日 12点03分
3
level 1
boxdumper提取出来的那个是什么呢?格式看着不像时间码,但是DTS后面的数字倒是与v2格式的时间码中的数字很相似,如果去掉后面的六个零,即使不是完全相等也只差1……
2012年03月01日 18点03分
4
level 1
boxdumper输出的timestamp,要根据timescale换算过,才能转成timecode v2格式
(cts - off) / timeScale * 1000.0
然后排个序
如果要直接输出timecode v2格式
mp4fpsmod -p timecode.txt input.mp4
dtsedit -o timecodes.txt input.mp4
2012年03月02日 01点03分
5