因为经常需要用到ffmpeg
用到的情况1:
直接用‘ffmpeg -i file.wmv %d.tif’ 不行
解决办法是:先用 ‘ffmpeg -i file.wmv %d.jpg’
然后再把图片转成tif形式
------------------------------分割线----------------------
各种乱七八糟的reference:
!!! https://blog.csdn.net/yu540135101/article/details/103025957
https://www.bookstack.cn/read/other-doc-cn-ffmpeg/ffmpeg-doc-cn-06.md
ffmpeg -i src01.avi %d.jpg
-pix_fmts
这篇还不错:https://www.ruanyifeng.com/blog/2020/01/ffmpeg.html
%d.jpg
https://zhuanlan.zhihu.com/p/67878761
ffmpeg -i hela_wbc_01.wmv -pix_fmts yuv420p%05.tif
ffmpeg -pix_fmts yuv420p -i hela_wbc_01.wmv %05.tif
ffmpeg -f rawvideo -pix_fmts yuv420p -r 25 -i hela_wbc_01.wmv -pix_fmts yuv420p %05.tif
ffmpeg -pix_fmts yuv420p -i hela_wbc_01.wmv -pix_fmts yuv420p %05.tif
FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL
IO... yuv420p 3 12
我需要做的事情是把视频提取出来
具体如何完成呢?
参考代码:
ffmpeg -f rawvideo -pix_fmt yuv420p -s cif -r 25 -i YUV420p_cif.yuv -vcodec mpeg2video -pix_fmt yuv420p -r 25 -g 25 -s cif -b:v 1024k Output.mp4
ffmpeg -f rawvideo -pix_fmt yuv420p -s cif -r 25 -i YUV420p_cif.yuv -vcodec mpeg2video -pix_fmt yuv420p -r 25 -g 25 -s cif -b:v 1024k Output.mp4
视频的bit rate
color space Color space : YUV
https://blog.csdn.net/yu540135101/article/details/100727047
提取YUV数据
ffmpeg -i input.mp4 -an -c:v rawvideo -pixel_format yuv420p out.yuv
-c:v rawvideo 指定将视频转成原始数据
-pixel_format yuv420p 指定转换格式为yuv420p
播放这个
ffplay -s wxh out.yuv
YUV转H264
ffmpeg -f rawvideo -pix_fmt yuv420p -s 320x240 -r 30 -i out.yuv -c:v libx264 -f rawvideo out.h264
ffmpeg -f rawvideo -pix_fmt yuv420p -s 320x240 -r 30 -i hela_wbc_01.wmv -c:v libx264 -f rawvideo out.wmv
ffmpeg -i input.mp4 -vf hue=s=0 output.mp4
ffmpeg -i hela_wbc_01.wmv -vf hue=s=0 output.mp4
ffmpeg -i output.mp4 %d.jpg
ffmpeg -i file.wmv %d.jpg
网友评论