use*_*159 1 video ffmpeg image image-processing thumbnails
要在100几秒钟内从图像获取缩略图,我可以做ffmpeg -ss 100 -i /tmp/video.mp4 -frames:v 1 -s 200x100 image.jpg。但是,如果视频时间少于100几秒钟,则ffmpeg不会创建缩略图,也不会退出并显示任何错误代码,这是非常意外的。
该命令将退出,没有错误代码(退出状态为0)。它只会输出一条stderr说出的信息Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)。
我希望ffmpeg在未创建缩略图的任何情况下以错误代码退出。否则,在ffmpeg命令之后,我将始终必须从应用程序代码中再次进行检查,以确保已将预期数量的缩略图输出到文件系统。
是否有办法解决这个应用程序级检查,并迫使ffmpeg在未成功将缩略图写入文件系统时失败?
使用
ffmpeg -ss 100 -i /tmp/video.mp4 -frames:v 1 -s 200x100 image.jpg -abort_on empty_output
Run Code Online (Sandbox Code Playgroud)
1失败时返回。
| 归档时间: |
|
| 查看次数: |
1017 次 |
| 最近记录: |