ffmpeg剪切和concat单个命令行 [英] ffmpeg cut and concat single command line

查看:150
本文介绍了ffmpeg剪切和concat单个命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个flac音频文件,我需要使用不同的时间码剪切它们,然后使用一个带有ffmpeg的命令行将它们串联起来。有办法吗?
我做了类似的事情,但是效果不是很好,输出文件的时间戳都弄乱了(不是从00:00开始有输出标记,而是从59:90开始有文件!)另外,该命令行非常慢,并且仅在UNIX系统上起作用...希望有人可以帮助我

I have two flac audio files, I need to cut them with different timecodes and then concatenated them using one single command line with ffmpeg. Is there a way to do it? I did something like that but it's not working very well, the timestamps of the outputs file are all messed up (instead of having an output flac beginning from 00:00 I have a file beginning from 59:90!!) Also this command line is insanely slow and it works only on unix system...hope someone could help me

mkfifo temp1 temp2 
ffmpeg -y -i PMM_20170116-1100_1.flac -ss 3590 -t 10 -c copy -acodec copy -f flac temp1 2> /dev/null  & ffmpeg -y -i PMM_20170116-1200_1.flac -ss 0 -t   3590 -c copy -acodec copy -f flac temp2 2> /dev/null & ffmpeg -f flac -i "concat:temp1|temp2" -ac 2 -ar 48000 cutmergetest.flac


推荐答案

快速方法

创建文本文件。

file file1.flac
inpoint 3590
outpoint 3600
file file2.flac
inpoint 0
outpoint 3590

运行

ffmpeg -f concat -i list.txt -c copy merged.flac

慢速方法

运行

ffmpeg -ss 3590 -t 10 -i file1.flac -ss 0 -t 3590 -i file2.flac -filter_complex "[0][1]concat=n=2:v=0:a=1" -ac 2 -ar 48000 cutmergetest.flac

这篇关于ffmpeg剪切和concat单个命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆