ffmeg 截取视频帧

按帧数截取

  从头截取 (前30帧)

 

ffmpeg -s 1920x1080 -i input.yuv -c:v rawvideo -filter:v select="gt(n\, -1)" -vframes 30 out30.yuv
ffmpeg -s 1920x1080 -i input.yuv -c:v rawvideo -filter:v select="between(n\, 0\, 29)" out30.yuv
ffmpeg -r 1 -ss 0 -i input.yuv -vcodec copy -vframes 30 output.yuv

   中间截取 (30-100帧)

 

ffmpeg -s 1920x1080 -i input.yuv -c:v rawvideo -filter:v select="between(n\, 30\, 100)" out.yuv

    按时间截取

 

ffmpeg -s 1920x1080 -i input.yuv -c:v rawvideo -filter:v select="between(t\, 10\, 20)" out.yuv
ffmpeg -s 1920x1080 -r 1 -ss 10 -t 10 -i input.yuv -c:v copy out.yuv

 

你可能感兴趣的:(技术)