FFmpeg学习笔记


  • Tuesday, Sep 12, 2017

查看视频信息

使用ffprobe

文档: https://ffmpeg.org/ffprobe.html

插入关键帧

-force_key_frames

一般使用expr:expr方式来指定:

If the argument is prefixed with expr:, the string expr is interpreted like an expression and is evaluated for each frame. A key frame is forced in case the evaluation is non-zero.

文档: https://ffmpeg.org/ffmpeg.html
expr函数可以参考: https://ffmpeg.org/ffmpeg-all.html#Expression-Evaluation

视频分割

ffmpeg -i 4M.mp4 -codec:v h264 -codec:a copy \
 -force_key_frames 'expr:if(isnan(prev_forced_t),gte(t,0),gte(t,prev_forced_t+5))' \
 -f segment -segment_list test.ffcat -segment_times 5,10 -segment_time_delta 1 out%03d.ts

文档: https://ffmpeg.org/ffmpeg-all.html#segment_002c-stream_005fsegment_002c-ssegment

视频合并

ffmpeg -f concat -i test.ffcat -c copy 4Mconcated.mp4

参考: http://blog.csdn.net/xiaojun111111/article/details/52438230


本文地址