ffmpeg常用命令(不定时更新)

码流转mp4

ffmpeg -i 500kb.h265 -vcodec h264 -f mp4 6pk_265_500.mp4

剪切mp4

ffmpeg -ss 00:00 -t 20 -i 6pk.mp4 -vcodec copy 6pk_shake.mp4

ffmpeg -i input.mp4 -vf "select=between(n\,20\,200)"  output.mp4

剪切yuv

ffmpeg -s 1080x1920 -i newsit3_1080x1920_30_cutsame.yuv -c:v rawvideo -filter:v select="between(n\, 0\, 499)" newsit3_1080x1920_30.yuv

剪切10bit的yuv时需要对格式进行提前设定,否则剪切出来的有问题。

ffmpeg -pix_fmt yuv420p10le -s 1920x1080 -i Bin_2022_tv_3_clip_1_1920x1080_25_f228_skip_552.yuv  -c:v rawvideo -filter:v select="between(n\, 80\, 100)" recon.yuv

拼接4个视频组成2x2窗格同时播放

ffmpeg -i 4pk_264_talk.mp4 -filter_complex  "[0:v]pad=iw*2:ih*2[a];[a][0:v]overlay=w[b];[b][0:v]overlay=0:h[c];[c][0:v]overlay=w:h" 4pk_264_talk_hun.mp4

拼接6个视频组成直播6pk窗格同时播放

ffmpeg -i 6pk_264_talk.mp4 -i 6pk_264_talk_s.mp4  -filter_complex  "[0:v]pad=iw*2:ih*3/2[a];[a][0:v]overlay=w[b];[b][1:v]overlay=0:h*2[c];[c][1:v]overlay=w:h*2[d];[d][1:v]overlay=w*2:h*2[e];[e][1:v]overlay=w*3:h*2" 6pk_264_talk_hun.mp44

Ffmpeg缩放mp4

ffmpeg -i 6pk_264_talk.mp4 -vf scale=240:240 6pk_264_talk_s.mp4

ffmpeg mp4yuv

ffmpeg -i test.mp4 test.yuv

ffmpeg yuvmp4 无损

ffmpeg -f rawvideo -pix_fmt yuv420p -s 488x480 -i !yuvname!_one.yuv -vcodec libx264 -x264-params qp=0 -pix_fmt yuv420p oneframe/!yuvname!.mp4

ffmpeg缩放YUV

ffmpeg –s 1920x1080 –i test.yuv –vf scale=1280x720 out.yuv

ffmpeg解码码流

ffmpeg –i test.265 output.yuv

ffmpeg转码(无损)

ffmpeg -i pm_720x1280_2000_shake.mp4 -vcodec libx264 -x264-params qp=0 pm_720x1280_2000_shake_264.mp4

你可能感兴趣的:(视频技术,音视频)