用FFMPEG对YUV序列进行编辑的笔记

还是单独开一个吧 每次找挺烦的

播放YUV序列

ffmpeg -f rawvideo -pix_fmt yuv420p -s 3840x2160 -i "Wood.yuv" -vf "scale=1280x720" -c:v rawvideo -pix_fmt yuv420p -f sdl "Wood"

4K序列转720P

ffmpeg -f rawvideo -pix_fmt yuv420p -s 3840x2160 -i "G:\xiph_dataset\2020tcsvt\YUV_4K\Traffic Flow.yuv" -vf "scale=1280x720" -c:v rawvideo -pix_fmt yuv420p -f rawvideo "G:\xiph_dataset\2020tcsvt\4K\Traffic Flow.yuv"

按100帧分割视频

for %i in ("G:\xiph_dataset\2020tcsvt\4K\*.yuv") do ffmpeg  -pixel_format yuv420p -f rawvideo -s 1280x720 -i "%i" -vf format=yuv420p -f segment  -segment_frames 100,200 -reset_timestamps 1 -map 0 "G:\xiph_dataset\2020tcsvt\100frame\%~ni_%03d.yuv"

按30帧分割视频

for %i in ("G:\xiph_dataset\2020tcsvt\100frame\*.yuv") do ffmpeg  -pixel_format yuv420p -f rawvideo -s 1280x720 -i "%i" -vf format=yuv420p -f segment  -segment_frames 30,60,90,120,150,180,210,240,270,300,330,360,390,420,450,480,510,540,570,600,630,660,690,720,750,780 -reset_timestamps 1 -map 0 "G:\xiph_dataset\2020tcsvt\my420\%~ni_%03d.yuv"

计算txt行中特殊字符数量

findstr /R /C:"0$" "D:\dls\2022TMM\root\list\local_5_30_test.txt" | find /C /V ""
findstr /R /C:"1$" "D:\dls\2022TMM\root\list\local_5_30_test.txt" | find /C /V ""
findstr /R /C:"2$" "D:\dls\2022TMM\root\list\local_5_30_test.txt" | find /C /V ""

YUV转PNG

for %i in ("C:\Users\hush\Desktop\TEST\*.yuv") do ffmpeg -s 1280x720 -i "%i" -vf "setpts=PTS-STARTPTS" -q:v 1 "C:\Users\hush\Desktop\TEST\%~ni_%2d.png"

for %i in ("D:\dls\2019TCSVT\local_exam\60M\recon\*.yuv") do ffmpeg -s 1280x720 -i "%i" -vf "setpts=PTS-STARTPTS" -q:v 1 "D:\dls\2022TMM\Dataset\5M_60M\pumap\1\%~ni_%2d.png"

for %i in ("D:\dls\2019TCSVT\local_exam\5M_30M_30M\recon\*.yuv") do ffmpeg -s 1280x720 -i "%i" -vf "setpts=PTS-STARTPTS" -q:v 1 "D:\dls\2022TMM\Dataset\5M_30M\pumap\2\%~ni_%2d.png"

for %i in ("D:\dls\2019TCSVT\local_exam\30M_30M\recon\*.yuv") do ffmpeg -s 1280x720 -i "%i" -vf "setpts=PTS-STARTPTS" -q:v 1 "D:\dls\2022TMM\Dataset\5M_30M\pumap\2\%~ni_%2d.png"



cd C:\Users\admin\Desktop\x265\x265_3.3\build\vc15-x86_64\Release
for %i in ("C:\Users\admin\Desktop\1\*.yuv") do x265.exe --preset slow --input "%i" --fps 60 --input-res 1280x720 --output "C:\Users\admin\Desktop\1\5M\%~ni_5M.bin" --recon "C:\Users\admin\Desktop\1\5M\%~ni_5M.yuv" --bitrate 5000 --keyint 10 --min-keyint 10 --no-scenecut --bframes 0 --rect --amp 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值