我有视频:
video1 - 923秒 video2 - 1457秒 video3 - 860秒
我需要削减这些视频,并修正其持续时间- 600秒。但困难在于我需要把他们纳入这个计划。

其中:
在此之后,我需要在新的600秒视频中加入蓝色和绿色片段,例如

由于video1,video2,video3有不同的持续时间,那么红色和绿色的片段必须有不同的持续时间,它们必须与视频的持续时间成相等的比例。
我需要纯ffmpeg (avconv)命令或bash脚本。我不知道怎么做。
发布于 2013-06-27 10:21:57
这样做的简单方法可能是创建一个编辑决策列表(EDL),然后您可以使用它来编写您的最终视频。我不知道ffmpeg/avconv,但是mplayer/mencoder会处理这些问题,参见文档。
若要创建EDL,请使用如下函数:
make_edl() {
DUR=$1
PRE=$2
SLICES=$3
POST=$4
## get the duration of the cut-up pieces
SNIPPET=$(((DUR-PRE-POST)/SLICES))
START=$PRE
STOP=$((DUR-POST))
curr=$START
while [ $curr -lt $STOP ]; do
currstop=$((cur+SNIPPET))
if [ $currstop -gt $STOP ]; then
currstop=$STOP
fi
echo "${curr} $((curr+SNIPPET)) 0"
curr=$((curr+2*SNIPPET))
done
}
# ...
## the following create an EDL for a 923sec movie,
## where we have 120sec of intro, than 31 alternating slices
## and 120sec of outro
make_edl 923 120 31 120 > myedl.txt
## apply the EDL
mencoder -edl myedl.txt input923.mov -o output923.mov由于bash算法的局限性(仅为整数),这不是很好。
https://stackoverflow.com/questions/17335736
复制相似问题