ffmpeg 视频裁剪 10秒内失败解决

简介: ffmpeg 视频裁剪 10秒内失败解决

ffmpeg升级到最新版

wget https://cms-l33.oss-cn-shanghai.aliyuncs.com/2021-12-21/1581b91d-ccb9-482e-8d76-bf5d925d79ea_trailer.mp4

ffmpeg -i 1581b91d-ccb9-482e-8d76-bf5d925d79ea_trailer.mp4 -vcodec libx264 -keyint_min 50 -g 50 -sc_threshold 0 -acodec copy out.mp4
ffmpeg -i out.mp4 -ss 00:00:00 -to 00:00:01 -vcodec copy -acodec copy -strict experimental out-1.mp4
ffmpeg -i out.mp4 -ss 00:00:30 -to 00:00:52 -vcodec copy -acodec copy -strict experimental out-2.mp4
echo -e "file 'out-1.mp4' \nfile 'out-2.mp4'" >> list.txt
ffmpeg -safe 0 -f concat -i list.txt -c copy -strict -2 concat.mp4
ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy -strict -2 concat2.mp4
ffmpeg -fflags +igndts -safe 0 -f concat -i list.txt -vcodec copy -acodec copy -strict -2 concat3.mp4

ffmpeg -i out.mp4 -ss 00:00:00 -to 00:00:01 -vcodec copy -acodec copy out-1.mp4
ffmpeg -i out.mp4 -ss 00:00:30 -to 00:00:52 -vcodec copy -acodec copy out-2.mp4
echo -e "file 'out-1.mp4' \nfile 'out-2.mp4'" >> list.txt
ffmpeg -safe 0 -f concat -i list.txt -c copy concat.mp4

ffmpeg -ss 00:00:00 -to 00:00:01 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -avoid_negative_ts 1 -y out-1.mp4
ffmpeg -ss 00:00:30 -to 00:00:52 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -avoid_negative_ts 1 -y out-2.mp4
echo -e "file 'out-1.mp4' \nfile 'out-2.mp4'" >> list.txt
ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy -strict -2 -y concat.mp4

ffmpeg -ss 00:00:00 -to 00:00:01 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -y out-1.mp4
ffmpeg -ss 00:00:30 -to 00:00:52 -accurate_seek -i out.mp4 -vcodec copy -acodec copy -y out-2.mp4
echo -e "file 'out-1.mp4' \nfile 'out-2.mp4'" >> list.txt
ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy -strict -2 -y concat.mp4

相关文章
|
1月前
|
存储 编解码 算法
深度探索:使用FFmpeg实现视频Logo的添加与移除(二)
深度探索:使用FFmpeg实现视频Logo的添加与移除
42 0
|
1月前
|
存储 编解码 数据处理
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码(三)
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码
35 0
|
1月前
|
存储 编解码 数据处理
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码(二)
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码
37 0
|
1月前
|
存储 编解码 调度
剖析ffmpeg视频解码播放:时间戳的处理
剖析ffmpeg视频解码播放:时间戳的处理
51 0
|
1月前
|
编解码 算法 vr&ar
深度剖析FFmpeg视频解码后的帧处理到Qt显示 从AVFrame到QImage的转换(二)
深度剖析FFmpeg视频解码后的帧处理到Qt显示 从AVFrame到QImage的转换
30 1
|
1月前
|
存储 编解码 算法
深度剖析FFmpeg视频解码后的帧处理到Qt显示 从AVFrame到QImage的转换(一)
深度剖析FFmpeg视频解码后的帧处理到Qt显示 从AVFrame到QImage的转换
62 1
|
1月前
|
设计模式 存储 缓存
【ffmpeg C++ 播放器优化实战】优化你的视频播放器:使用策略模式和单例模式进行视频优化
【ffmpeg C++ 播放器优化实战】优化你的视频播放器:使用策略模式和单例模式进行视频优化
53 0
|
1月前
|
存储 缓存 编解码
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码(一)
【FFmpeg 视频基本格式】深入理解FFmpeg:从YUV到PCM,解码到编码
43 0
|
1月前
|
机器学习/深度学习 编解码 算法
深度探索:使用FFmpeg实现视频Logo的添加与移除(三)
深度探索:使用FFmpeg实现视频Logo的添加与移除
21 0
|
1月前
|
编解码 Linux 数据安全/隐私保护
深度探索:使用FFmpeg实现视频Logo的添加与移除(一)
深度探索:使用FFmpeg实现视频Logo的添加与移除
60 0