-
转换图片到H.264裸码流,将单张图片直接转换输出到H264码流:
ffmpeg.exe -framerate 30 -i E:\Users\Pictures\video_loading_1080.png -c:v libx264 -crf 23 -pix_fmt yuv420p 1080-2.h264
-
指定profile:
ffmpeg.exe -framerate 30.000 -i loading3840x2160.png -c:v libx264 -profile:v main -level 5.2 -crf 23 -pix_fmt yuv420p loading_3840x2160.h264
参考:
Convert Image Sequence to H264 using ffmpeg · GitHub
Image sequence into H.264 / MPEG-4 AVC
-
去除H264文件中的B帧:
ffmpeg.exe -i logs\video_loading_1080.h264 -vcodec libx264 -x264opts "bframes=0" video_loading_1080_noBframes.h264
参考:
-
只保留I帧
ffmpeg.exe -i logs\video_loading_1080.h264 -vcodec libx264 -x264opts "bframes=0:keyint=1:min-keyint=1" video_loading_1080_noBframes.h264
-
keyint=1:min-keyint=1
主要设置 I帧间隔 和最小I帧间隔,其实就是GOP数量
参考:
-
设置关键帧间隔为每60帧一个关键帧,并去除B帧
ffmpeg.exe -i logs\video_loading_1080.h264 -vcodec libx264 -x264opts "bframes=0:keyint=60" video_loading_1080_noBframes.h264