ffmpeg cut and concat single command line

时光总嘲笑我的痴心妄想 提交于 2019-12-11 00:54:37

问题


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

回答1:


The fast method:

Create a text file.

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

Run

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

The slow method:

Run

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


来源:https://stackoverflow.com/questions/42250223/ffmpeg-cut-and-concat-single-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!