ffmpeg 和 ffmpy3

ffmpeg -ss 00:03:00 -i C:\Users\pc\Desktop\video\Indoor_Supermarket_00001_2.mp4 -to 00:58:00 -c copy C:\Users\pc\Desktop\result\a\cut.mp4



ff = FFmpeg(
            inputs={"1.mp4": ['-ss', '00:03:00']},
            outputs={'output.ts': ['-to', '00:58:00','-c', 'copy']}
        )




		
ffmpeg -i input1.mp4 -i input2.mp4 -i input3.mp4 -lavfi hstack=inputs=3 output.mp4



ff = FFmpeg(
            inputs={"file_list.txt": ['-f', 'concat']},
            outputs={'output.ts': ['-acodec', 'copy','-vcodec', 'copy','-absf','aac_adtstoasc']}
        )
	


ffmpeg -f concat -i file_list.txt -acodec copy -vcodec copy -absf aac_adtstoasc output.mp4

D:\ffmpeg-4.4-full_build\bin
import subprocess as sp
# 获取视频时长
def get_video_duration(mp4_path):
    result = sp.run(["ffprobe", "-v", "error", "-show_entries",
                     "format=duration", "-of",
                     "default=noprint_wrappers=1:nokey=1", mp4_path],
                     stdout=sp.PIPE,
                     stderr=sp.STDOUT)
    return float(result.stdout)

使用ffmpeg分割视频
https://blog.csdn.net/weixin_46021205/article/details/105078552

posted @ 2021-10-28 13:49  不能说的秘密  阅读(269)  评论(0编辑  收藏  举报